emacs-diffs
[Top][All Lists]
Advanced

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

master c8f19a4: Convert hi-lock-menu to easymenu


From: Stefan Kangas
Subject: master c8f19a4: Convert hi-lock-menu to easymenu
Date: Sun, 28 Feb 2021 16:22:14 -0500 (EST)

branch: master
commit c8f19a4af6d90a2d7e580a4621dabc8deffeacd0
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Convert hi-lock-menu to easymenu
    
    * lisp/hi-lock.el (hi-lock-menu): Convert to easymenu.
---
 lisp/hi-lock.el | 52 +++++++++++++++++++---------------------------------
 1 file changed, 19 insertions(+), 33 deletions(-)

diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 0ad499b..68f8cc5 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -254,39 +254,25 @@ that older functionality.  This variable avoids multiple 
reminders.")
 Assumption is made if `hi-lock-mode' used in the *scratch* buffer while
 a library is being loaded.")
 
-(defvar hi-lock-menu
-  (let ((map (make-sparse-keymap "Hi Lock")))
-    (define-key-after map [highlight-regexp]
-      '(menu-item "Highlight Regexp..." highlight-regexp
-        :help "Highlight text matching PATTERN (a regexp)."))
-
-    (define-key-after map [highlight-phrase]
-      '(menu-item "Highlight Phrase..." highlight-phrase
-        :help "Highlight text matching PATTERN (a regexp processed to match 
phrases)."))
-
-    (define-key-after map [highlight-lines-matching-regexp]
-      '(menu-item "Highlight Lines..." highlight-lines-matching-regexp
-        :help "Highlight lines containing match of PATTERN (a regexp)."))
-
-    (define-key-after map [highlight-symbol-at-point]
-      '(menu-item "Highlight Symbol at Point" highlight-symbol-at-point
-        :help "Highlight symbol found near point without prompting."))
-
-    (define-key-after map [unhighlight-regexp]
-      '(menu-item "Remove Highlighting..." unhighlight-regexp
-        :help "Remove previously entered highlighting pattern."
-        :enable hi-lock-interactive-patterns))
-
-    (define-key-after map [hi-lock-write-interactive-patterns]
-      '(menu-item "Patterns to Buffer" hi-lock-write-interactive-patterns
-        :help "Insert interactively added REGEXPs into buffer at point."
-        :enable hi-lock-interactive-patterns))
-
-    (define-key-after map [hi-lock-find-patterns]
-      '(menu-item "Patterns from Buffer" hi-lock-find-patterns
-        :help "Use patterns (if any) near top of buffer."))
-    map)
-  "Menu for hi-lock mode.")
+(easy-menu-define hi-lock-menu nil
+  "Menu for hi-lock mode."
+  '("Hi Lock"
+    ["Highlight Regexp..." highlight-regexp
+     :help "Highlight text matching PATTERN (a regexp)."]
+    ["Highlight Phrase..." highlight-phrase
+     :help "Highlight text matching PATTERN (a regexp processed to match 
phrases)."]
+    ["Highlight Lines..." highlight-lines-matching-regexp
+     :help "Highlight lines containing match of PATTERN (a regexp)."]
+    ["Highlight Symbol at Point" highlight-symbol-at-point
+     :help "Highlight symbol found near point without prompting."]
+    ["Remove Highlighting..." unhighlight-regexp
+     :help "Remove previously entered highlighting pattern."
+     :enable hi-lock-interactive-patterns]
+    ["Patterns to Buffer" hi-lock-write-interactive-patterns
+     :help "Insert interactively added REGEXPs into buffer at point."
+     :enable hi-lock-interactive-patterns]
+    ["Patterns from Buffer" hi-lock-find-patterns
+     :help "Use patterns (if any) near top of buffer."]))
 
 (defvar hi-lock-map
   (let ((map (make-sparse-keymap "Hi Lock")))



reply via email to

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