[issue616] grml-etc-core: Adding trainling spaces to various power completions.

Frank Terbeck bts at bts.grml.org
Thu Feb 5 18:46:00 CET 2009


Frank Terbeck <ft at grml.org> added the comment:

Well, I hope I'm not starting to nitpick too heavily.
But since I do like the way you're writing nice and lengthy commit
messages, I think it's okay to see whether we can can them just
right[tm]. :-)

Alexander Steinböck <bts at bts.grml.org>:
> From f8b4c2f57de0c6c5cffa5493f9d778972f857af9 Mon Sep 17 00:00:00 2001
> From: =?utf-8?q?Alexander=20Steinb=C3=B6ck?= <z3ttacht at grml.org>
> Date: Thu, 5 Feb 2009 16:55:42 +0100
> Subject: [PATCH 1/2] zshrc: Add a trailing space for several power completions.
> 
> Hence $USER doesn't need to hit the space bar when some arguments are
> supposed to follow after the expansion of a power completion.

I don't like the wording. I know we're using 'power completion'
elsewhere, too. But it's really just an expansion. There is *nothing*
that's completed at all.

Therefore:
Hence the user doesn't need to hit the space bar when some arguments
are supposed to follow after an expansion.

> Take '|& grep --color=auto ' for instance. Mind the trailing space.

I guess I'd just drop this line altogether. It doesn't add much of
value.

> Therefore one can just keep typing conveniently.
[...]

The patch itself looks fine. An updated patch with a cleaned up commit
msg would be terrific, though. :)

> --- a/etc/zsh/zshrc
> +++ b/etc/zsh/zshrc

However, I *seriously* don't know why the following are in the $abk[]
hash at all... It has nothing to do with your patch, I'm just
wondering. Mika? Where's the point in having those in addition to
simple aliases?

[...]
> -    'da' 'du -sch'
> +    'da' 'du -sch '
>      'j' 'jobs -l'
> -    'u' 'translate -i'
> +    'u' 'translate -i '
>      'co' "./configure && make && sudo make install"
        ^- That one I actually get. Maybe you'd want to add options to
           configure...

>      'CH' "./configure --help"
>      'conkeror' 'firefox -chrome chrome://conkeror/content'
        ^- that one should be out. That extension is a standalone
           program these days, AFAIK.

> @@ -821,29 +821,29 @@ abk=(
>      'lsnew' $'ls -rl *(D.om[1,10])\n# display the newest files'
>      'lsold' $'ls -rtlh *(D.om[-11,-1])\n # display the oldest files'
>      'lssmall' $'ls -Srl *(.oL[1,10])\n# display the smallest files'

These 3 I don't get either. Their names tell the story as to what they
do...

> -    'rw-' 'chmod 600'
> -    '600' 'chmod u+rw-x,g-rwx,o-rwx'
> -    'rwx' 'chmod u+rwx'
> -    '700' 'chmod u+rwx,g-rwx,o-rwx'
> -    'r--' 'chmod u+r-wx,g-rwx,o-rwx'
> -    '644' $'chmod u+rw-x,g+r-wx,o+r-wx\n # 4=r,2=w,1=x'
> -    '755' 'chmod u+rwx,g+r-w+x,o+r-w+x'
> +    'rw-' 'chmod 600 '
> +    '600' 'chmod u+rw-x,g-rwx,o-rwx '
> +    'rwx' 'chmod u+rwx '
> +    '700' 'chmod u+rwx,g-rwx,o-rwx '
> +    'r--' 'chmod u+r-wx,g-rwx,o-rwx '
> +    '644' $'chmod u+rw-x,g+r-wx,o+r-wx \n # 4=r,2=w,1=x'
> +    '755' 'chmod u+rwx,g+r-w+x,o+r-w+x '

These might serve the purpose of learning the octal values. Then
again.. I don't know. To me they feel totally redundant.

>      'md' 'mkdir -p '
> -    'cmplayer' 'mplayer -vo -fs -zoom fbdev'
> -    'fbmplayer' 'mplayer -vo -fs -zoom fbdev'
> +    'cmplayer' 'mplayer -vo -fs -zoom fbdev '
> +    'fbmplayer' 'mplayer -vo -fs -zoom fbdev '
>      'fblinks' 'links2 -driver fb'

These I don't get at all.
The names tell the story again. And IMHO the point of an alias is to
not bother about complex repetitive options and arguments.

>      'insecssh' 'ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"'
>      'insecscp' 'scp -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"'
>      'fori' 'for i ({..}) { }'
> -    'cx' 'chmod +x'
> -    'e'  'print -l'
> +    'cx' 'chmod +x '
> +    'e'  'print -l '
>      'se' 'setopt interactivecomments'
>      'va' 'valac --vapidir=../vapi/ --pkg=gtk+-2.0 gtktest.vala'
> -    'fb2' '=mplayer -vo fbdev -fs -zoom 1>/dev/null -xy 2'
> -    'fb3' '=mplayer -vo fbdev -fs  -zoom 1>/dev/null -xy 3'
> +    'fb2' '=mplayer -vo fbdev -fs -zoom 1>/dev/null -xy 2 '
> +    'fb3' '=mplayer -vo fbdev -fs  -zoom 1>/dev/null -xy 3 '
>      'ci' 'centericq'
>      'D'  'export DISPLAY=:0.0'
> -    'mp' 'mplayer -vo xv -fs -zoom'
> +    'mp' 'mplayer -vo xv -fs -zoom '

A variation of my previous arguments apply to these, too.

Why did we do that again?
The only reason I see would be to be able to expand aliases at will.
Then again: are we adding new aliases to this list? Did we do it in
the past, after we got this expansion? Can't compsys's _expand do
something like that for us?

Maybe I'm missing something. I don't use that feature at all. So
correct me if I'm wrong.

Regards, Frank

----------
files: 0001-zshrc-Add-a-trailing-space-for-several-power-comple.patch, 0002-zshrc-Disordered-argument-list-in-MPlayer-s-power-c.patch
messages: 1805, 1806, 1807
nosy: ft, mika, z3ttacht
priority: feature
status: chatting
title: grml-etc-core: Adding trainling spaces to various power completions.
topic: grml-etc-core, just ideas, zsh

_____________________________________
GRML issue tracker <bts at bts.grml.org>
<http://bts.grml.org/grml/issue616>
_____________________________________


More information about the Bugs-changes mailing list