summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2022-06-20 13:23:24 +0200
committerStefan Kangas <stefan@marxist.se>2022-06-20 13:23:24 +0200
commite2ec4b844337794a4b95475481fecdd7a5ad28e9 (patch)
treeeff47e86f213f764040756f4ca7b852e2db435b4
parent45dc99dcb91f0de5b9ea30141e1dd5a53368e38b (diff)
downloademacs-e2ec4b844337794a4b95475481fecdd7a5ad28e9.tar.gz
Prefer defvar-keymap in hi-lock.el
* lisp/hi-lock.el: Prefer keymap-set in documentation. (hi-lock-map): Prefer defvar-keymap.
-rw-r--r--lisp/hi-lock.el33
1 files changed, 16 insertions, 17 deletions
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 0934eef8ed7..8cddd644824 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -69,12 +69,12 @@
;; You might also want to bind the hi-lock commands to more
;; finger-friendly sequences:
-;; (define-key hi-lock-map "\C-z\C-h" 'highlight-lines-matching-regexp)
-;; (define-key hi-lock-map "\C-zi" 'hi-lock-find-patterns)
-;; (define-key hi-lock-map "\C-zh" 'highlight-regexp)
-;; (define-key hi-lock-map "\C-zp" 'highlight-phrase)
-;; (define-key hi-lock-map "\C-zr" 'unhighlight-regexp)
-;; (define-key hi-lock-map "\C-zb" 'hi-lock-write-interactive-patterns))
+;; (keymap-set hi-lock-map "C-z C-h" 'highlight-lines-matching-regexp)
+;; (keymap-set hi-lock-map "C-z i" 'hi-lock-find-patterns)
+;; (keymap-set hi-lock-map "C-z h" 'highlight-regexp)
+;; (keymap-set hi-lock-map "C-z p" 'highlight-phrase)
+;; (keymap-set hi-lock-map "C-z r" 'unhighlight-regexp)
+;; (keymap-set hi-lock-map "C-z b" 'hi-lock-write-interactive-patterns))
;; See the documentation for hi-lock-mode `C-h f hi-lock-mode' for
;; additional instructions.
@@ -276,17 +276,16 @@ a library is being loaded.")
["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")))
- (define-key map "\C-xwi" 'hi-lock-find-patterns)
- (define-key map "\C-xwl" 'highlight-lines-matching-regexp)
- (define-key map "\C-xwp" 'highlight-phrase)
- (define-key map "\C-xwh" 'highlight-regexp)
- (define-key map "\C-xw." 'highlight-symbol-at-point)
- (define-key map "\C-xwr" 'unhighlight-regexp)
- (define-key map "\C-xwb" 'hi-lock-write-interactive-patterns)
- map)
- "Key map for hi-lock.")
+(defvar-keymap hi-lock-map
+ :doc "Keymap for `hi-lock-mode'."
+ :name "Hi Lock"
+ "C-x w i" #'hi-lock-find-patterns
+ "C-x w l" #'highlight-lines-matching-regexp
+ "C-x w p" #'highlight-phrase
+ "C-x w h" #'highlight-regexp
+ "C-x w ." #'highlight-symbol-at-point
+ "C-x w r" #'unhighlight-regexp
+ "C-x w b" #'hi-lock-write-interactive-patterns)
;; Visible Functions