Loading ...
Sorry, an error occurred while loading the content.

RE: Win32 Short filenames - comments?

Expand Messages
  • Michael Geddes
    Ok, I ll fix it up, make sure it has doco. I wasn t realy convinced about :X either, but 1) :S might be useful for something else 2) :~ is already taken (sorry
    Message 1 of 6 , Oct 1, 2002
    • 0 Attachment
      Ok, I'll fix it up, make sure it has doco.

      I wasn't realy convinced about :X either, but
      1) :S might be useful for something else
      2) :~ is already taken (sorry Vince & Steve, that's home-directory
      expansion),

      I could used :8 I guess (for 8.3)

      I didn't choose :X very carefully, just a proof of concept, but
      1) it's way out of the way for any other further extensions to the
      syntax..
      2) secondly it matched the /X from DIR /X which is how you can view
      the short filenames in a prompt.


      Vince, Steve - what do you think - any votes?

      As to the other question - it shortens the whole path. That's what the
      API function does...

      I had to modify/optimise :~ and :. so that if the path had already been
      expanded (via :p or :X), then it wouldn't
      try expanding it again. Somebody will need to cast their eyes over that
      bit to make sure it handles everything correctly as far as memory
      allocation/deallocation. I think it's correct, but I'm not familiar
      enough with that code to do it.

      Is it OK to have the WinAPI function as it is? Or would you prefer me to
      wrap it in a mch_ wrapper? I guess it'd be
      nice if it worked across Samba shares from linux.


      //.

      -----Original Message-----
      From: Bram Moolenaar [mailto:Bram@...]
      Sent: Tuesday, 1 October 2002 7:13 PM
      To: Michael Geddes
      Cc: Vim-dev@...
      Subject: Re: Win32 Short filenames - comments?



      Michael Geddes wrote:

      > A call to win32 vimmers!
      >
      > I _have created_ a patch that adds a modifier which is currently :X
      > (from dir /x) that modifies the filename to be the windows short file
      > name.
      >
      > ie : expand('%:X')
      >
      > Would return the full short filename of the current file.
      > expand('%:X:.') also works (as does :~).

      Since this is just a small change and can be very useful for people who
      need this, I'm not against including this feature.

      Two questions:
      - Why ":X"? Isn't there a more obvious name to get the short filename?
      - Does this only shorten the last part of the path or also the directory
      names before it?

      --
      From "know your smileys":
      (X0||) Double hamburger with lettuce and tomato

      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net
      \\\
      /// Creator of Vim - Vi IMproved -- http://www.vim.org
      \\\
      \\\ Project leader for A-A-P -- http://www.a-a-p.org
      ///
      \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html
      ///
    • Vince Negri
      ... My gut instinct is to have a mch_ wrapper - more to keep API-specific code out of the generic base as much as possible. Vince Legal Disclaimer: Any views
      Message 2 of 6 , Oct 1, 2002
      • 0 Attachment
        > Is it OK to have the WinAPI function as it is? Or would you prefer me to
        > wrap it in a mch_ wrapper? I guess it'd be
        > nice if it worked across Samba shares from linux.

        My gut instinct is to have a mch_ wrapper - more to keep
        API-specific code out of the generic base as much as
        possible.

        Vince
        Legal Disclaimer: Any views expressed by the sender of this message are
        not necessarily those of Application Solutions Ltd. Information in this
        e-mail may be confidential and is for the use of the intended recipient
        only, no mistake in transmission is intended to waive or compromise such
        privilege. Please advise the sender if you receive this e-mail by mistake.
      Your message has been successfully submitted and would be delivered to recipients shortly.