(define-key help-map "\C-c" 'describe-copying)
(define-key help-map "\C-d" 'describe-distribution)
-(define-key help-map "\C-w" 'describe-no-warranty)
+(define-key help-map "\C-e" 'view-emacs-problems)
+(define-key help-map "\C-f" 'view-emacs-FAQ)
+(define-key help-map "\C-m" 'view-order-manuals)
+(define-key help-map "\C-n" 'view-emacs-news)
(define-key help-map "\C-p" 'describe-project)
+(define-key help-map "\C-w" 'describe-no-warranty)
+
+;; This does not fit the pattern, but it is natural given the C-\ command.
+(define-key help-map "\C-\\" 'describe-input-method)
+
+(define-key help-map "C" 'describe-coding-system)
+(define-key help-map "F" 'Info-goto-emacs-command-node)
+(define-key help-map "I" 'describe-input-method)
+(define-key help-map "K" 'Info-goto-emacs-key-command-node)
+(define-key help-map "L" 'describe-language-environment)
+(define-key help-map "S" 'info-lookup-symbol)
+
(define-key help-map "a" 'apropos-command)
(define-key help-map "b" 'describe-bindings)
(define-key help-map "c" 'describe-key-briefly)
-(define-key help-map "k" 'describe-key)
-(define-key help-map "d" 'describe-function)
+(define-key help-map "e" 'view-echo-area-messages)
+
(define-key help-map "f" 'describe-function)
-(define-key help-map "F" 'view-emacs-FAQ)
+(define-key help-map "h" 'view-hello-file)
(define-key help-map "i" 'info)
(define-key help-map "4i" 'info-other-window)
-(define-key help-map "\C-f" 'Info-goto-emacs-command-node)
-(define-key help-map "\C-k" 'Info-goto-emacs-key-command-node)
-(define-key help-map "\C-i" 'info-lookup-symbol)
+
+(define-key help-map "k" 'describe-key)
(define-key help-map "l" 'view-lossage)
(define-key help-map "m" 'describe-mode)
-(define-key help-map "\C-m" 'view-order-manuals)
-(define-key help-map "\C-n" 'view-emacs-news)
(define-key help-map "n" 'view-emacs-news)
(define-key help-map "p" 'finder-by-keyword)
(autoload 'finder-by-keyword "finder"
"Find packages matching a given keyword." t)
-(define-key help-map "P" 'view-emacs-problems)
-
(define-key help-map "s" 'describe-syntax)
(define-key help-map "t" 'help-with-tutorial)
(defalias 'help 'help-for-help)
(make-help-screen help-for-help
- "a b c C f F C-f i I k C-k l L m n p s t v w C-c C-d C-n C-p C-w; ? for help:"
+ "a b c C e f F C-f i I k C-k l L m p s t v w C-c C-d C-n C-p C-w or ? :"
"You have typed %THIS-KEY%, the help character. Type a Help option:
\(Use SPC or DEL to scroll through this text. Type \\<help-map>\\[help-quit] to exit the Help command.)
C describe-coding-system. This describes either a specific coding system
(if you type its name) or the coding systems currently in use
(if you type just RET).
+e view-echo-area-messages. Show the `*Messages*' buffer.
f describe-function. Type a function name and get documentation of it.
-C-f Info-goto-emacs-command-node. Type a function name;
+F Info-goto-emacs-command-node. Type a function name;
it takes you to the Info node for that command.
+h Display the HELLO file which illustrates various scripts.
i info. The info documentation reader.
I describe-input-method. Describe a specific input method (if you type
its name) or the current input method (if you type just RET).
-C-i info-lookup-symbol. Display the definition of a specific symbol
- as found in the manual for the language this buffer is written in.
k describe-key. Type a command key sequence;
it displays the full documentation.
-C-k Info-goto-emacs-key-command-node. Type a command key sequence;
+K Info-goto-emacs-key-command-node. Type a command key sequence;
it takes you to the Info node for the command bound to that key.
l view-lossage. Show last 100 characters you typed.
L describe-language-environment. This describes either a
or the current language environment (if you type just RET).
m describe-mode. Print documentation of current minor modes,
and the current major mode, including their special commands.
-n view-emacs-news. Display news of recent Emacs changes.
p finder-by-keyword. Find packages matching a given topic keyword.
s describe-syntax. Display contents of syntax table, plus explanations.
+S info-lookup-symbol. Display the definition of a specific symbol
+ as found in the manual for the language this buffer is written in.
t help-with-tutorial. Select the Emacs learn-by-doing tutorial.
v describe-variable. Type name of a variable;
it displays the variable's documentation and value.
w where-is. Type command name; it prints which keystrokes
invoke that command.
-F Display the frequently asked questions file.
-h Display the HELLO file which illustrates various scripts.
-C-c Display Emacs copying permission (General Public License).
+C-c Display Emacs copying permission (GNU General Public License).
C-d Display Emacs ordering information.
+C-e Display info about Emacs problems.
+C-f Display the Emacs FAQ.
+C-m Display how to order printed Emacs manuals.
C-n Display news of recent Emacs changes.
C-p Display information about the GNU project.
C-w Display information on absence of warranty for GNU Emacs."
(defun describe-distribution ()
"Display info on how to obtain the latest version of GNU Emacs."
(interactive)
- (find-file-read-only
- (expand-file-name "DISTRIB" data-directory)))
+ (view-file (expand-file-name "DISTRIB" data-directory)))
(defun describe-copying ()
"Display info on how you may redistribute copies of GNU Emacs."
(interactive)
- (find-file-read-only
- (expand-file-name "COPYING" data-directory))
+ (view-file (expand-file-name "COPYING" data-directory))
(goto-char (point-min)))
(defun describe-project ()
"Display info on the GNU project."
(interactive)
- (find-file-read-only
- (expand-file-name "THE-GNU-PROJECT" data-directory))
+ (view-file (expand-file-name "THE-GNU-PROJECT" data-directory))
(goto-char (point-min)))
(defun describe-no-warranty ()
nil "^ONEWS\\.[0-9]+$"
nil)))))))
(if file
- (find-file-read-only (expand-file-name file data-directory))
+ (view-file (expand-file-name file data-directory))
(error "No such old news"))))
+(defun view-echo-area-messages ()
+ "View the log of recent echo-area messages: the `*Messages*' buffer.
+The number of messages retained in that buffer
+is specified by the variable `message-log-max'."
+ (interactive)
+ (switch-to-buffer (get-buffer-create "*Messages*")))
+
(defun view-order-manuals ()
"Display the Emacs ORDERS file."
(interactive)
- (find-file-read-only (expand-file-name "ORDERS" data-directory))
+ (view-file (expand-file-name "ORDERS" data-directory))
(goto-address))
(defun view-emacs-FAQ ()
(list (if (equal val "")
fn (intern val))
current-prefix-arg)))
- (let* ((keys (where-is-internal definition overriding-local-map nil nil))
+ (let* ((binding (and (symbolp definition) (commandp definition)
+ (key-binding definition nil t)))
+ (remap (and (symbolp binding) (commandp binding) binding))
+ (keys (where-is-internal definition overriding-local-map nil nil remap))
(keys1 (mapconcat 'key-description keys ", "))
(standard-output (if insert (current-buffer) t)))
(if insert
(if (> (length keys1) 0)
- (princ (format "%s (%s)" keys1 definition))
+ (if remap
+ (princ (format "%s (%s) (remapped from %s)" keys1 remap definition))
+ (princ (format "%s (%s)" keys1 definition)))
(princ (format "M-x %s RET" definition)))
(if (> (length keys1) 0)
- (princ (format "%s is on %s" definition keys1))
+ (if remap
+ (princ (format "%s is remapped to %s which is on %s" definition remap keys1))
+ (princ (format "%s is on %s" definition keys1)))
(princ (format "%s is not on any key" definition)))))
nil)
(defun describe-key (key)
- "Display documentation of the function invoked by KEY. KEY is a string."
+ "Display documentation of the function invoked by KEY.
+KEY should be a key sequence--when calling from a program,
+pass a string or a vector."
(interactive "kDescribe key: ")
(save-excursion
(let ((modifiers (event-modifiers (aref key 0)))
\(listed in `minor-mode-alist') must also be a function whose documentation
describes the minor mode."
(interactive)
- (when buffer (set-buffer buffer))
- (help-setup-xref (list #'describe-mode (current-buffer)) (interactive-p))
+ (help-setup-xref (list #'describe-mode (or buffer (current-buffer)))
+ (interactive-p))
+ ;; For the sake of help-do-xref and help-xref-go-back,
+ ;; don't switch buffers before calling `help-buffer'.
(with-output-to-temp-buffer (help-buffer)
- (when minor-mode-alist
- (princ "The major mode is described first.
+ (save-excursion
+ (when buffer (set-buffer buffer))
+ (when minor-mode-alist
+ (princ "The major mode is described first.
For minor modes, see following pages.\n\n"))
- (princ mode-name)
- (princ " mode:\n")
- (princ (documentation major-mode))
- (let ((minor-modes minor-mode-alist))
- (while minor-modes
- (let* ((minor-mode (car (car minor-modes)))
- (indicator (car (cdr (car minor-modes)))))
- ;; Document a minor mode if it is listed in minor-mode-alist,
- ;; bound locally in this buffer, non-nil, and has a function
- ;; definition.
- (if (and (boundp minor-mode)
- (symbol-value minor-mode)
- (fboundp minor-mode))
- (let ((pretty-minor-mode minor-mode))
- (if (string-match "\\(-minor\\)?-mode\\'"
- (symbol-name minor-mode))
- (setq pretty-minor-mode
- (capitalize
- (substring (symbol-name minor-mode)
- 0 (match-beginning 0)))))
- (while (and indicator (symbolp indicator)
- (boundp indicator)
- (not (eq indicator (symbol-value indicator))))
- (setq indicator (symbol-value indicator)))
- (princ "\n\f\n")
- (princ (format "%s minor mode (%s):\n"
- pretty-minor-mode
- (if indicator
- (format "indicator%s" indicator)
- "no indicator")))
- (princ (documentation minor-mode)))))
- (setq minor-modes (cdr minor-modes))))
- (print-help-return-message)))
+ (princ mode-name)
+ (princ " mode:\n")
+ (princ (documentation major-mode))
+ (let ((minor-modes minor-mode-alist))
+ (while minor-modes
+ (let* ((minor-mode (car (car minor-modes)))
+ (indicator (car (cdr (car minor-modes)))))
+ ;; Document a minor mode if it is listed in minor-mode-alist,
+ ;; bound locally in this buffer, non-nil, and has a function
+ ;; definition.
+ (if (and (boundp minor-mode)
+ (symbol-value minor-mode)
+ (fboundp minor-mode))
+ (let ((pretty-minor-mode minor-mode))
+ (if (string-match "\\(-minor\\)?-mode\\'"
+ (symbol-name minor-mode))
+ (setq pretty-minor-mode
+ (capitalize
+ (substring (symbol-name minor-mode)
+ 0 (match-beginning 0)))))
+ (while (and indicator (symbolp indicator)
+ (boundp indicator)
+ (not (eq indicator (symbol-value indicator))))
+ (setq indicator (symbol-value indicator)))
+ (princ "\n\f\n")
+ (princ (format "%s minor mode (%s):\n"
+ pretty-minor-mode
+ (if indicator
+ (format "indicator%s" indicator)
+ "no indicator")))
+ (princ (documentation minor-mode)))))
+ (setq minor-modes (cdr minor-modes))))
+ (print-help-return-message))))
\f
;;; Automatic resizing of temporary buffers.