diff options
| author | Richard M. Stallman | 1994-04-15 23:50:31 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-15 23:50:31 +0000 |
| commit | 7192540ba357f9c9dca74aaa7a2cf361a1ea7631 (patch) | |
| tree | 95e26f6ea2d4d078b98e809ba6efca04b3e8a771 | |
| parent | ad023904b209fbeb23109c0dc72fe49e6a1d6f24 (diff) | |
| download | emacs-7192540ba357f9c9dca74aaa7a2cf361a1ea7631.tar.gz emacs-7192540ba357f9c9dca74aaa7a2cf361a1ea7631.zip | |
(describe-mode): Fix previous change.
| -rw-r--r-- | lisp/help.el | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/lisp/help.el b/lisp/help.el index 61f4b75754f..0f5cc33bccb 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -173,34 +173,33 @@ If FUNCTION is nil, applies `message' to it, thus printing it." | |||
| 173 | For this to work correctly for a minor mode, the mode's indicator variable | 173 | For this to work correctly for a minor mode, the mode's indicator variable |
| 174 | \(listed in `minor-mode-alist') must also be a function whose documentation | 174 | \(listed in `minor-mode-alist') must also be a function whose documentation |
| 175 | describes the minor mode." | 175 | describes the minor mode." |
| 176 | (interactive "p") | 176 | (interactive) |
| 177 | (with-output-to-temp-buffer "*Help*" | 177 | (with-output-to-temp-buffer "*Help*" |
| 178 | (if minor | 178 | (let ((minor-modes minor-mode-alist) |
| 179 | (let ((minor-modes minor-mode-alist) | 179 | (locals (buffer-local-variables))) |
| 180 | (locals (buffer-local-variables))) | 180 | (while minor-modes |
| 181 | (while minor-modes | 181 | (let* ((minor-mode (car (car minor-modes))) |
| 182 | (let* ((minor-mode (car (car minor-modes))) | 182 | (indicator (car (cdr (car minor-modes)))) |
| 183 | (indicator (car (cdr (car minor-modes)))) | 183 | (local-binding (assq minor-mode locals))) |
| 184 | (local-binding (assq minor-mode locals))) | 184 | ;; Document a minor mode if it is listed in minor-mode-alist, |
| 185 | ;; Document a minor mode if it is listed in minor-mode-alist, | 185 | ;; bound locally in this buffer, non-nil, and has a function |
| 186 | ;; bound locally in this buffer, non-nil, and has a function | 186 | ;; definition. |
| 187 | ;; definition. | 187 | (if (and local-binding |
| 188 | (if (and local-binding | 188 | (cdr local-binding) |
| 189 | (cdr local-binding) | 189 | (fboundp minor-mode)) |
| 190 | (fboundp minor-mode)) | 190 | (let ((pretty-minor-mode minor-mode)) |
| 191 | (let ((pretty-minor-mode minor-mode)) | 191 | (if (string-match "-mode$" (symbol-name minor-mode)) |
| 192 | (if (string-match "-mode$" (symbol-name minor-mode)) | 192 | (setq pretty-minor-mode |
| 193 | (setq pretty-minor-mode | 193 | (capitalize |
| 194 | (capitalize | 194 | (substring (symbol-name minor-mode) |
| 195 | (substring (symbol-name minor-mode) | 195 | 0 (match-beginning 0))))) |
| 196 | 0 (match-beginning 0))))) | 196 | (while (and indicator (symbolp indicator)) |
| 197 | (while (and indicator (symbolp indicator)) | 197 | (setq indicator (symbol-value indicator))) |
| 198 | (setq indicator (symbol-value indicator))) | 198 | (princ (format "%s minor mode (indicator%s):\n" |
| 199 | (princ (format "%s minor mode (indicator%s):\n" | 199 | pretty-minor-mode indicator)) |
| 200 | pretty-minor-mode indicator)) | 200 | (princ (documentation minor-mode)) |
| 201 | (princ (documentation minor-mode)) | 201 | (princ "\n\n")))) |
| 202 | (princ "\n\n")))) | 202 | (setq minor-modes (cdr minor-modes)))) |
| 203 | (setq minor-modes (cdr minor-modes))))) | ||
| 204 | (princ mode-name) | 203 | (princ mode-name) |
| 205 | (princ " mode:\n") | 204 | (princ " mode:\n") |
| 206 | (princ (documentation major-mode)) | 205 | (princ (documentation major-mode)) |