diff options
author | Stefan Kangas <stefankangas@gmail.com> | 2022-10-29 03:57:55 +0200 |
---|---|---|
committer | Stefan Kangas <stefankangas@gmail.com> | 2022-10-29 04:02:20 +0200 |
commit | 3b0296c8b03436c7848009ca0238b1126dc3bac7 (patch) | |
tree | b34be36ee04e2f02eddf37aebf8f9c8e731f88d7 /lisp/textmodes/page-ext.el | |
parent | aa23bf987a320f36478b09ae82a12a419bc00753 (diff) | |
download | emacs-3b0296c8b03436c7848009ca0238b1126dc3bac7.tar.gz |
Prefer defvar-keymap in page-ext.el
* lisp/textmodes/page-ext.el (pages--ctl-x-ctl-p-map)
(pages-directory-mode-map): Prefer defvar-keymap.
Diffstat (limited to 'lisp/textmodes/page-ext.el')
-rw-r--r-- | lisp/textmodes/page-ext.el | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/lisp/textmodes/page-ext.el b/lisp/textmodes/page-ext.el index 05c02308e52..b133b1e9e38 100644 --- a/lisp/textmodes/page-ext.el +++ b/lisp/textmodes/page-ext.el @@ -276,19 +276,17 @@ Used by `pages-directory-for-addresses' function." ;;; Key bindings for page handling functions -(defvar pages--ctl-x-ctl-p-map - (let ((map (make-sparse-keymap))) - (define-key map "\C-n" #'pages-next-page) - (define-key map "\C-p" #'pages-previous-page) - (define-key map "\C-a" #'pages-add-new-page) - (define-key map "\C-m" #'mark-page) - (define-key map "\C-s" #'pages-search) - (define-key map "s" #'pages-sort-buffer) - (define-key map "\C-l" #'pages-set-delimiter) - (define-key map "\C-d" #'pages-directory) - (define-key map "d" #'pages-directory-for-addresses) - map) - "Keymap for subcommands of C-x C-p, which are for page handling.") +(defvar-keymap pages--ctl-x-ctl-p-map + :doc "Keymap for subcommands of \\`C-x C-p', which are for page handling." + "C-n" #'pages-next-page + "C-p" #'pages-previous-page + "C-a" #'pages-add-new-page + "C-m" #'mark-page + "C-s" #'pages-search + "s" #'pages-sort-buffer + "C-l" #'pages-set-delimiter + "C-d" #'pages-directory + "d" #'pages-directory-for-addresses) ;; FIXME: Merely loading a package shouldn't have this kind of side-effects! (global-unset-key "\C-x\C-p") @@ -476,14 +474,12 @@ contain matches to the regexp.)") (define-obsolete-variable-alias 'pages-directory-map 'pages-directory-mode-map "26.1") -(defvar pages-directory-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "\C-c\C-c" #'pages-directory-goto) - (define-key map "\C-m" #'pages-directory-goto) - (define-key map "\C-c\C-p\C-a" #'pages-add-new-page) - (define-key map [mouse-2] #'pages-directory-goto) - map) - "Keymap for the pages-directory-buffer.") +(defvar-keymap pages-directory-mode-map + :doc "Keymap for the pages-directory-buffer." + "C-c C-c" #'pages-directory-goto + "RET" #'pages-directory-goto + "C-c C-p C-a" #'pages-add-new-page + "<mouse-2>" #'pages-directory-goto) (defvar pages-original-delimiter "^\f" "Default page delimiter.") |