diff options
| author | Richard M. Stallman | 1997-12-26 10:47:20 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-12-26 10:47:20 +0000 |
| commit | 1eff0ba1b757fee9f874c86dee349b4ff95e7d55 (patch) | |
| tree | 7bec0bfaff5b86224acebf6b4c8ba0bc17551512 | |
| parent | d2e9bfae622a0e2411632a8fbec4ddc49c5812eb (diff) | |
| download | emacs-1eff0ba1b757fee9f874c86dee349b4ff95e7d55.tar.gz emacs-1eff0ba1b757fee9f874c86dee349b4ff95e7d55.zip | |
(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.
| -rw-r--r-- | lisp/info-look.el | 58 |
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.") | |||
| 173 | ("(termcap)Var Index" nil | 173 | ("(termcap)Var Index" nil |
| 174 | "^[ \t]*`" "'")) | 174 | "^[ \t]*`" "'")) |
| 175 | info-lookup-guess-c-symbol) | 175 | info-lookup-guess-c-symbol) |
| 176 | (emacs-lisp-mode | ||
| 177 | "[-_a-zA-Z+=*:&%$#@!^~][-_a-zA-Z0-9+=*:&%$#@!^~]*" nil | ||
| 178 | ("(elisp)Index" nil | ||
| 179 | "^[ \t]+- \\(Function\\|Macro\\|User Option\\|Variable\\): .*\\<" | ||
| 180 | "\\>")) | ||
| 176 | (m4-mode | 181 | (m4-mode |
| 177 | "[_a-zA-Z][_a-zA-Z0-9]*" nil | 182 | "[_a-zA-Z][_a-zA-Z0-9]*" nil |
| 178 | (("(m4)Macro index")) | 183 | (("(m4)Macro index")) |
| @@ -353,26 +358,28 @@ The default file name is the one found at point." | |||
| 353 | 358 | ||
| 354 | (defun info-lookup-make-completions (topic mode) | 359 | (defun info-lookup-make-completions (topic mode) |
| 355 | "Create a unique alist from all index entries." | 360 | "Create a unique alist from all index entries." |
| 356 | (condition-case nil | 361 | (let ((doc-spec (info-lookup->doc-spec topic mode)) |
| 357 | (let ((doc-spec (info-lookup->doc-spec topic mode)) | 362 | (regexp (concat "^\\(" (info-lookup->regexp topic mode) |
| 358 | (regexp (concat "^\\(" (info-lookup->regexp topic mode) | 363 | "\\)\\([ \t].*\\)?$")) |
| 359 | "\\)\\([ \t].*\\)?$")) | 364 | node trans entry item prefix result |
| 360 | node trans entry item prefix result) | 365 | (buffer (get-buffer-create " temp-info-look"))) |
| 361 | (save-window-excursion | 366 | (with-current-buffer buffer |
| 362 | (info) | 367 | (Info-mode)) |
| 363 | (while doc-spec | 368 | (while doc-spec |
| 364 | (setq node (nth 0 (car doc-spec)) | 369 | (setq node (nth 0 (car doc-spec)) |
| 365 | trans (cond ((eq (nth 1 (car doc-spec)) nil) | 370 | trans (cond ((eq (nth 1 (car doc-spec)) nil) |
| 366 | (lambda (arg) | 371 | (lambda (arg) |
| 367 | (if (string-match regexp arg) | 372 | (if (string-match regexp arg) |
| 368 | (match-string 1 arg)))) | 373 | (match-string 1 arg)))) |
| 369 | ((stringp (nth 1 (car doc-spec))) | 374 | ((stringp (nth 1 (car doc-spec))) |
| 370 | (setq prefix (nth 1 (car doc-spec))) | 375 | (setq prefix (nth 1 (car doc-spec))) |
| 371 | (lambda (arg) | 376 | (lambda (arg) |
| 372 | (if (string-match "^\\([^: \t\n]+\\)" arg) | 377 | (if (string-match "^\\([^: \t\n]+\\)" arg) |
| 373 | (concat prefix (match-string 1 arg))))) | 378 | (concat prefix (match-string 1 arg))))) |
| 374 | (t (nth 1 (car doc-spec))))) | 379 | (t (nth 1 (car doc-spec))))) |
| 375 | (message "Processing Info node \"%s\"..." node) | 380 | (condition-case nil |
| 381 | (with-current-buffer buffer | ||
| 382 | (message "Processing Info node `%s'..." node) | ||
| 376 | (Info-goto-node node) | 383 | (Info-goto-node node) |
| 377 | (goto-char (point-min)) | 384 | (goto-char (point-min)) |
| 378 | (and (search-forward "\n* Menu:" nil t) | 385 | (and (search-forward "\n* Menu:" nil t) |
| @@ -384,12 +391,11 @@ The default file name is the one found at point." | |||
| 384 | (and (string-equal entry item) | 391 | (and (string-equal entry item) |
| 385 | (setq entry nil)) | 392 | (setq entry nil)) |
| 386 | (or (assoc item result) | 393 | (or (assoc item result) |
| 387 | (setq result (cons (cons item entry) result))))) | 394 | (setq result (cons (cons item entry) result)))))) |
| 388 | (message "Processing Info node \"%s\"... done" node) | 395 | (error nil)) |
| 389 | (setq doc-spec (cdr doc-spec))) | 396 | (message "Processing Info node `%s'...done" node) |
| 390 | (Info-directory)) | 397 | (setq doc-spec (cdr doc-spec))) |
| 391 | result) | 398 | result)) |
| 392 | (error nil))) | ||
| 393 | 399 | ||
| 394 | (defun info-lookup-guess-default (topic mode) | 400 | (defun info-lookup-guess-default (topic mode) |
| 395 | "Pick up default item at point (with favor to look back). | 401 | "Pick up default item at point (with favor to look back). |