summaryrefslogtreecommitdiff
path: root/lisp/help-fns.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2002-09-05 02:38:41 +0000
committerRichard M. Stallman <rms@gnu.org>2002-09-05 02:38:41 +0000
commite06d1742ac85ade308af0ee83a4938784d1bb527 (patch)
tree5b26c8b9414e8f417c06c2395c4e8a7817c40701 /lisp/help-fns.el
parent91fda8546ac16baabbe8462d4a0b2e2c76f23896 (diff)
downloademacs-e06d1742ac85ade308af0ee83a4938784d1bb527.tar.gz
(help-with-tutorial): Properly set up
completion-reference-buffer in the *Completion* buffer.
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r--lisp/help-fns.el18
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.
With arg, you are asked to choose which language."
(interactive "P")
(let ((lang (if arg
- (progn
+ (let (completion-buffer)
;; Display a completion list right away
;; to guide the user.
(with-output-to-temp-buffer "*Completions*"
(display-completion-list
(all-completions "" language-info-alist
(lambda (elm)
- (and (listp elm) (assq 'tutorial elm))))))
- (read-language-name 'tutorial "Language: " "English"))
+ (and (listp elm) (assq 'tutorial elm)))))
+ (setq completion-buffer standard-output))
+ ;; Arrange to set completion-reference-buffer
+ ;; in *Completions* to point to the minibuffer,
+ ;; after entering the minibuffer.
+ (let ((minibuffer-setup-hook minibuffer-setup-hook))
+ (add-hook 'minibuffer-setup-hook
+ (lambda ()
+ (let ((mini (current-buffer)))
+ (with-current-buffer completion-buffer
+ (make-local-variable 'completion-reference-buffer)
+ (setq completion-reference-buffer
+ mini)))))
+ (read-language-name 'tutorial "Language: " "English")))
(if (get-language-info current-language-environment 'tutorial)
current-language-environment
"English")))