changeset 47236:debd2b1e4d08

(help-with-tutorial): Properly set up completion-reference-buffer in the *Completion* buffer.
author Richard M. Stallman <rms@gnu.org>
date Thu, 05 Sep 2002 02:38:41 +0000
parents b922395a9576
children fd8d01195320
files lisp/help-fns.el
diffstat 1 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/help-fns.el	Thu Sep 05 02:37:17 2002 +0000
+++ b/lisp/help-fns.el	Thu Sep 05 02:38:41 2002 +0000
@@ -45,15 +45,27 @@
 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")))