From 7ada28ac7e1bbe8a8d0f6c66a80cf3696be41aad Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sun, 30 Nov 2003 17:50:54 +0000 Subject: [PATCH] (help-map): Bind `display-local-help' to `C-h .'. (help-for-help): Add `C-h .' to the listed Help options. Remove trailing whitespace. --- lisp/help.el | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lisp/help.el b/lisp/help.el index 770bcabb964..82a43c6868b 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -49,6 +49,7 @@ (define-key help-map (char-to-string help-char) 'help-for-help) (define-key help-map [help] 'help-for-help) (define-key help-map [f1] 'help-for-help) +(define-key help-map "." 'display-local-help) (define-key help-map "?" 'help-for-help) (define-key help-map "\C-c" 'describe-copying) @@ -177,7 +178,7 @@ If FUNCTION is nil, it applies `message', thus displaying the message." (defalias 'help 'help-for-help) (make-help-screen help-for-help - "a b c C e f F i I k C-k l L m p s t v w C-c C-d C-f C-n C-p C-t C-w or ? :" + "a b c C e f F i I k C-k l L m p s t v w C-c C-d C-f C-n C-p C-t 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-quit] to exit the Help command.) @@ -217,6 +218,8 @@ 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. +. display-local-help. Display any available local help at point + in the echo area. C-c Display Emacs copying permission (GNU General Public License). C-d Display Emacs ordering information. @@ -637,7 +640,7 @@ follows the description of the major mode.)\n\n")) "Display documentation of a minor mode given as MINOR-MODE. MINOR-MODE can be a minor mode symbol or a minor mode indicator string appeared on the mode-line." - (interactive (list (completing-read + (interactive (list (completing-read "Minor mode: " (nconc (describe-minor-mode-completion-table-for-symbol) @@ -655,14 +658,14 @@ appeared on the mode-line." (t (error "No such minor mode: %s" minor-mode))))) -;; symbol +;; symbol (defun describe-minor-mode-completion-table-for-symbol () ;; In order to list up all minor modes, minor-mode-list ;; is used here instead of minor-mode-alist. (delq nil (mapcar 'symbol-name minor-mode-list))) (defun describe-minor-mode-from-symbol (symbol) "Display documentation of a minor mode given as a symbol, SYMBOL" - (interactive (list (intern (completing-read + (interactive (list (intern (completing-read "Minor mode symbol: " (describe-minor-mode-completion-table-for-symbol))))) (if (fboundp symbol) @@ -671,7 +674,7 @@ appeared on the mode-line." ;; indicator (defun describe-minor-mode-completion-table-for-indicator () - (delq nil + (delq nil (mapcar (lambda (x) (let ((i (format-mode-line x))) ;; remove first space if existed @@ -680,15 +683,15 @@ appeared on the mode-line." nil) ((eq (aref i 0) ?\ ) (substring i 1)) - (t + (t i)))) minor-mode-alist))) (defun describe-minor-mode-from-indicator (indicator) "Display documentation of a minor mode specified by INDICATOR. If you call this function interactively, you can give indicator which is currently activated with completion." - (interactive (list - (completing-read + (interactive (list + (completing-read "Minor mode indicator: " (describe-minor-mode-completion-table-for-indicator)))) (let ((minor-mode (lookup-minor-mode-from-indicator indicator))) @@ -699,17 +702,17 @@ is currently activated with completion." (defun lookup-minor-mode-from-indicator (indicator) "Return a minor mode symbol from its indicator on the modeline." ;; remove first space if existed - (if (and (< 0 (length indicator)) + (if (and (< 0 (length indicator)) (eq (aref indicator 0) ?\ )) (setq indicator (substring indicator 1))) (let ((minor-modes minor-mode-alist) result) (while minor-modes (let* ((minor-mode (car (car minor-modes))) - (anindicator (format-mode-line + (anindicator (format-mode-line (car (cdr (car minor-modes)))))) ;; remove first space if existed - (if (and (stringp anindicator) + (if (and (stringp anindicator) (> (length anindicator) 0) (eq (aref anindicator 0) ?\ )) (setq anindicator (substring anindicator 1))) -- 2.39.2