* lisp/man.el (Man-mode-map): Prefer defvar-keymap.

This commit is contained in:
Stefan Kangas 2022-11-02 15:06:43 +01:00
parent a762cb4f8c
commit 1f1dac9b3b

View file

@ -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))
(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
(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.")
: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