summaryrefslogtreecommitdiff
path: root/lisp/info-look.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-12-26 10:47:20 +0000
committerRichard M. Stallman <rms@gnu.org>1997-12-26 10:47:20 +0000
commit4073efb0a098d41cdbe11477fc8ecbee12466249 (patch)
treeb48aadfde95d483d96b9e27a850f21f85464a61c /lisp/info-look.el
parent1ca53d0e3c9916253d467cadf5e3861b5fec4939 (diff)
downloademacs-4073efb0a098d41cdbe11477fc8ecbee12466249.tar.gz
(info-lookup-symbol-alist): Handle Emacs Lisp mode.
(info-lookup-make-completions): Catch errors one file at a time. Use a special temp buffer, not the usual info buffer, and never display it in a window.
Diffstat (limited to 'lisp/info-look.el')
-rw-r--r--lisp/info-look.el58
1 files changed, 32 insertions, 26 deletions
diff --git a/lisp/info-look.el b/lisp/info-look.el
index 113306dc69e..26811324b96 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -173,6 +173,11 @@ REFER-MODES is a list of other help modes to use.")
("(termcap)Var Index" nil
"^[ \t]*`" "'"))
info-lookup-guess-c-symbol)
+ (emacs-lisp-mode
+ "[-_a-zA-Z+=*:&%$#@!^~][-_a-zA-Z0-9+=*:&%$#@!^~]*" nil
+ ("(elisp)Index" nil
+ "^[ \t]+- \\(Function\\|Macro\\|User Option\\|Variable\\): .*\\<"
+ "\\>"))
(m4-mode
"[_a-zA-Z][_a-zA-Z0-9]*" nil
(("(m4)Macro index"))
@@ -353,26 +358,28 @@ The default file name is the one found at point."
(defun info-lookup-make-completions (topic mode)
"Create a unique alist from all index entries."
- (condition-case nil
- (let ((doc-spec (info-lookup->doc-spec topic mode))
- (regexp (concat "^\\(" (info-lookup->regexp topic mode)
- "\\)\\([ \t].*\\)?$"))
- node trans entry item prefix result)
- (save-window-excursion
- (info)
- (while doc-spec
- (setq node (nth 0 (car doc-spec))
- trans (cond ((eq (nth 1 (car doc-spec)) nil)
- (lambda (arg)
- (if (string-match regexp arg)
- (match-string 1 arg))))
- ((stringp (nth 1 (car doc-spec)))
- (setq prefix (nth 1 (car doc-spec)))
- (lambda (arg)
- (if (string-match "^\\([^: \t\n]+\\)" arg)
- (concat prefix (match-string 1 arg)))))
- (t (nth 1 (car doc-spec)))))
- (message "Processing Info node \"%s\"..." node)
+ (let ((doc-spec (info-lookup->doc-spec topic mode))
+ (regexp (concat "^\\(" (info-lookup->regexp topic mode)
+ "\\)\\([ \t].*\\)?$"))
+ node trans entry item prefix result
+ (buffer (get-buffer-create " temp-info-look")))
+ (with-current-buffer buffer
+ (Info-mode))
+ (while doc-spec
+ (setq node (nth 0 (car doc-spec))
+ trans (cond ((eq (nth 1 (car doc-spec)) nil)
+ (lambda (arg)
+ (if (string-match regexp arg)
+ (match-string 1 arg))))
+ ((stringp (nth 1 (car doc-spec)))
+ (setq prefix (nth 1 (car doc-spec)))
+ (lambda (arg)
+ (if (string-match "^\\([^: \t\n]+\\)" arg)
+ (concat prefix (match-string 1 arg)))))
+ (t (nth 1 (car doc-spec)))))
+ (condition-case nil
+ (with-current-buffer buffer
+ (message "Processing Info node `%s'..." node)
(Info-goto-node node)
(goto-char (point-min))
(and (search-forward "\n* Menu:" nil t)
@@ -384,12 +391,11 @@ The default file name is the one found at point."
(and (string-equal entry item)
(setq entry nil))
(or (assoc item result)
- (setq result (cons (cons item entry) result)))))
- (message "Processing Info node \"%s\"... done" node)
- (setq doc-spec (cdr doc-spec)))
- (Info-directory))
- result)
- (error nil)))
+ (setq result (cons (cons item entry) result))))))
+ (error nil))
+ (message "Processing Info node `%s'...done" node)
+ (setq doc-spec (cdr doc-spec)))
+ result))
(defun info-lookup-guess-default (topic mode)
"Pick up default item at point (with favor to look back).