diff options
| author | Richard M. Stallman | 2002-09-05 02:38:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-09-05 02:38:41 +0000 |
| commit | e06d1742ac85ade308af0ee83a4938784d1bb527 (patch) | |
| tree | 5b26c8b9414e8f417c06c2395c4e8a7817c40701 | |
| parent | 91fda8546ac16baabbe8462d4a0b2e2c76f23896 (diff) | |
| download | emacs-e06d1742ac85ade308af0ee83a4938784d1bb527.tar.gz emacs-e06d1742ac85ade308af0ee83a4938784d1bb527.zip | |
(help-with-tutorial): Properly set up
completion-reference-buffer in the *Completion* buffer.
| -rw-r--r-- | lisp/help-fns.el | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 652dd6a859f..8f5510c01a9 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el | |||
| @@ -45,15 +45,27 @@ If there's no tutorial in that language, `TUTORIAL' is selected. | |||
| 45 | With arg, you are asked to choose which language." | 45 | With arg, you are asked to choose which language." |
| 46 | (interactive "P") | 46 | (interactive "P") |
| 47 | (let ((lang (if arg | 47 | (let ((lang (if arg |
| 48 | (progn | 48 | (let (completion-buffer) |
| 49 | ;; Display a completion list right away | 49 | ;; Display a completion list right away |
| 50 | ;; to guide the user. | 50 | ;; to guide the user. |
| 51 | (with-output-to-temp-buffer "*Completions*" | 51 | (with-output-to-temp-buffer "*Completions*" |
| 52 | (display-completion-list | 52 | (display-completion-list |
| 53 | (all-completions "" language-info-alist | 53 | (all-completions "" language-info-alist |
| 54 | (lambda (elm) | 54 | (lambda (elm) |
| 55 | (and (listp elm) (assq 'tutorial elm)))))) | 55 | (and (listp elm) (assq 'tutorial elm))))) |
| 56 | (read-language-name 'tutorial "Language: " "English")) | 56 | (setq completion-buffer standard-output)) |
| 57 | ;; Arrange to set completion-reference-buffer | ||
| 58 | ;; in *Completions* to point to the minibuffer, | ||
| 59 | ;; after entering the minibuffer. | ||
| 60 | (let ((minibuffer-setup-hook minibuffer-setup-hook)) | ||
| 61 | (add-hook 'minibuffer-setup-hook | ||
| 62 | (lambda () | ||
| 63 | (let ((mini (current-buffer))) | ||
| 64 | (with-current-buffer completion-buffer | ||
| 65 | (make-local-variable 'completion-reference-buffer) | ||
| 66 | (setq completion-reference-buffer | ||
| 67 | mini))))) | ||
| 68 | (read-language-name 'tutorial "Language: " "English"))) | ||
| 57 | (if (get-language-info current-language-environment 'tutorial) | 69 | (if (get-language-info current-language-environment 'tutorial) |
| 58 | current-language-environment | 70 | current-language-environment |
| 59 | "English"))) | 71 | "English"))) |