bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#550: 23.0.60; A case where file-truename ignores case on w32


From: Lennart Borgman (gmail)
Subject: bug#550: 23.0.60; A case where file-truename ignores case on w32
Date: Sat, 12 Jul 2008 00:46:49 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Jason Rumney wrote:
Lennart Borgman (gmail) wrote:
I got a bug report from a user concerning nXhtml. The problem seems to
be that Emacs ignores case in an existing directory name.

Only when the file does not exist. In that case, w32-long-file-name
returns nil and the original string that was passed in to file-truename
is used. The solution is probably to recursively descend the directory
heirarchy until we find a directory that exists, and call
w32-long-file-name on that.

I suggest replacing

  (or (w32-long-file-name filename) filename)))

in `true-filename' with

  (let ((w32-filename (w32-long-file-name filename))
        (root filename)
        w32-root)
    (while (not w32-filename)
      (when (eq ?/ (car (last (append root nil))))
        (setq root (substring root 0 -1)))
      (setq root (file-name-directory root))
      (if (not root)
          (setq w32-filename filename)
        (setq w32-root (w32-long-file-name root))
        (when w32-root
          (setq w32-filename
                (concat w32-root
                        (substring filename (length w32-root)))))))
    w32-filename)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]