emacs-diffs
[Top][All Lists]
Advanced

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

master e4b99f2: * lisp/menu-bar.el (menu-bar-edit-menu): Expose lambdas


From: Stefan Monnier
Subject: master e4b99f2: * lisp/menu-bar.el (menu-bar-edit-menu): Expose lambdas to the compiler
Date: Sat, 16 Oct 2021 00:07:11 -0400 (EDT)

branch: master
commit e4b99f24f8e8e63cf3d3c1da47d5dc1e6dda61bb
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * lisp/menu-bar.el (menu-bar-edit-menu): Expose lambdas to the compiler
---
 lisp/menu-bar.el | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 1c3b801..6dd1896 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -515,10 +515,10 @@
                                        kill-ring))
                                     (not buffer-read-only))))
                   :help "Paste (yank) text most recently cut/copied"
-                  :keys (lambda ()
-                          (if cua-mode
-                              "\\[cua-paste]"
-                            "\\[yank]"))))
+                  :keys ,(lambda ()
+                           (if cua-mode
+                               "\\[cua-paste]"
+                             "\\[yank]"))))
     (bindings--define-key menu [copy]
       ;; ns-win.el said: Substitute a Copy function that works better
       ;; under X (for GNUstep).
@@ -527,23 +527,23 @@
                             'kill-ring-save)
                   :enable mark-active
                   :help "Copy text in region between mark and current position"
-                  :keys (lambda ()
-                          (cond
-                           ((featurep 'ns)
-                            "\\[ns-copy-including-secondary]")
-                           ((and cua-mode mark-active)
-                            "\\[cua-copy-handler]")
-                           (t
-                            "\\[kill-ring-save]")))))
+                  :keys ,(lambda ()
+                           (cond
+                            ((featurep 'ns)
+                             "\\[ns-copy-including-secondary]")
+                            ((and cua-mode mark-active)
+                             "\\[cua-copy-handler]")
+                            (t
+                             "\\[kill-ring-save]")))))
     (bindings--define-key menu [cut]
-      '(menu-item "Cut" kill-region
+      `(menu-item "Cut" kill-region
                   :enable (and mark-active (not buffer-read-only))
                   :help
                   "Cut (kill) text in region between mark and current position"
-                  :keys (lambda ()
-                          (if (and cua-mode mark-active)
-                              "\\[cua-cut-handler]"
-                            "\\[kill-region]"))))
+                  :keys ,(lambda ()
+                           (if (and cua-mode mark-active)
+                               "\\[cua-cut-handler]"
+                             "\\[kill-region]"))))
     ;; ns-win.el said: Separate undo from cut/paste section.
     (if (featurep 'ns)
         (bindings--define-key menu [separator-undo] menu-bar-separator))



reply via email to

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