* `help-with-tutorial' (with arg) completion problem
@ 2002-09-04 4:24 John Paul Wallington
2002-09-05 2:47 ` Richard Stallman
2018-12-14 15:39 ` Basil L. Contovounesios
0 siblings, 2 replies; 8+ messages in thread
From: John Paul Wallington @ 2002-09-04 4:24 UTC (permalink / raw)
Doing C-u C-h t or picking Help => Emacs Tutorial (choose language)
from the menu gives the completion list right away.
Choosing a completion from that initial list doesn't work, but rather
inserts the choice in the buffer. Can anyone suggest a good fix?
--
John Paul Wallington
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: `help-with-tutorial' (with arg) completion problem
2002-09-04 4:24 `help-with-tutorial' (with arg) completion problem John Paul Wallington
@ 2002-09-05 2:47 ` Richard Stallman
2002-09-05 3:15 ` John Paul Wallington
2002-09-06 16:18 ` Stefan Monnier
2018-12-14 15:39 ` Basil L. Contovounesios
1 sibling, 2 replies; 8+ messages in thread
From: Richard Stallman @ 2002-09-05 2:47 UTC (permalink / raw)
Cc: emacs-devel
Does this fix it?
*** 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")))
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: `help-with-tutorial' (with arg) completion problem
2002-09-05 2:47 ` Richard Stallman
@ 2002-09-05 3:15 ` John Paul Wallington
2002-09-06 16:18 ` Stefan Monnier
1 sibling, 0 replies; 8+ messages in thread
From: John Paul Wallington @ 2002-09-05 3:15 UTC (permalink / raw)
Cc: emacs-devel
> Does this fix it?
>
> *** help-fns.el.~1.23.~ Tue Aug 20 13:32:27 2002
> --- help-fns.el Wed Sep 4 20:51:36 2002
[...]
It does. Thanks.
--
John Paul Wallington
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: `help-with-tutorial' (with arg) completion problem
2002-09-05 2:47 ` Richard Stallman
2002-09-05 3:15 ` John Paul Wallington
@ 2002-09-06 16:18 ` Stefan Monnier
2002-09-07 3:17 ` Richard Stallman
1 sibling, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2002-09-06 16:18 UTC (permalink / raw)
Cc: jpw, emacs-devel
> 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
> Emacs-devel@gnu.org
> http://mail.gnu.org/mailman/listinfo/emacs-devel
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: `help-with-tutorial' (with arg) completion problem
2002-09-06 16:18 ` Stefan Monnier
@ 2002-09-07 3:17 ` Richard Stallman
0 siblings, 0 replies; 8+ messages in thread
From: Richard Stallman @ 2002-09-07 3:17 UTC (permalink / raw)
Cc: jpw, emacs-devel
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"))
I didn't think of that. If it does the job, please install it.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: `help-with-tutorial' (with arg) completion problem
2002-09-04 4:24 `help-with-tutorial' (with arg) completion problem John Paul Wallington
2002-09-05 2:47 ` Richard Stallman
@ 2018-12-14 15:39 ` Basil L. Contovounesios
2018-12-14 15:49 ` Eli Zaretskii
1 sibling, 1 reply; 8+ messages in thread
From: Basil L. Contovounesios @ 2018-12-14 15:39 UTC (permalink / raw)
To: John Paul Wallington; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 766 bytes --]
John Paul Wallington <jpw@shootybangbang.com> writes:
> Doing C-u C-h t or picking Help => Emacs Tutorial (choose language)
> from the menu gives the completion list right away.
Why does help-with-tutorial, when invoked with a prefix argument,
preemptively pop up the *Completions* buffer? This seems to diverge
from most uses of completing-read I've seen, which defer popping up the
*Completions* buffer until the user invokes minibuffer-complete or
similar. What's more, I noticed this behaviour due to a custom
completing-read-function I use which forgoes using the *Completions*
buffer, so I find the current default a little intrusive.
If it is not crucial for the *Completions* buffer to be displayed
immediately, could this minibuffer setup be removed?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: help-with-tutorial.diff --]
[-- Type: text/x-diff, Size: 636 bytes --]
diff --git a/lisp/tutorial.el b/lisp/tutorial.el
index e3fbdf019c..3e9f5ed35b 100644
--- a/lisp/tutorial.el
+++ b/lisp/tutorial.el
@@ -764,8 +764,7 @@ help-with-tutorial
(message prompt1)))
(let* ((lang (cond
(arg
- (minibuffer-with-setup-hook #'minibuffer-completion-help
- (read-language-name 'tutorial "Language: " "English")))
+ (read-language-name 'tutorial "Language: " "English"))
((get-language-info current-language-environment 'tutorial)
current-language-environment)
(t "English")))
[-- Attachment #3: Type: text/plain, Size: 20 bytes --]
Thanks,
--
Basil
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: `help-with-tutorial' (with arg) completion problem
2018-12-14 15:39 ` Basil L. Contovounesios
@ 2018-12-14 15:49 ` Eli Zaretskii
2018-12-14 16:34 ` Basil L. Contovounesios
0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2018-12-14 15:49 UTC (permalink / raw)
To: Basil L. Contovounesios; +Cc: jpw, emacs-devel
> From: "Basil L. Contovounesios" <contovob@tcd.ie>
> Date: Fri, 14 Dec 2018 15:39:46 +0000
> Cc: emacs-devel@gnu.org
>
> Why does help-with-tutorial, when invoked with a prefix argument,
> preemptively pop up the *Completions* buffer?
Because users who are going to read the tutorial can be assumed to
know very little, if at all, about Emacs completion? And because we
would like to help them see more easily which languages are available
for the tutorial?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: `help-with-tutorial' (with arg) completion problem
2018-12-14 15:49 ` Eli Zaretskii
@ 2018-12-14 16:34 ` Basil L. Contovounesios
0 siblings, 0 replies; 8+ messages in thread
From: Basil L. Contovounesios @ 2018-12-14 16:34 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> From: "Basil L. Contovounesios" <contovob@tcd.ie>
>> Date: Fri, 14 Dec 2018 15:39:46 +0000
>> Cc: emacs-devel@gnu.org
>>
>> Why does help-with-tutorial, when invoked with a prefix argument,
>> preemptively pop up the *Completions* buffer?
>
> Because users who are going to read the tutorial can be assumed to
> know very little, if at all, about Emacs completion? And because we
> would like to help them see more easily which languages are available
> for the tutorial?
Fair enough; thanks for clarifying.
--
Basil
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-12-14 16:34 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-04 4:24 `help-with-tutorial' (with arg) completion problem John Paul Wallington
2002-09-05 2:47 ` Richard Stallman
2002-09-05 3:15 ` John Paul Wallington
2002-09-06 16:18 ` Stefan Monnier
2002-09-07 3:17 ` Richard Stallman
2018-12-14 15:39 ` Basil L. Contovounesios
2018-12-14 15:49 ` Eli Zaretskii
2018-12-14 16:34 ` Basil L. Contovounesios
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.