diff options
| author | Richard M. Stallman | 1994-03-02 23:09:40 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-03-02 23:09:40 +0000 |
| commit | 3819736b9e2b195af5022bcdb3880dac0fdef93c (patch) | |
| tree | 792962502860c36af6a6dd6fd64bedd10957a800 | |
| parent | 0301268e2ba6a1ce8ddf77473e74d1aea856427b (diff) | |
| download | emacs-3819736b9e2b195af5022bcdb3880dac0fdef93c.tar.gz emacs-3819736b9e2b195af5022bcdb3880dac0fdef93c.zip | |
(completion-list-mode): Set completion-reference-buffer
to the buffer for which the completions were requested.
(completion-reference-buffer): New variable.
| -rw-r--r-- | lisp/simple.el | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index c74141cb1c2..cc847efec64 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2339,6 +2339,9 @@ it were the arg to `interactive' (which see) to interactively read the value." | |||
| 2339 | ;; Completion mode is suitable only for specially formatted data. | 2339 | ;; Completion mode is suitable only for specially formatted data. |
| 2340 | (put 'completion-list-mode 'mode-class 'special) | 2340 | (put 'completion-list-mode 'mode-class 'special) |
| 2341 | 2341 | ||
| 2342 | ;; Record the buffer that was current when the completion list was requested. | ||
| 2343 | (defvar completion-reference-buffer) | ||
| 2344 | |||
| 2342 | (defun completion-list-mode () | 2345 | (defun completion-list-mode () |
| 2343 | "Major mode for buffers showing lists of possible completions. | 2346 | "Major mode for buffers showing lists of possible completions. |
| 2344 | Type \\<completion-list-mode-map>\\[mouse-choose-completion] to select | 2347 | Type \\<completion-list-mode-map>\\[mouse-choose-completion] to select |
| @@ -2352,11 +2355,15 @@ a completion with the mouse." | |||
| 2352 | 2355 | ||
| 2353 | (defun completion-setup-function () | 2356 | (defun completion-setup-function () |
| 2354 | (save-excursion | 2357 | (save-excursion |
| 2355 | (completion-list-mode) | 2358 | (let ((mainbuf (current-buffer))) |
| 2356 | (goto-char (point-min)) | 2359 | (set-buffer standard-output) |
| 2357 | (if window-system | 2360 | (completion-list-mode) |
| 2358 | (insert (substitute-command-keys | 2361 | (make-local-variable 'completion-reference-buffer) |
| 2359 | "Click \\[mouse-choose-completion] on a completion to select it.\n\n"))))) | 2362 | (setq completion-reference-buffer mainbuf) |
| 2363 | (goto-char (point-min)) | ||
| 2364 | (if window-system | ||
| 2365 | (insert (substitute-command-keys | ||
| 2366 | "Click \\[mouse-choose-completion] on a completion to select it.\n\n")))))) | ||
| 2360 | 2367 | ||
| 2361 | (add-hook 'completion-setup-hook 'completion-setup-function) | 2368 | (add-hook 'completion-setup-hook 'completion-setup-function) |
| 2362 | 2369 | ||