diff options
| -rw-r--r-- | lisp/help.el | 88 |
1 files changed, 28 insertions, 60 deletions
diff --git a/lisp/help.el b/lisp/help.el index bc9b6ce0293..ba8664fc14b 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | ;;; Commentary: | 25 | ;;; Commentary: |
| 26 | 26 | ||
| 27 | ;; This code implements GNU Emac's on-line help system, the one invoked by | 27 | ;; This code implements GNU Emacs' on-line help system, the one invoked by |
| 28 | ;;`M-x help-for-help'. | 28 | ;;`M-x help-for-help'. |
| 29 | 29 | ||
| 30 | ;;; Code: | 30 | ;;; Code: |
| @@ -198,29 +198,13 @@ Computes a message and applies the optional argument FUNCTION to it. | |||
| 198 | If FUNCTION is nil, applies `message' to it, thus printing it." | 198 | If FUNCTION is nil, applies `message' to it, thus printing it." |
| 199 | (and (not (get-buffer-window standard-output)) | 199 | (and (not (get-buffer-window standard-output)) |
| 200 | (let ((first-message | 200 | (let ((first-message |
| 201 | (cond ((or (member (buffer-name standard-output) | 201 | (cond ((special-display-p (buffer-name standard-output)) |
| 202 | special-display-buffer-names) | ||
| 203 | (assoc (buffer-name standard-output) | ||
| 204 | special-display-buffer-names) | ||
| 205 | (let (found | ||
| 206 | (tail special-display-regexps) | ||
| 207 | (name (buffer-name standard-output))) | ||
| 208 | (while (and tail (not found)) | ||
| 209 | (if (or (and (consp (car tail)) | ||
| 210 | (string-match (car (car tail)) name)) | ||
| 211 | (and (stringp (car tail)) | ||
| 212 | (string-match (car tail) name))) | ||
| 213 | (setq found t)) | ||
| 214 | (setq tail (cdr tail))) | ||
| 215 | found)) | ||
| 216 | ;; If the help output buffer is a special display buffer, | 202 | ;; If the help output buffer is a special display buffer, |
| 217 | ;; don't say anything about how to get rid of it. | 203 | ;; don't say anything about how to get rid of it. |
| 218 | ;; First of all, the user will do that with the window | 204 | ;; First of all, the user will do that with the window |
| 219 | ;; manager, not with Emacs. | 205 | ;; manager, not with Emacs. |
| 220 | ;; Secondly, the buffer has not been displayed yet, | 206 | ;; Secondly, the buffer has not been displayed yet, |
| 221 | ;; so we don't know whether its frame will be selected. | 207 | ;; so we don't know whether its frame will be selected. |
| 222 | ;; Even the message about scrolling the help | ||
| 223 | ;; might be wrong, but it seems worth showing it anyway. | ||
| 224 | nil) | 208 | nil) |
| 225 | ((not (one-window-p t)) | 209 | ((not (one-window-p t)) |
| 226 | "Type \\[switch-to-buffer-other-window] RET to restore the other window.") | 210 | "Type \\[switch-to-buffer-other-window] RET to restore the other window.") |
| @@ -236,25 +220,9 @@ If FUNCTION is nil, applies `message' to it, thus printing it." | |||
| 236 | (if first-message " " "") | 220 | (if first-message " " "") |
| 237 | ;; If the help buffer will go in a separate frame, | 221 | ;; If the help buffer will go in a separate frame, |
| 238 | ;; it's no use mentioning a command to scroll, so don't. | 222 | ;; it's no use mentioning a command to scroll, so don't. |
| 239 | (if (or (member (buffer-name standard-output) | 223 | (if (special-display-p (buffer-name standard-output)) |
| 240 | special-display-buffer-names) | ||
| 241 | (assoc (buffer-name standard-output) | ||
| 242 | special-display-buffer-names) | ||
| 243 | (memq t (mapcar '(lambda (elt) | ||
| 244 | (if (consp elt) | ||
| 245 | (setq elt (car elt))) | ||
| 246 | (string-match elt (buffer-name standard-output))) | ||
| 247 | special-display-regexps))) | ||
| 248 | nil | 224 | nil |
| 249 | (if (or (member (buffer-name standard-output) | 225 | (if (same-window-p (buffer-name standard-output)) |
| 250 | same-window-buffer-names) | ||
| 251 | (assoc (buffer-name standard-output) | ||
| 252 | same-window-buffer-names) | ||
| 253 | (memq t (mapcar '(lambda (elt) | ||
| 254 | (if (consp elt) | ||
| 255 | (setq elt (car elt))) | ||
| 256 | (string-match elt (buffer-name standard-output))) | ||
| 257 | same-window-regexps))) | ||
| 258 | ;; Say how to scroll this window. | 226 | ;; Say how to scroll this window. |
| 259 | (substitute-command-keys | 227 | (substitute-command-keys |
| 260 | "\\[scroll-up] to scroll the help.") | 228 | "\\[scroll-up] to scroll the help.") |
| @@ -681,30 +649,30 @@ is used instead of `load-path'." | |||
| 681 | (let (result) | 649 | (let (result) |
| 682 | (catch 'answer | 650 | (catch 'answer |
| 683 | (mapcar | 651 | (mapcar |
| 684 | '(lambda (dir) | 652 | (lambda (dir) |
| 685 | (mapcar | 653 | (mapcar |
| 686 | '(lambda (suf) | 654 | (lambda (suf) |
| 687 | (let ((try (expand-file-name (concat library suf) dir))) | 655 | (let ((try (expand-file-name (concat library suf) dir))) |
| 688 | (and (file-readable-p try) | 656 | (and (file-readable-p try) |
| 689 | (null (file-directory-p try)) | 657 | (null (file-directory-p try)) |
| 690 | (progn | 658 | (progn |
| 691 | (setq result try) | 659 | (setq result try) |
| 692 | (throw 'answer try))))) | 660 | (throw 'answer try))))) |
| 693 | (if nosuffix | 661 | (if nosuffix |
| 694 | '("") | 662 | '("") |
| 695 | (let ((basic '(".elc" ".el" "")) | 663 | (let ((basic '(".elc" ".el" "")) |
| 696 | (compressed '(".Z" ".gz" ""))) | 664 | (compressed '(".Z" ".gz" ""))) |
| 697 | ;; If autocompression mode is on, | 665 | ;; If autocompression mode is on, |
| 698 | ;; consider all combinations of library suffixes | 666 | ;; consider all combinations of library suffixes |
| 699 | ;; and compression suffixes. | 667 | ;; and compression suffixes. |
| 700 | (if (rassq 'jka-compr-handler file-name-handler-alist) | 668 | (if (rassq 'jka-compr-handler file-name-handler-alist) |
| 701 | (apply 'nconc | 669 | (apply 'nconc |
| 702 | (mapcar '(lambda (compelt) | 670 | (mapcar (lambda (compelt) |
| 703 | (mapcar '(lambda (baselt) | 671 | (mapcar (lambda (baselt) |
| 704 | (concat baselt compelt)) | 672 | (concat baselt compelt)) |
| 705 | basic)) | 673 | basic)) |
| 706 | compressed)) | 674 | compressed)) |
| 707 | basic))))) | 675 | basic))))) |
| 708 | (or path load-path))) | 676 | (or path load-path))) |
| 709 | (and interactive-call | 677 | (and interactive-call |
| 710 | (if result | 678 | (if result |