zsh-workers
 help / color / mirror / code / Atom feed
* Shell-word splitting (was: Re: Proposed _history completer)
@ 2000-05-02  8:31 Sven Wischnowsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 2000-05-02  8:31 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Apr 28,  9:20am, Sven Wischnowsky wrote:
> }
> } Bart Schaefer wrote:
> } 
> } > I think having a way to chop a string into shell words -- something like
> } > what you did for copy-prev-shell-word -- would be more effective.
> } 
> } [...] some parameter flag, most likely. Hm, s and S are taken,
> } so are c and C. We could use `=' but that would probably be too
> } irritating.
> 
> Hrm.  How would a parameter flag do this on an array?  Parse each word
> separately?

I wrote this at the weekend (quite simple) and, yes, it just split the 
array's elements separately and then returned an array with all words
from all elements.

> Hrm, again; maybe the way to do this is with a modifier rather than a
> flag.  :S is available, and it'd be kinda fun to be able to apply this
> to history as well as to parameters.  Or maybe it wouldn't ...

I'm withholding the patch I have because of this. I'll check how
difficult this is to implement, but I guess it's equally simple.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

* Re: Shell-word splitting (was: Re: Proposed _history completer)
  2000-05-03  7:16 Sven Wischnowsky
@ 2000-05-03 10:55 ` Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2000-05-03 10:55 UTC (permalink / raw)
  To: zsh-workers

On May 3,  9:16am, Sven Wischnowsky wrote:
} Subject: Re: Shell-word splitting (was: Re: Proposed _history completer)
}
} > Bart Schaefer wrote:
} > 
} > > Hrm, again; maybe the way to do this is with a modifier rather than a
} > > flag.  :S is available, and it'd be kinda fun to be able to apply this
} > > to history as well as to parameters.  Or maybe it wouldn't ...
} 
} I should have thought more about this yesterday...

So should I, apparently.

} Erm, the history modifier code only ever works on single words

Right.  Ah, well.  I still think a modifier might be less confusing than
a flag, particularly if we have to use a character like `=' for the flag,
but ...

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

* Re: Shell-word splitting (was: Re: Proposed _history completer)
@ 2000-05-03  7:16 Sven Wischnowsky
  2000-05-03 10:55 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Sven Wischnowsky @ 2000-05-03  7:16 UTC (permalink / raw)
  To: zsh-workers


I wrote:

> Bart Schaefer wrote:
> 
> > On Apr 28,  9:20am, Sven Wischnowsky wrote:
> > }
> > } Bart Schaefer wrote:
> > } 
> > } > I think having a way to chop a string into shell words -- something like
> > } > what you did for copy-prev-shell-word -- would be more effective.
> > } 
> > } [...] some parameter flag, most likely. Hm, s and S are taken,
> > } so are c and C. We could use `=' but that would probably be too
> > } irritating.
> > 
> > Hrm.  How would a parameter flag do this on an array?  Parse each word
> > separately?
> 
> I wrote this at the weekend (quite simple) and, yes, it just split the 
> array's elements separately and then returned an array with all words
> from all elements.
> 
> > Hrm, again; maybe the way to do this is with a modifier rather than a
> > flag.  :S is available, and it'd be kinda fun to be able to apply this
> > to history as well as to parameters.  Or maybe it wouldn't ...
> 
> I'm withholding the patch I have because of this. I'll check how
> difficult this is to implement, but I guess it's equally simple.

I should have thought more about this yesterday...

Erm, the history modifier code only ever works on single words
(getting one, modifying it, returning it). So what exactly are we
supposed to do with shell-word splitted history words in a history
expansion? I mean, what should we do with/insert for `!!:S'. This
would only be uesful if there was a way to access the words resulting
from the splitting, right? So, how are we supposed to access them (the 
history word-number code is executed before the modifier code)?

Or maybe I'm missing something (I don't use history expansion that
often any more).

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

end of thread, other threads:[~2000-05-03 10:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-02  8:31 Shell-word splitting (was: Re: Proposed _history completer) Sven Wischnowsky
2000-05-03  7:16 Sven Wischnowsky
2000-05-03 10:55 ` Bart Schaefer

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).