# HG changeset patch # User Stefan Monnier # Date 1110978495 0 # Node ID 9b106d739bf9c3c58a8a3a8394a4448736fbbda6 # Parent 8430d50e2bc3bfff7367a1c6db1d22586ed16f2a (describe-mode): Allow minor mode toggles to use a different symbol than the minor mode variable. diff -r 8430d50e2bc3 -r 9b106d739bf9 lisp/help.el --- a/lisp/help.el Wed Mar 16 11:34:41 2005 +0000 +++ b/lisp/help.el Wed Mar 16 13:08:15 2005 +0000 @@ -703,32 +703,29 @@ (dolist (mode minor-mode-list) ;; Document a minor mode if it is listed in minor-mode-alist, ;; non-nil, and has a function definition. - (and (boundp mode) (symbol-value mode) - (fboundp mode) - (let ((pretty-minor-mode mode)) - (if (string-match "\\(-minor\\)?-mode\\'" - (symbol-name mode)) - (setq pretty-minor-mode - (capitalize - (substring (symbol-name mode) - 0 (match-beginning 0))))) - (push (list pretty-minor-mode mode - (format-mode-line (assq mode minor-mode-alist))) - minor-modes)))) - (if auto-fill-function - ;; copy pure string so we can add face property to it below. - (push (list (copy-sequence "Auto Fill") 'auto-fill-mode " Fill") - minor-modes)) + (let ((fmode (or (get mode :minor-mode-function) mode))) + (and (boundp mode) (symbol-value mode) + (fboundp fmode) + (let ((pretty-minor-mode + (if (string-match "\\(\\(-minor\\)?-mode\\)?\\'" + (symbol-name fmode)) + (capitalize + (substring (symbol-name fmode) + 0 (match-beginning 0))) + fmode))) + (push (list fmode pretty-minor-mode + (format-mode-line (assq mode minor-mode-alist))) + minor-modes))))) (setq minor-modes (sort minor-modes - (lambda (a b) (string-lessp (car a) (car b))))) + (lambda (a b) (string-lessp (cadr a) (cadr b))))) (when minor-modes (princ "Summary of minor modes:\n") (make-local-variable 'help-button-cache) (with-current-buffer standard-output (dolist (mode minor-modes) - (let ((pretty-minor-mode (nth 0 mode)) - (mode-function (nth 1 mode)) + (let ((mode-function (nth 0 mode)) + (pretty-minor-mode (nth 1 mode)) (indicator (nth 2 mode))) (setq indicator (if (zerop (length indicator)) "no indicator"