From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3) with ESMTP id SAA12970 for ; Tue, 14 May 1996 18:58:56 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id EAA08416; Tue, 14 May 1996 04:40:28 -0400 (EDT) Resent-Date: Tue, 14 May 1996 04:40:28 -0400 (EDT) From: Zefram Message-Id: <14870.199605140839@stone.dcs.warwick.ac.uk> Subject: Re: Stripping superfluous spaces in command input To: wayne@tenor.clarinet.com (Wayne Davison) Date: Tue, 14 May 1996 09:39:50 +0100 (BST) Cc: zsh-workers@math.gatech.edu In-Reply-To: <199605140042.RAA05789@tenor.clari.net> from "Wayne Davison" at May 13, 96 05:42:05 pm X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]7501.80 X-US-Congress: Moronic fuckers MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"qJugj2.0.Q32.xR4cn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1067 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu >Is anyone planning to add an option that will strip trailing and unquoted >extra spaces from zle input? If not, I'd appreciate a hint how best to >go about it. I think I would like to add the stripping to the zleread() >function, but I'm not sure what functions are available to help me find >the next token on the line so that I only eliminate superfluous spaces. There's the lexer, but the interface is not well suited to this purpose. It's not terribly well suited to most of zle_tricky.c, either. I'm considering making large changes in that area (including maybe having ZLE actually ask the parser what the command and arguments are, rather than using its quite badly flawed guesswork). At that point such an option should become easier to implement. Or there's an alternative way: use the existing functions to generate a textual representation of the parsed line. This isn't really usable for this purpose at present, as it will reorder bits of the command line and so on. Actually someone should really go through that code in detail sometime, and make sure its representation really is accurate, particularly taking metafication issues into consideration. -zefram