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

Re: :r modifier



>>> "Bart" == Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx> writes:

[...]

 Bart> You're assuming that :r is used exclusively on unix
 Bart> file-paths and should employ unix file-path semantics,

Right, I'm shortsighted (didn't think at all about the 
non-unix world -- does it *really* exist? :o)).

 Bart> but parameter values are just strings.

But these modifers are somewhat useless on strings which are not
filenames, aren't they?  :h and :t are documented to works on
`pathnames'; my wish is to document :e and :r as working on
`filename extesions'.

 Bart> Suppose we change it to pay attention to slashes.  Does
 Bart> that mean that on cygwin it should also pay attention to
 Bart> backslashes?

I'd say yes: stick to the filename definition used on the host
whenever possible. (Here I'm feeling that I ask too much!)

 Bart> :Do we need to teach :h/:t about the leading-double-slash
 Bart> convention for some networked file systems?

I don't know, I never seen such file systems.  But I'm already 
confused by the current behiavor of :h on repeated slashes:

  % x=abc///def
  % echo $x:h
  abc//
  % echo $x:h:h
  abc/

(My dream is that repeated slashes would be treated as a single
slash; but I'm probably again assuming filesystem specific convention)

[...]

-- 
Alexandre Duret-Lutz



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