diff options
author | Mark Oteiza <mvoteiza@udel.edu> | 2016-10-13 14:29:32 -0400 |
---|---|---|
committer | Mark Oteiza <mvoteiza@udel.edu> | 2016-10-13 14:37:10 -0400 |
commit | 506a97a58d0cff595f13e6238b59c9e8c70440d5 (patch) | |
tree | 270d58681af0a823783ddc09d37328ffc166d595 /lisp/man.el | |
parent | 8ee95221c7112a763ae6ce41c7c58b3c32ece5fc (diff) | |
download | emacs-506a97a58d0cff595f13e6238b59c9e8c70440d5.tar.gz |
Derive Man and WoMan modes from special-mode
* lisp/man.el (Man-mode-map): Set parent to map composed from both
button-buffer-map and special-mode-map. Remove redundant bindings.
Fix menu to refer to the quit-window command.
(Man-mode): Derive from special-mode. Fix docstring. Remove redundant
buffer-read-only binding.
(Man-quit): Remove.
* lisp/woman.el (woman-really-find-file): Use setq-local.
(woman-mode-map): Refer to woman-mode in docstring.
(woman-mode): Derive from special-mode. Document woman-mode-map in
docstring. Use setq-local where possible; imenu-generic-expression is
already buffer-local.
(woman-negative-vertical-space): Replace unused binding with _.
Diffstat (limited to 'lisp/man.el')
-rw-r--r-- | lisp/man.el | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/lisp/man.el b/lisp/man.el index 0f3c4ba98e8..82691f5e9b7 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -432,29 +432,23 @@ Otherwise, the value is whatever the function (defvar Man-mode-map (let ((map (make-sparse-keymap))) (suppress-keymap map) - (set-keymap-parent map button-buffer-map) + (set-keymap-parent map + (make-composed-keymap button-buffer-map special-mode-map)) - (define-key map [?\S-\ ] 'scroll-down-command) - (define-key map " " 'scroll-up-command) - (define-key map "\177" 'scroll-down-command) (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 ">" 'end-of-buffer) - (define-key map "<" 'beginning-of-buffer) (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 "q" 'Man-quit) (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) - (define-key map "?" 'describe-mode) (easy-menu-define nil map "`Man-mode' menu." @@ -476,7 +470,7 @@ Otherwise, the value is whatever the function "--" ["Man..." man t] ["Kill Buffer" Man-kill t] - ["Quit" Man-quit t])) + ["Quit" quit-window t])) map) "Keymap for Man mode.") @@ -1474,9 +1468,7 @@ manpage command." (defvar bookmark-make-record-function) -(put 'Man-mode 'mode-class 'special) - -(define-derived-mode Man-mode fundamental-mode "Man" +(define-derived-mode Man-mode special-mode "Man" "A mode for browsing Un*x manual pages. The following man commands are available in the buffer. Try @@ -1490,7 +1482,7 @@ The following man commands are available in the buffer. Try \\[Man-previous-section] Jump to previous manpage section. \\[Man-goto-section] Go to a manpage section. \\[Man-goto-see-also-section] Jumps to the SEE ALSO manpage section. -\\[Man-quit] Deletes the manpage window, bury its buffer. +\\[quit-window] Deletes the manpage window, bury its buffer. \\[Man-kill] Deletes the manpage window, kill its buffer. \\[describe-mode] Prints this help text. @@ -1517,8 +1509,7 @@ The following key bindings are currently in effect in the buffer: mode-line-buffer-identification (list (default-value 'mode-line-buffer-identification) " {" 'Man-page-mode-string "}") - truncate-lines t - buffer-read-only t) + truncate-lines t) (buffer-disable-undo) (auto-fill-mode -1) (setq imenu-generic-expression (list (list nil Man-heading-regexp 0))) @@ -1794,11 +1785,6 @@ Specify which REFERENCE to use; default is based on word at point." (interactive) (quit-window t)) -(defun Man-quit () - "Bury the buffer containing the manpage." - (interactive) - (quit-window)) - (defun Man-goto-page (page &optional noerror) "Go to the manual page on page PAGE." (interactive |