GNU bug report logs -
#508
emacs 22.2.1 becomes confused
Previous Next
Reported by: "Bruce Korb" <bruce.korb <at> gmail.com>
Date: Mon, 30 Jun 2008 15:10:04 UTC
Severity: normal
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
Full log
Message #10 received at 508 <at> emacsbugs.donarmstrong.com (full text, mbox):
On 2008-06-30 17:03 +0200, Bruce Korb wrote:
> I recently re-installed my system. For various reasons not worth
> going into here,
> I renamed my home directory from /home/foo to /home/Foo and re-created my
> "foo" user name. It is not possible to edit anything in the /home/Foo hierarchy
> with emacs. At all. I can cd to the correct directory and invoke "emacs file"
> and it will try to open the equivalently named file under /home/foo. Somebody
> somewhere fiddled some code such that tab-completion works correctly, but
> when it comes to actually "visiting" the file, the blasted thing substitutes
> "$HOME" for "/home/Foo".
This is with HOME=/home/foo, I suppose? Because when I tried to
reproduce it, I set $HOME to /home/Foo and files beneath /home/foo
became inaccessible.
> Someone please be kind enough to find that
> "strncasecmp" and replace it with "strncmp" and put out an emergency fix.
Actually, this is not a problem in the C code, but rather in Lisp, in
the function abbreviate-file-name.
The following patch tries to take care of this by matching the home
directory case-sensitively on systems which usually have such
filesystems, could you please test it?
--8<---------------cut here---------------start------------->8---
--- files.el.~1.985.~ 2008-06-11 07:54:21.000000000 +0200
+++ files.el 2008-06-30 19:37:37.000000000 +0200
@@ -1412,7 +1412,10 @@
(file-exists-p (file-name-directory
(substring filename (1- (match-end 0))))))
(setq filename (substring filename (1- (match-end 0)))))
- (let ((tail directory-abbrev-alist))
+ (let ((tail directory-abbrev-alist)
+ (case-fold-search
+ (if (memq system-type '(ms-dos windows-nt darwin macos vax-vms axp-vms))
+ t nil)))
;; If any elt of directory-abbrev-alist matches this name,
;; abbreviate accordingly.
(while tail
--8<---------------cut here---------------end--------------->8---
Changelog entry:
2008-06-30 Sven Joachim <svenjoac <at> gmx.de>
* files.el (abbreviate-file-name): Match the home directory
case-sensitively on systems that have case-sensitive filesystems.
Regards,
Sven
This bug report was last modified 16 years and 300 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.