zsh-workers
 help / color / mirror / code / Atom feed
* Stripping superfluous spaces in command input
@ 1996-05-14  0:42 Wayne Davison
  1996-05-14  8:39 ` Zefram
  0 siblings, 1 reply; 2+ messages in thread
From: Wayne Davison @ 1996-05-14  0:42 UTC (permalink / raw)
  To: Zsh hacking and development

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.

..wayne..



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Stripping superfluous spaces in command input
  1996-05-14  0:42 Stripping superfluous spaces in command input Wayne Davison
@ 1996-05-14  8:39 ` Zefram
  0 siblings, 0 replies; 2+ messages in thread
From: Zefram @ 1996-05-14  8:39 UTC (permalink / raw)
  To: Wayne Davison; +Cc: zsh-workers

>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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-05-14  8:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-05-14  0:42 Stripping superfluous spaces in command input Wayne Davison
1996-05-14  8:39 ` Zefram

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).