auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] [elpa] externals/auctex 4046481 01/12: Use closure rather


From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex 4046481 01/12: Use closure rather than hand-made lambda
Date: Sat, 17 Apr 2021 15:13:20 -0400 (EDT)

branch: externals/auctex
commit 4046481ae70597907ea2691ffedd15236aa9d829
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>

    Use closure rather than hand-made lambda
    
    * latex.el (LaTeX-math-initialize):
    * style/kpfonts.el (math):
    * toolbar-x.el (toolbarx-make-command):
    Use closure rather than hand-made lambda form.
---
 latex.el         |  4 ++--
 style/kpfonts.el |  4 ++--
 toolbar-x.el     | 16 +++++++++-------
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/latex.el b/latex.el
index 68ed0f3..ddd2968 100644
--- a/latex.el
+++ b/latex.el
@@ -5389,8 +5389,8 @@ MENU and CHARACTER, see `LaTeX-math-list' for details.")
         (if (stringp value)
             (progn
               (setq name (intern (concat "LaTeX-math-" value)))
-              (fset name (list 'lambda (list 'arg) (list 'interactive "*P")
-                               (list 'LaTeX-math-insert value 'arg))))
+              (fset name (lambda (arg) (interactive "*P")
+                           (LaTeX-math-insert value arg))))
           (setq name value))
         (if key
             (progn
diff --git a/style/kpfonts.el b/style/kpfonts.el
index 09ba8a2..6483b2e 100644
--- a/style/kpfonts.el
+++ b/style/kpfonts.el
@@ -463,8 +463,8 @@ the sequence by initializing this variable.")
       (if (stringp value)
           (progn
             (setq name (intern (concat "LaTeX-kpfonts-" value)))
-            (fset name (list 'lambda (list 'arg) (list 'interactive "*P")
-                             (list 'LaTeX-math-insert value 'arg))))
+            (fset name (lambda (arg) (interactive "*P")
+                         (LaTeX-math-insert value arg))))
         (setq name value))
       (if key
           (progn
diff --git a/toolbar-x.el b/toolbar-x.el
index 903701c..1164797 100644
--- a/toolbar-x.el
+++ b/toolbar-x.el
@@ -251,13 +251,15 @@ command, COMM is returned."
              (not app)
              comm-is-command)
         comm
-      (append '(lambda nil (interactive))
-              (when prep (list prep))
-              (when comm
-                (if comm-is-command
-                    `((call-interactively (function ,comm)))
-                  (list comm)))
-              (when app (list app))))))
+      (lambda () (interactive)
+        (let (result)
+          (when prep (setq result (eval prep t)))
+          (when comm (setq result
+                           (if comm-is-command
+                               (call-interactively comm)
+                             (eval comm t))))
+          (when app  (setq result (eval app  t)))
+          result)))))
 
 (defun toolbarx-emacs-mount-popup-menu
     (strings var type &optional title save)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]