Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Capitalization tuning



Mikael:
  the double substitution method you provided below works well.  

zsh-developers:
  I would be willing to write a new or modify the existing expansion flag code for
  (C) capitalize,  so that it would use an array or list of word separators, which
  a user could set, or allow the users to supply a word seperator list list
  s:separator-list: for example, for filenames I usually always, s/ /_/ , get rid
  of spaces in names, which apparently the existing C flags treats write as a space.

  I have never looked at the source code.  But, there's always a first time.  If someone would lead to where the 'c' parameter expansion flag processing done, I'd look at it.  If it has too many interactions with other code, I'd leave it be as it might n
ot be worth the effort.  Any ideas?

Thanks,
  darel henman


Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> 2008/8/31  <henman@xxxxxxxxxxxxxxxx>:
> ......
> > The problem with the current operation of the Capitalization function is that it capitalizes the first letter of conjunction tails as well.
> >
> > For example:
> >     $ CONJUNCT="I'll" && echo ${(C)CONJUNCT}
> >     I'Ll
> >     $CONJUNCT="They've" && echo ${(C)CONJUNCT}
> >     They'Ve
> >
> > ....
> 
> This is possibly not the best, or even a good, way, but it seems to work:
> ${${(C)${CONJUNCT//\'/\'1}}//\'1/\'}
> 
> -- 
> Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author