/[emacs]/emacs/lisp/help.el
ViewVC logotype

Diff of /emacs/lisp/help.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.261 by rms, Tue Sep 30 12:50:44 2003 UTC revision 1.262 by teirllm, Sun Nov 30 17:50:54 2003 UTC
# Line 49  Line 49 
49  (define-key help-map (char-to-string help-char) 'help-for-help)  (define-key help-map (char-to-string help-char) 'help-for-help)
50  (define-key help-map [help] 'help-for-help)  (define-key help-map [help] 'help-for-help)
51  (define-key help-map [f1] 'help-for-help)  (define-key help-map [f1] 'help-for-help)
52    (define-key help-map "." 'display-local-help)
53  (define-key help-map "?" 'help-for-help)  (define-key help-map "?" 'help-for-help)
54    
55  (define-key help-map "\C-c" 'describe-copying)  (define-key help-map "\C-c" 'describe-copying)
# Line 177  If FUNCTION is nil, it applies `message' Line 178  If FUNCTION is nil, it applies `message'
178    
179  (defalias 'help 'help-for-help)  (defalias 'help 'help-for-help)
180  (make-help-screen help-for-help  (make-help-screen help-for-help
181    "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 ? :"
182    "You have typed %THIS-KEY%, the help character.  Type a Help option:    "You have typed %THIS-KEY%, the help character.  Type a Help option:
183  \(Use SPC or DEL to scroll through this text.  Type \\<help-map>\\[help-quit] to exit the Help command.)  \(Use SPC or DEL to scroll through this text.  Type \\<help-map>\\[help-quit] to exit the Help command.)
184    
# Line 217  v  describe-variable.  Type name of a va Line 218  v  describe-variable.  Type name of a va
218          it displays the variable's documentation and value.          it displays the variable's documentation and value.
219  w  where-is.  Type command name; it prints which keystrokes  w  where-is.  Type command name; it prints which keystrokes
220          invoke that command.          invoke that command.
221    .  display-local-help.  Display any available local help at point
222            in the echo area.
223    
224  C-c Display Emacs copying permission (GNU General Public License).  C-c Display Emacs copying permission (GNU General Public License).
225  C-d Display Emacs ordering information.  C-d Display Emacs ordering information.
# Line 637  follows the description of the major mod Line 640  follows the description of the major mod
640    "Display documentation of a minor mode given as MINOR-MODE.    "Display documentation of a minor mode given as MINOR-MODE.
641  MINOR-MODE can be a minor mode symbol or a minor mode indicator string  MINOR-MODE can be a minor mode symbol or a minor mode indicator string
642  appeared on the mode-line."  appeared on the mode-line."
643    (interactive (list (completing-read    (interactive (list (completing-read
644                        "Minor mode: "                        "Minor mode: "
645                                (nconc                                (nconc
646                                 (describe-minor-mode-completion-table-for-symbol)                                 (describe-minor-mode-completion-table-for-symbol)
# Line 655  appeared on the mode-line." Line 658  appeared on the mode-line."
658       (t       (t
659        (error "No such minor mode: %s" minor-mode)))))        (error "No such minor mode: %s" minor-mode)))))
660    
661  ;; symbol      ;; symbol
662  (defun describe-minor-mode-completion-table-for-symbol ()  (defun describe-minor-mode-completion-table-for-symbol ()
663    ;; In order to list up all minor modes, minor-mode-list    ;; In order to list up all minor modes, minor-mode-list
664    ;; is used here instead of minor-mode-alist.    ;; is used here instead of minor-mode-alist.
665    (delq nil (mapcar 'symbol-name minor-mode-list)))    (delq nil (mapcar 'symbol-name minor-mode-list)))
666  (defun describe-minor-mode-from-symbol (symbol)  (defun describe-minor-mode-from-symbol (symbol)
667    "Display documentation of a minor mode given as a symbol, SYMBOL"    "Display documentation of a minor mode given as a symbol, SYMBOL"
668    (interactive (list (intern (completing-read    (interactive (list (intern (completing-read
669                                "Minor mode symbol: "                                "Minor mode symbol: "
670                                (describe-minor-mode-completion-table-for-symbol)))))                                (describe-minor-mode-completion-table-for-symbol)))))
671    (if (fboundp symbol)    (if (fboundp symbol)
# Line 671  appeared on the mode-line." Line 674  appeared on the mode-line."
674    
675  ;; indicator  ;; indicator
676  (defun describe-minor-mode-completion-table-for-indicator ()  (defun describe-minor-mode-completion-table-for-indicator ()
677    (delq nil    (delq nil
678          (mapcar (lambda (x)          (mapcar (lambda (x)
679                    (let ((i (format-mode-line x)))                    (let ((i (format-mode-line x)))
680                      ;; remove first space if existed                      ;; remove first space if existed
# Line 680  appeared on the mode-line." Line 683  appeared on the mode-line."
683                        nil)                        nil)
684                       ((eq (aref i 0) ?\ )                       ((eq (aref i 0) ?\ )
685                        (substring i 1))                        (substring i 1))
686                       (t                       (t
687                        i))))                        i))))
688                  minor-mode-alist)))                  minor-mode-alist)))
689  (defun describe-minor-mode-from-indicator (indicator)  (defun describe-minor-mode-from-indicator (indicator)
690    "Display documentation of a minor mode specified by INDICATOR.    "Display documentation of a minor mode specified by INDICATOR.
691  If you call this function interactively, you can give indicator which  If you call this function interactively, you can give indicator which
692  is currently activated with completion."  is currently activated with completion."
693    (interactive (list    (interactive (list
694                  (completing-read                  (completing-read
695                   "Minor mode indicator: "                   "Minor mode indicator: "
696                   (describe-minor-mode-completion-table-for-indicator))))                   (describe-minor-mode-completion-table-for-indicator))))
697    (let ((minor-mode (lookup-minor-mode-from-indicator indicator)))    (let ((minor-mode (lookup-minor-mode-from-indicator indicator)))
# Line 699  is currently activated with completion." Line 702  is currently activated with completion."
702  (defun lookup-minor-mode-from-indicator (indicator)  (defun lookup-minor-mode-from-indicator (indicator)
703    "Return a minor mode symbol from its indicator on the modeline."    "Return a minor mode symbol from its indicator on the modeline."
704    ;; remove first space if existed    ;; remove first space if existed
705    (if (and (< 0 (length indicator))    (if (and (< 0 (length indicator))
706             (eq (aref indicator 0) ?\ ))             (eq (aref indicator 0) ?\ ))
707        (setq indicator (substring indicator 1)))        (setq indicator (substring indicator 1)))
708    (let ((minor-modes minor-mode-alist)    (let ((minor-modes minor-mode-alist)
709          result)          result)
710      (while minor-modes      (while minor-modes
711        (let* ((minor-mode (car (car minor-modes)))        (let* ((minor-mode (car (car minor-modes)))
712               (anindicator (format-mode-line               (anindicator (format-mode-line
713                             (car (cdr (car minor-modes))))))                             (car (cdr (car minor-modes))))))
714          ;; remove first space if existed          ;; remove first space if existed
715          (if (and (stringp anindicator)          (if (and (stringp anindicator)
716                   (> (length anindicator) 0)                   (> (length anindicator) 0)
717                   (eq (aref anindicator 0) ?\ ))                   (eq (aref anindicator 0) ?\ ))
718              (setq anindicator (substring anindicator 1)))              (setq anindicator (substring anindicator 1)))

Legend:
Removed from v.1.261  
changed lines
  Added in v.1.262

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26