]> git.eshelyaron.com Git - emacs.git/commitdiff
Convert change-log-mode menu to easy-menu-define
authorStefan Kangas <stefan@marxist.se>
Sat, 27 Feb 2021 02:14:04 +0000 (03:14 +0100)
committerStefan Kangas <stefan@marxist.se>
Sat, 27 Feb 2021 02:14:04 +0000 (03:14 +0100)
* lisp/vc/add-log.el (change-log-mode-map): Move menu from here...
(change-log-mode-menu): ...to here; convert to easy-menu-define.

lisp/vc/add-log.el

index fafd7f9c467eb370b2c6e0863ffe7d91d9a6b203..6b38806651594f6c90bb2cc5d335197532b2c97a 100644 (file)
@@ -569,29 +569,27 @@ Compatibility function for \\[next-error] invocations."
        (select-window change-log-find-window)))))
 
 (defvar change-log-mode-map
-  (let ((map (make-sparse-keymap))
-       (menu-map (make-sparse-keymap)))
+  (let ((map (make-sparse-keymap)))
     (define-key map [?\C-c ?\C-p] #'add-log-edit-prev-comment)
     (define-key map [?\C-c ?\C-n] #'add-log-edit-next-comment)
     (define-key map [?\C-c ?\C-f] #'change-log-find-file)
     (define-key map [?\C-c ?\C-c] #'change-log-goto-source)
-    (define-key map [menu-bar changelog] (cons "ChangeLog" menu-map))
-    (define-key menu-map [gs]
-      '(menu-item "Go To Source" change-log-goto-source
-                 :help "Go to source location of ChangeLog tag near point"))
-    (define-key menu-map [ff]
-      '(menu-item "Find File" change-log-find-file
-                 :help "Visit the file for the change under point"))
-    (define-key menu-map [sep] '("--"))
-    (define-key menu-map [nx]
-      '(menu-item "Next Log-Edit Comment" add-log-edit-next-comment
-                 :help "Cycle forward through Log-Edit mode comment history"))
-    (define-key menu-map [pr]
-      '(menu-item "Previous Log-Edit Comment" add-log-edit-prev-comment
-                 :help "Cycle backward through Log-Edit mode comment history"))
     map)
   "Keymap for Change Log major mode.")
 
+(easy-menu-define change-log-mode-menu change-log-mode-map
+  "Menu for Change Log major mode."
+  '("ChangeLog"
+    ["Previous Log-Edit Comment" add-log-edit-prev-comment
+     :help "Cycle backward through Log-Edit mode comment history"]
+    ["Next Log-Edit Comment" add-log-edit-next-comment
+     :help "Cycle forward through Log-Edit mode comment history"]
+    "---"
+    ["Find File" change-log-find-file
+     :help "Visit the file for the change under point"]
+    ["Go To Source" change-log-goto-source
+     :help "Go to source location of ChangeLog tag near point"]))
+
 ;; It used to be called change-log-time-zone-rule but really should be
 ;; called add-log-time-zone-rule since it's only used from add-log-* code.
 (defvaralias 'change-log-time-zone-rule 'add-log-time-zone-rule)