Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: umount completion context and tags

On Dec 14, 11:15am, Silas Silva wrote:
} device-labels is useless for me, so I tried to exclude it:
}     zstyle ':completion:*:mount:*' tag-order '!device-labels'
} But, it simply doesn't work!  ^Xh still gives me all tags.

That's not what '!' does.  It doesn't remove the tags themselves from
the help output, it removes the *possible matches* for the tags when
performing an actual completion.  The tag name itself is still valid.

Also, are you completing after umount?  Because you used :mount: in
the zstyle name, so it's not going to apply to the umount command.

Like so (using "unsetopt alwayslastprompt" so that the listings aren't
overwritten each time I hit tab):

torch% umount 
/                         /dev/shm                  /sys                    
/boot                     /proc                     usbfs                   
/dev/hda1                 /proc/bus/usb             /var/lib/nfs/rpc_pipefs 
/dev/hda2                 /proc/sys/fs/binfmt_misc                          
/dev/pts                  sunrpc                                            
torch% zstyle ':completion:*:umount:*' tag-order '! device-labels'
torch% umount /

Now there are no labels, only paths, so there is a unique "/" prefix
and I have to hit tab a second time to get the list:

torch% umount /
/                         /dev/pts                  /proc/sys/fs/binfmt_misc
/boot                     /dev/shm                  /sys                    
/dev/hda1                 /proc                     /var/lib/nfs/rpc_pipefs 
/dev/hda2                 /proc/bus/usb                                     
torch% umount /

If you want the style for both mount and umount, you can use:

zstyle ':completion:*:(u|)mount:*' tag-order '! device-labels'

(Aside:  Interesting that the listing sort order ignores the slashes.  I
don't offhand know why that's the case.)

Messages sorted by: Reverse Date, Date, Thread, Author