zsh-workers
 help / color / mirror / code / Atom feed
* Get description of the completion
@ 2008-10-07 20:25 Jörg Sommer
  2008-10-07 22:36 ` Mikael Magnusson
  0 siblings, 1 reply; 4+ messages in thread
From: Jörg Sommer @ 2008-10-07 20:25 UTC (permalink / raw)
  To: zsh-workers

Hi,

how can I see the description of a single completion? For kill I would
like to see the description even if it was one completion to be sure I
kill the right process.

% kill ini<TAB>    is completed to
% kill 1           but I want to see the description, i.e. the line from
                   the ps command, too.

Is this possible?

Bye, Jörg.
-- 
Die beste Tarnung ist die Wahrheit. Die glaubt einem keiner!
                      (Max Frisch: ‚Biedermann und die Brandstifter‘)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Get description of the completion
  2008-10-07 20:25 Get description of the completion Jörg Sommer
@ 2008-10-07 22:36 ` Mikael Magnusson
  2008-10-13  0:21   ` Jörg Sommer
  0 siblings, 1 reply; 4+ messages in thread
From: Mikael Magnusson @ 2008-10-07 22:36 UTC (permalink / raw)
  To: Jörg Sommer; +Cc: zsh-workers

2008/10/7 Jörg Sommer <joerg@alea.gnuu.de>:
> Hi,
>
> how can I see the description of a single completion? For kill I would
> like to see the description even if it was one completion to be sure I
> kill the right process.
>
> % kill ini<TAB>    is completed to
> % kill 1           but I want to see the description, i.e. the line from
>                   the ps command, too.
>
> Is this possible?

Press list-choices:

% kill init<ctrl-d>
---- process ID
root         1  0.0  0.0   1628   316 ?        Ss   Sep17   0:03 init
[3]

-- 
Mikael Magnusson

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Get description of the completion
  2008-10-07 22:36 ` Mikael Magnusson
@ 2008-10-13  0:21   ` Jörg Sommer
  2008-10-13  3:08     ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Jörg Sommer @ 2008-10-13  0:21 UTC (permalink / raw)
  To: zsh-workers

Hello Mikael,

"Mikael Magnusson" <mikachu@gmail.com> wrote:
> 2008/10/7 Jörg Sommer <joerg@alea.gnuu.de>:
>> Hi,
>>
>> how can I see the description of a single completion? For kill I would
>> like to see the description even if it was one completion to be sure I
>> kill the right process.
>>
>> % kill ini<TAB>    is completed to
>> % kill 1           but I want to see the description, i.e. the line from
>>                   the ps command, too.
>>
>> Is this possible?
>
> Press list-choices:
>
> % kill init<ctrl-d>

That's not really what I'm looking for. I also would like to see the
description of this:

% grep -h<$MAGIC_KEY>
-h           -- suppress printing of filenames

I often remember an option, but I'm not sure. So I want to see the
description to make sure I'm write or maybe, I was wrong and should make
the next guess. :)

Bye, Jörg.
-- 
Der Pessimist ist jemand, der vorzeitig die Wahrheit erzählt.
    	      	  	      		    	(Cyrano de Bergerac)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Get description of the completion
  2008-10-13  0:21   ` Jörg Sommer
@ 2008-10-13  3:08     ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2008-10-13  3:08 UTC (permalink / raw)
  To: zsh-workers

On Oct 13, 12:21am, Joerg wrote:
}
} % grep -h<$MAGIC_KEY>
} -h           -- suppress printing of filenames

What you're effectively asking for is a way to use the knowledge that
is encapsulated in the completion system as the documentation output
by run-help.

I can't think of any good way to do this.  It's sort of antithetical
to the design of the completion system, which is is organized around
finding what's *not* present, often to the point of explicitly excluding
from consideration whatever already is present.  Since "-h" is already on
the line, it (usually) won't be considered as a candidate for completing
again.  So you'd have to note what character was there, backspace over
it, invoke the completion and capture the list of descriptions, then put
the character back, filter for the corresponding description, and call
_message to display it.

"Invoke the completion and capture the list" is difficult at best;
you'd need to copy the tricks used by _complete_help.  What's nearly
impossible is knowing exactly what you need to remove from the line,
in any given context, in order to cause what's on the line when you
begin, to be included as a possible completion (and ideally to be
treated as the *only* possible completion).


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-10-13  3:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-07 20:25 Get description of the completion Jörg Sommer
2008-10-07 22:36 ` Mikael Magnusson
2008-10-13  0:21   ` Jörg Sommer
2008-10-13  3:08     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).