From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24507 invoked from network); 9 Sep 2004 15:17:05 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 9 Sep 2004 15:17:05 -0000 Received: (qmail 31013 invoked from network); 9 Sep 2004 15:16:59 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Sep 2004 15:16:59 -0000 Received: (qmail 5147 invoked by alias); 9 Sep 2004 15:16:48 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20343 Received: (qmail 5137 invoked from network); 9 Sep 2004 15:16:47 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 9 Sep 2004 15:16:47 -0000 Received: (qmail 29997 invoked from network); 9 Sep 2004 15:15:50 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 9 Sep 2004 15:15:49 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 6EDBD7004C; Thu, 9 Sep 2004 11:15:52 -0400 (EDT) Date: Thu, 9 Sep 2004 11:15:52 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Cc: 270632-submitter@bugs.debian.org Subject: Re: Bug#270632: zsh: Completion and spaces Message-ID: <20040909151552.GA21470@scowler.net> References: <20040908115321.GA2417@larve.net> <20040908180950.GC25987@scowler.net> <20040908194101.GD2775@larve.net> <20040908202633.GA3130@scowler.net> <20040908235639.GB6785@scowler.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6+20040722i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.0 required=6.0 tests=BAYES_44 autolearn=no version=2.63 X-Spam-Hits: -0.0 > Only that it always disables auto-suffix-removal. E.g., if $LBUFFER ends > in a slash which was added as a completion suffix, and the first character > of the word to be inserted is also a slash, then normally the suffix would > be deleted in order that the slash not become doubled; but with the work- > around, you get the double slash. That sounds like it's a purely cosmetic problem, but how about this for the zsh/parameter solution? Index: Functions/Zle/smart-insert-last-word =================================================================== RCS file: /cvsroot/zsh/zsh/Functions/Zle/smart-insert-last-word,v retrieving revision 1.2 diff -u -r1.2 smart-insert-last-word --- Functions/Zle/smart-insert-last-word 27 Jan 2003 16:41:17 -0000 1.2 +++ Functions/Zle/smart-insert-last-word 9 Sep 2004 15:14:21 -0000 @@ -35,13 +35,14 @@ # bindkey '\e=' insert-last-assignment emulate -L zsh +zmodload -i zsh/parameter || return 1 setopt extendedglob # Not strictly necessary: # (($+_ilw_hist)) || integer -g _ilw_hist _ilw_count _ilw_cursor _ilw_lcursor integer cursor=$CURSOR lcursor=$CURSOR -local lastcmd pattern numeric=$NUMERIC +local lastc lastcmd pattern numeric=$NUMERIC # Save state for repeated calls if (( HISTNO == _ilw_hist && cursor == _ilw_cursor )); then @@ -64,10 +65,8 @@ _ilw_hist=$HISTNO _ilw_count=$NUMERIC -zle .up-history || return 1 # Retrieve previous command -lastcmd=( ${${(z)BUFFER}:#\;} ) # Split into shell words -zle .down-history # Return to current command -CURSOR=$cursor # Restore cursor position +lastc="$history[$#history]" # Retrieve previous command +lastcmd=( ${${(z)lastc}:#\;} ) # Split into shell words NUMERIC=${numeric:-1} # In case of fall through (( NUMERIC > $#lastcmd )) && return 1