emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `help-with-tutorial' (with arg) completion problem


From: Stefan Monnier
Subject: Re: `help-with-tutorial' (with arg) completion problem
Date: Fri, 06 Sep 2002 12:18:57 -0400

> Does this fix it?

How about a simpler solution along the lines of what I did to
M-x imenu (which used to do something similar):

        (let ((minibuffer-setup-hook minibuffer-setup-hook))
          (add-hook 'minibuffer-setup-hook 'minibuffer-completion-help)
          (read-language-name 'tutorial "Language: " "English"))


-- Stefan


> *** help-fns.el.~1.23.~       Tue Aug 20 13:32:27 2002
> --- help-fns.el       Wed Sep  4 20:51:36 2002
> ***************
> *** 45,59 ****
>   With arg, you are asked to choose which language."
>     (interactive "P")
>     (let ((lang (if arg
> !               (progn
>                   ;; 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"))
>               (if (get-language-info current-language-environment 'tutorial)
>                   current-language-environment
>                 "English")))
> --- 45,71 ----
>   With arg, you are asked to choose which language."
>     (interactive "P")
>     (let ((lang (if arg
> !               (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)))))
> !                   (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")))
> 
> 
> _______________________________________________
> Emacs-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/emacs-devel
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]