From: Juri Linkov <juri@jurta.org>
To: TSUCHIYA Masatoshi <tsuchiya@namazu.org>
Cc: Michael Albinus <michael.albinus@gmx.de>,
Stefan Monnier <monnier@iro.umontreal.ca>,
emacs-devel@gnu.org
Subject: Re: Feature request : Tab-completion for 'shell-comand'
Date: Sun, 09 Mar 2008 19:48:46 +0200 [thread overview]
Message-ID: <87ejajajbt.fsf@jurta.org> (raw)
In-Reply-To: <87r6ekm1wr.fsf@tsuchiya.vaj.namazu.org> (TSUCHIYA Masatoshi's message of "Sun, 09 Mar 2008 23:01:56 +0900")
>>Yes, these messages overwrite the minibuffer, but instead of temporarily
>>redefining the function `message' as in shell-command.el, it would be
>>better to fix comint.el and shell.el to not display completion messages
>>when the minibuffer is active. These files already contain places where
>>this check is done this way:
>
>> (unless (window-minibuffer-p (selected-window))
>> (message "Completing file name..."))
>
> I think that such change will not work well based on two reasons.
> The first reason is that we will have to install the above change into
> all completion functions including functions added by users if you hope
> that this change works consistently. Such great change must be very
> very difficult. The second reason is that several completion functions
> will require a minibuffer to display their completing status.
That is why we should try to find a general solution.
> My solution employed in shell-command.el resolves these two problems.
> The first problem is resolved by re-defining `message' function.
> Re-definition of `message' function enables all tab-completion functions
> to call `message' function without ill effects.
As I see, your solution is just using a shorter delay for displaying the
message: 0.3 sec instead of 2 sec. I think 0.3 sec is too short delay
to be able to read the displayed message.
> And more, the second problem is also resolved by this re-defined
> `message' function which uses a single minibuffer as two separated
> areas. The re-defined `message' function uses the left half of
> minibuffer to display a regular prompt and uses the right half to
> display a completing status.
Displaying the message aligned to the right has the problem that it is
hard to notice when you look at the default left part of the minibuffer.
I use a wide frame and tried your command several times before I noticed
that something blinks for the short period (0.3 sec) on its right part.
> This trick is realized by the following code. You can see that the
> re-defined `message' function concatenates a regular prompt and a
> completing status, and displays both of them.
Such workarounds like redefining the `message' function are not necessary
when installing code to the Emacs core, because we can change Emacs
internals in a general way to avoid similar problems in other places.
> I hope that you will try http://namazu.org/~tsuchiya/elisp/shell-command.el
> before further discussion.
Yes, I already tried it, thanks.
>>Also I see that shell-command.el changes the shell-command prompt.
>>I think this is a separate feature that is better to implement as
>>a minor mode that uses `minibuffer-setup-hook' to add shell-command
>>specific information to the created prompt. Please see a mode like
>>minibuffer-electric-default-mode or file-name-shadow-mode for the ideas
>>how this could be implemented.
>
> I think that it is not a good idea to separate the tab-completion
> feature and the feature to display a current directory in a prompt.
> Users must know where they call commands with tab-completion, because
> almost all actions of tab-completion functions depend on the current
> directory.
Under a separate feature I meant that it should possible to turn it on/off,
and an ability to easily enable it also in other functions that use the
minibuffer to read commands. I also appreciate that you implemented
the same prompt format specifiers as are used for shell prompts.
> I already signed a disclaimer for Gnus.
I hope our maintainers will answer your questions about papers.
> So, the simplest way is to merge necessary code of shell-command.el
> into simple.el and grep.el after I will sign a disclaimer for Emacs
> itself, isn't it?
I think merging necessary code into simple.el and grep.el would be the
best thing to do.
--
Juri Linkov
http://www.jurta.org/emacs/
next prev parent reply other threads:[~2008-03-09 17:48 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-04 16:42 Feature request : Tab-completion for 'shell-comand' paul r
2008-03-04 21:54 ` Michael Albinus
2008-03-04 23:17 ` Juri Linkov
2008-03-05 1:55 ` Stefan Monnier
2008-03-06 8:40 ` TSUCHIYA Masatoshi
2008-03-06 10:04 ` Juri Linkov
2008-03-06 16:04 ` Stefan Monnier
2008-03-06 16:14 ` Drew Adams
2008-03-06 17:31 ` Miles Bader
2008-03-06 17:46 ` Drew Adams
2008-03-06 18:21 ` Stefan Monnier
2008-03-07 2:14 ` Miles Bader
2008-03-06 23:48 ` Juri Linkov
2008-03-06 17:48 ` Juri Linkov
2008-03-06 23:45 ` Juri Linkov
2008-03-06 23:47 ` Juri Linkov
2008-03-08 17:39 ` Richard Stallman
2008-03-08 22:21 ` Juri Linkov
2008-03-08 22:38 ` Lennart Borgman (gmail)
2008-03-08 22:57 ` Juri Linkov
2008-03-09 0:21 ` Lennart Borgman (gmail)
2008-03-08 23:27 ` Stefan Monnier
2008-03-09 16:39 ` Richard Stallman
2008-03-09 17:45 ` Juri Linkov
2008-03-10 6:12 ` Richard Stallman
2008-03-10 14:44 ` Cannot build the trunk since unicode (was: Feature request : Tab-completion for 'shell-comand') Stefan Monnier
2008-03-11 9:24 ` Richard Stallman
2008-03-11 9:40 ` Andreas Schwab
2008-03-10 22:35 ` Feature request : Tab-completion for 'shell-comand' Juri Linkov
2008-03-11 20:24 ` Richard Stallman
2008-03-12 0:31 ` Juri Linkov
2008-03-12 23:13 ` Johan Bockgård
2008-03-12 23:19 ` David Kastrup
2008-03-12 23:36 ` Johan Bockgård
2008-03-13 2:14 ` Juri Linkov
2008-03-13 9:28 ` Johan Bockgård
2008-03-13 14:54 ` Stefan Monnier
2008-03-13 19:02 ` martin rudalics
2008-03-14 2:54 ` Richard Stallman
2008-03-14 7:46 ` martin rudalics
2008-03-14 15:07 ` Stefan Monnier
2008-03-15 3:23 ` Richard Stallman
2008-03-15 3:24 ` Richard Stallman
2008-03-14 3:21 ` Stefan Monnier
2008-03-14 7:47 ` martin rudalics
2008-03-14 15:05 ` Stefan Monnier
2008-03-14 18:33 ` martin rudalics
2008-03-14 19:20 ` Stefan Monnier
2008-03-14 22:31 ` martin rudalics
2008-03-15 0:59 ` Stefan Monnier
2008-03-16 14:24 ` martin rudalics
2008-03-16 18:28 ` Stefan Monnier
2008-03-17 7:36 ` martin rudalics
2008-03-17 15:00 ` Stefan Monnier
2008-03-14 1:04 ` Juri Linkov
2008-03-09 14:01 ` TSUCHIYA Masatoshi
2008-03-09 17:48 ` Juri Linkov [this message]
2008-03-10 0:08 ` TSUCHIYA Masatoshi
2008-03-10 0:57 ` Drew Adams
2008-03-10 1:29 ` Juri Linkov
2008-03-10 2:20 ` Johan Bockgård
2008-03-10 2:37 ` Lennart Borgman (gmail)
2008-03-10 22:31 ` Juri Linkov
2008-03-12 1:31 ` TSUCHIYA Masatoshi
2008-03-12 2:12 ` Stefan Monnier
2008-03-12 10:42 ` Juri Linkov
2008-03-15 8:29 ` TSUCHIYA Masatoshi
2008-03-15 10:24 ` paul r
2008-03-15 21:35 ` Juri Linkov
2008-03-20 19:58 ` Stefan Monnier
2008-03-20 20:55 ` Juri Linkov
2008-03-21 17:17 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ejajajbt.fsf@jurta.org \
--to=juri@jurta.org \
--cc=emacs-devel@gnu.org \
--cc=michael.albinus@gmx.de \
--cc=monnier@iro.umontreal.ca \
--cc=tsuchiya@namazu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.