zsh-workers
 help / color / mirror / code / Atom feed
* Questions about _values
@ 2009-01-25 23:36 Dražen Kačar
  2009-01-26  2:55 ` Greg Klanderman
  0 siblings, 1 reply; 3+ messages in thread
From: Dražen Kačar @ 2009-01-25 23:36 UTC (permalink / raw)
  To: zsh-workers

Hello,

I'm trying to write some completions with mixed success. Currently one
of my completions looks like this:

{vsun}/# pcred  <TAB pressed here
0                          --     root sched                                   
1                          --     root /sbin/init                              
122                        --     root /usr/sbin/nscd                          
125                        --     root /usr/lib/sysevent/syseventd             
134                        --   daemon /usr/lib/crypto/kcfd                    
140                        --     root /usr/lib/power/powerd                   
1402  2777  438            --     root /usr/lib/ssh/sshd                       
143                        --     root /usr/lib/picl/picld                     
2                          --     root pageout                                 
237                        --     root /usr/bin/VBoxService                    
238                        --     root /usr/sbin/cron                          
2780  1405                 --     dave /usr/lib/ssh/sshd                       
2782  1407                 --     dave -zsh
...

Argument is a PID, completed with _values. 

1. I tried to get the same effect with _describe, but I don't know how
   to do that (value grouping if description is the same and the "--"
   separator). I looked at _values source, but I don't understand how
   it does what it does. I suppose compvalues does the trick somehow. How
   do I produce the above output with _describe?

2. Is there a way to tell _values to limit the maximum number of items
   in a group? In the above example the description (process name) is
   more important than the items, so I'd like to avoid description
   trimming which happens by default.

3. Is there a way to tell _values (or _describe) to sort offered
   completions by description and not by item? In that case I'd get sort
   by username here, which is much better than sort by PID.

   Also, is there a way to tell them not to sort? The completion list
   could already be sorted in a meaningful way.

4. If I keep pressing TAB, zsh will offer completions. Is there a way to
   make it highlight (print the characters in bold or some color, for
   example) the offered item and its description in the list?
   Here the offered completions (PIDs) aren't descriptive, so the user must
   associate them with the descriptions (command names) to actually select
   what he wanted. It's hard to do vithout visual cue.

-- 
 .-.   .-.    Yes, I am an agent of Satan, but my duties are largely
(_  \ /  _)   ceremonial.
     |
     |        dave@fly.srk.fer.hr


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

end of thread, other threads:[~2009-01-26 21:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-25 23:36 Questions about _values Dražen Kačar
2009-01-26  2:55 ` Greg Klanderman
2009-01-26 21:10   ` Dražen Kačar

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).