From: Stefan Kangas Date: Wed, 2 Nov 2022 14:06:43 +0000 (+0100) Subject: * lisp/man.el (Man-mode-map): Prefer defvar-keymap. X-Git-Tag: emacs-29.0.90~1616^2~346 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1f1dac9b3b35c38676358d440be88bea477c1bb3;p=emacs.git * lisp/man.el (Man-mode-map): Prefer defvar-keymap. --- diff --git a/lisp/man.el b/lisp/man.el index 7ba7bee4176..6c50f017e39 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -451,50 +451,45 @@ Otherwise, the value is whatever the function table) "Syntax table used in Man mode buffers.") -(defvar Man-mode-map - (let ((map (make-sparse-keymap))) - (suppress-keymap map) - (set-keymap-parent map - (make-composed-keymap button-buffer-map special-mode-map)) - - (define-key map "n" 'Man-next-section) - (define-key map "p" 'Man-previous-section) - (define-key map "\en" 'Man-next-manpage) - (define-key map "\ep" 'Man-previous-manpage) - (define-key map "." 'beginning-of-buffer) - (define-key map "r" 'Man-follow-manual-reference) - (define-key map "g" 'Man-goto-section) - (define-key map "s" 'Man-goto-see-also-section) - (define-key map "k" 'Man-kill) - (define-key map "u" 'Man-update-manpage) - (define-key map "m" 'man) - ;; Not all the man references get buttons currently. The text in the - ;; manual page can contain references to other man pages - (define-key map "\r" 'man-follow) - - (easy-menu-define nil map - "`Man-mode' menu." - '("Man" - ["Next Section" Man-next-section t] - ["Previous Section" Man-previous-section t] - ["Go To Section..." Man-goto-section t] - ["Go To \"SEE ALSO\" Section" Man-goto-see-also-section - :active (cl-member Man-see-also-regexp Man--sections - :test #'string-match-p)] - ["Follow Reference..." Man-follow-manual-reference - :active Man--refpages - :help "Go to a manpage referred to in the \"SEE ALSO\" section"] - "--" - ["Next Manpage" Man-next-manpage - :active (> (length Man-page-list) 1)] - ["Previous Manpage" Man-previous-manpage - :active (> (length Man-page-list) 1)] - "--" - ["Man..." man t] - ["Kill Buffer" Man-kill t] - ["Quit" quit-window t])) - map) - "Keymap for Man mode.") +(defvar-keymap Man-mode-map + :doc "Keymap for Man mode." + :suppress t + :parent (make-composed-keymap button-buffer-map special-mode-map) + "n" #'Man-next-section + "p" #'Man-previous-section + "M-n" #'Man-next-manpage + "M-p" #'Man-previous-manpage + "." #'beginning-of-buffer + "r" #'Man-follow-manual-reference + "g" #'Man-goto-section + "s" #'Man-goto-see-also-section + "k" #'Man-kill + "u" #'Man-update-manpage + "m" #'man + ;; Not all the man references get buttons currently. The text in the + ;; manual page can contain references to other man pages + "RET" #'man-follow + + :menu + '("Man" + ["Next Section" Man-next-section t] + ["Previous Section" Man-previous-section t] + ["Go To Section..." Man-goto-section t] + ["Go To \"SEE ALSO\" Section" Man-goto-see-also-section + :active (cl-member Man-see-also-regexp Man--sections + :test #'string-match-p)] + ["Follow Reference..." Man-follow-manual-reference + :active Man--refpages + :help "Go to a manpage referred to in the \"SEE ALSO\" section"] + "--" + ["Next Manpage" Man-next-manpage + :active (> (length Man-page-list) 1)] + ["Previous Manpage" Man-previous-manpage + :active (> (length Man-page-list) 1)] + "--" + ["Man..." man t] + ["Kill Buffer" Man-kill t] + ["Quit" quit-window t])) ;; buttons (define-button-type 'Man-abstract-xref-man-page