Nikolai Weibull | 30 Sep 22:11

_history completion breaks history words containing spaces?

It seems that _history will give "Star\ " as a completion instead of
"Star\ Trek", given that "Star\ Trek" is in $historywords.  I see no
obvious way of fixing this.  Anyone have any suggestions?

Bart Schaefer | 29 Sep 20:05

Zsh CVS unavailable part of tomorrow

Most of you probably won't notice, but Sourceforge notified us:

On 2008-09-30 (Tuesday), project CVS service will be taken offline at 17:00
UTC for not more than 8 hours to permit the migration of service to the new
Chicago datacenter.On 2008-09-30 (Tuesday), project CVS service will be taken offline at 17:00
UTC for not more than 8 hours to permit the migration of service to the new
Chicago datacenter.

Rocky Bernstein | 28 Sep 21:16

Help me track down a tough bug? (probably funcfiletrace, subshells and possibly I/O redirection)

There is what looks to me a bug in the recent funcfiletrace that I've
been trying to isolate. I've spent the weekend on this and have made
some progress but have to stop now. Perhaps there's someone out there
who can help further pinpoint this bug.

You'll need the most recent zsh in CVS. If you have zshdb installed
(and chances are you don't) you can see the bug by
running this program under the debugger

#!/usr/local/bin/zsh
# Test debugger handling of subshells
(
    x=$(print 5; print 6)
)

Below I'll show output from a sample session using the debugger. I've
put comments to the side (in #) to try to explain what's going on.

$ zshdb -q /tmp/zshdb/testing.sh   # run testing.sh
(/tmp/zshdb/testing.sh:3):         # file and line number
( x=$(print 5; print 6) )          # What's going to get run next
zshdb<4> s                         # 's' issues a "step" command

(/tmp/zshdb/testing.sh:4):
x=$(print 5; print 6)              # Note we are in a subshell
zshdb<(5)> s                       # the () indicates this

(/tmp/zshdb/testing.sh:1):
print 5                            # In a 2nd subshell, backtick
zshdb<((7))> where                 # ((..)) indicates this.
(Continue reading)

Max Mikhanosha | 28 Sep 20:08

_expand completer with ignored-patterns and all-expansions

I'm in an directory with java sources, and I want to cvs update
**/build.xml.

cvs update **/build.xml<tab> 

I have it so that my completers are _expand then _complete, and first
choice it offers is a list of all the files, which is what I want, so
my choices are:

   1. bin/a/b/c/build.xml bin/d/e/f/build.xml a/b/c/build.xml d/e/f/build.xml
   2. bin/a/b/c/build.xml
   3. bin/d/e/f/build.xml
   4. a/b/c/build.xml
   5. d/e/f/build.xml
   6. foo/bar/build.xml

Pressing Enter on choice 1. leads to a quick realization that bin/
directory is not under version control, so whole cvs command fails
with unable to find CVS/Entries.

After doing:

zstyle ':completion:*expand*:*' ignored-patterns 'bin/*'

The choices offered are:

   1. a/b/c/build.xml
   2. d/e/f/build.xml
   3. foo/bar/build.xml

(Continue reading)

<(cat) doesn't work but =(cat) does ?

Hi,

when trying this:

	% ssh remotehost "transmission-remote -a <(cat)" < ~/torrent.file

I get this error:

	Couldn't read "/proc/self/fd/11": Not a regular file
	Couldn't add file: /proc/self/fd/11

However when using:

	% ssh remotehost "transmission-remote -a =(cat)" < ~/torrent.file

all is well.

Why doesn't the first form work?

Thanks,

Mikael Magnusson | 24 Sep 13:56

syntax error despite abort [Was: simplify and if then else]

2008/9/24 Mikael Magnusson <mikachu <at> gmail.com>:
> A bit longer but arguably still simpler :)
> cd /$([[ "$LOGNAME" != davidr ]] && echo o || echo c)/inetpub/wwdev/blabla

I wanted to try if you could use anonymous functions somehow to shorten
it a bit (probably not), but I encountered this
% function foo() { } hello syntax error
zsh: correct 'hello' to 'bell' [nyae]? a
zsh: parse error near `hello'
%

There is probably some explanation for why this is so, like there is for why
I have to use my mouse to cut and paste when there's a syntax error involving
some internal keywords, but maybe it's a simple bug that can be fixed? (hah)

--

-- 
Mikael Magnusson

zzapper | 24 Sep 13:18

simplify and if then else

Hi
Having a Homer Simpson moment, but this must be easy to simplify
if [[ "$LOGNAME" != davidr ]]
then
cd /o/inetpub/wwwdev/www.some.co.uk/epsystem/epadmin
else
cd /c/inetpub/wwwdev/www.some.co.uk/epsystem/epadmin
fi

--

-- 
zzapper
http://www.successtheory.com/tips/vimtips.html

Slim Joe | 21 Sep 04:22

Wildcard history search

I'm just wondering if zsh has a tcsh feature that I find very
convenient. It's the ability to search the history list using
wildcards. For example, I have issued the following commands:

[107] echo brown is the fox
brown is the fox
[108] echo the fox is brown
the fox is brown

In order to match [107] without going through [108], I only need to type:

[109] *x<Meta-P>

The "*x" will match the command containing the terminal word "fox"
[107] and not [108] which contains the word "fox" in the middle. To
explicitly match [108], I type "*n<Meta-P>", that is *{brow}n

Fancier combinations can exist like "??ho*<Meta-P>" which will match
{ec}ho{*} or "*{brown,fox}<Meta-P>" to math all commands the end with
either "brown" or "fox".

thomasg | 18 Sep 23:49

Append cancelled commands to history

Hello list,

I was curious if it's possible to append canceled (CTRL+C) commands to the histfile.
In case there is not yet a function to do this, is it generally possible to bind CTRL+C to a custom function?

Greetings,

thomasg
Oliver Paulus | 18 Sep 19:55

zsh completion problem

Hello,

I have developed svc-restart, svc-stop, etc. helper functions to call  
/etc/init.d scripts. Here is the configuration:

---conf start
function _c-getdaemons() {
            if [[ -r /etc/init.d ]] ; then
               local f
               for f in /etc/init.d/*(:t); _wanted module expl  
'daemons' compadd $f ;
            fi
}
if [[ -d /etc/init.d ]] ; then
     for i in svc-start svc-restart svc-stop svc-force-reload svc-reload ; do
         eval "function $i() {
                 $SUDO /etc/init.d/\$1 ${i/#svc-/}
         }";
         compdef _c-getdaemons $i
     done
fi
---end

Now my problem: If I call zsh the first time I do not get the right  
completion. I type "svc-restart <TAB>" and I get the "files"  
completion. If I "reload" zsh - and try it again I get the "daemons"  
completion I have defined. Here is the reload function I use:

---conf start
function reload() {
         if [[ "$#*" -eq 0 ]]; then
                 test -r /etc/zsh/zsh-oli && . /etc/zsh/zsh-oli
                 test -r ~/.zshrc && . ~/.zshrc
                 return 0
         else
                 local fn
                 for fn in $*; do
                    unfunction $fn
                    autoload -U $fn
                 done
         fi
}
compdef _functions reload
---end

--
Oliver Paulus

OpenPGP
Key id: 28D9C44F
Fingerprint: EADA 62FC 07DC 3361 A3D6  4174 2DE3 C027 28D9 C44F
Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x28D9C44F
_________________________________________________________________________
In 5 Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalten! 
Nur 3,99 EUR/Monat! http://www.maildomain.web.de/?mc=021114

Rocky Bernstein | 18 Sep 04:59

using history in a command processor

I'm writing basically a command processor and want to use the zsh history mechanism for that. I see that using fc I can read a history file and write it, but how do I put those commands in the history that I want? Right now I'm using vared when in an interactive terminal and read when not. But after reading I do a check on the command. The input might get changed a little and that's what I want to push onto the history.

Also, is there a way to delete an entry?

In other words, what I'm looking for is an equivalent to what in bash  is  "history -s"

Thanks.

Gmane