* bug#508: emacs 22.2.1 becomes confused
@ 2008-06-30 15:03 Bruce Korb
0 siblings, 0 replies; 13+ messages in thread
From: Bruce Korb @ 2008-06-30 15:03 UTC (permalink / raw
To: bug-gnu-emacs; +Cc: Bruce Korb
Hi,
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". Someone please be kind enough to find that
"strncasecmp" and replace it with "strncmp" and put out an emergency fix.
Thank you. Regards, Bruce
$ /usr/bin/emacs --version
GNU Emacs 22.2.1
Copyright (C) 2008 Free Software Foundation, Inc.
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#508: emacs 22.2.1 becomes confused
[not found] <mailman.14013.1214839638.18990.bug-gnu-emacs@gnu.org>
@ 2008-06-30 17:53 ` Sven Joachim
2008-06-30 18:12 ` Bruce Korb
2008-06-30 19:57 ` Eli Zaretskii
0 siblings, 2 replies; 13+ messages in thread
From: Sven Joachim @ 2008-06-30 17:53 UTC (permalink / raw
To: Bruce Korb; +Cc: 508
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@gmx.de>
* files.el (abbreviate-file-name): Match the home directory
case-sensitively on systems that have case-sensitive filesystems.
Regards,
Sven
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#508: emacs 22.2.1 becomes confused
2008-06-30 17:53 ` bug#508: emacs 22.2.1 becomes confused Sven Joachim
@ 2008-06-30 18:12 ` Bruce Korb
2008-06-30 20:01 ` Eli Zaretskii
2008-06-30 19:57 ` Eli Zaretskii
1 sibling, 1 reply; 13+ messages in thread
From: Bruce Korb @ 2008-06-30 18:12 UTC (permalink / raw
To: Sven Joachim; +Cc: 508
On Mon, Jun 30, 2008 at 10:53 AM, Sven Joachim <svenjoac@gmx.de> wrote:
> 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?
Sure, but given you reproduced the problem and that this fixed it
for you, I'm guessing it will work. Now, where does this file live?
I know I can find it if I look hard enough, but the easy search
only yielded /usr/share/emacs/22.2/lisp/files.elc
Thanks - Bruce
> --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---
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#508: emacs 22.2.1 becomes confused
2008-06-30 17:53 ` bug#508: emacs 22.2.1 becomes confused Sven Joachim
2008-06-30 18:12 ` Bruce Korb
@ 2008-06-30 19:57 ` Eli Zaretskii
2008-06-30 20:14 ` Sven Joachim
1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2008-06-30 19:57 UTC (permalink / raw
To: Sven Joachim, 508; +Cc: bug-gnu-emacs, bruce.korb
> From: Sven Joachim <svenjoac@gmx.de>
> Date: Mon, 30 Jun 2008 19:53:51 +0200
> Cc: 508@emacsbugs.donarmstrong.com
>
> + (case-fold-search
> + (if (memq system-type '(ms-dos windows-nt darwin macos vax-vms axp-vms))
You forgot cygwin in this list.
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#508: emacs 22.2.1 becomes confused
2008-06-30 18:12 ` Bruce Korb
@ 2008-06-30 20:01 ` Eli Zaretskii
0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2008-06-30 20:01 UTC (permalink / raw
To: Bruce Korb, 508; +Cc: bug-gnu-emacs, svenjoac
> Date: Mon, 30 Jun 2008 11:12:57 -0700
> From: "Bruce Korb" <bruce.korb@gmail.com>
> Cc: 508@emacsbugs.donarmstrong.com
>
> On Mon, Jun 30, 2008 at 10:53 AM, Sven Joachim <svenjoac@gmx.de> wrote:
> > 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?
>
> Sure, but given you reproduced the problem and that this fixed it
> for you, I'm guessing it will work. Now, where does this file live?
> I know I can find it if I look hard enough, but the easy search
> only yielded /usr/share/emacs/22.2/lisp/files.elc
You probably didn't installed the Lisp sources. But don't hurry to do
that yet: files.el is preloaded into Emacs, so to make that change you
will have to rebuild Emacs, not just patch files.el.
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#508: emacs 22.2.1 becomes confused
2008-06-30 19:57 ` Eli Zaretskii
@ 2008-06-30 20:14 ` Sven Joachim
2008-06-30 20:30 ` Lennart Borgman (gmail)
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Sven Joachim @ 2008-06-30 20:14 UTC (permalink / raw
To: Eli Zaretskii; +Cc: bruce.korb, 508
On 2008-06-30 21:57 +0200, Eli Zaretskii wrote:
>> From: Sven Joachim <svenjoac@gmx.de>
>> Date: Mon, 30 Jun 2008 19:53:51 +0200
>> Cc: 508@emacsbugs.donarmstrong.com
>>
>> + (case-fold-search
>> + (if (memq system-type '(ms-dos windows-nt darwin macos vax-vms axp-vms))
>
> You forgot cygwin in this list.
I just pasted the list from the read-file-name-completion-ignore-case
defcustom in minibuffer.el. Should that list include cygwin as well?
Sven
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#508: emacs 22.2.1 becomes confused
2008-06-30 20:14 ` Sven Joachim
@ 2008-06-30 20:30 ` Lennart Borgman (gmail)
2008-07-01 3:00 ` Eli Zaretskii
2008-07-01 2:58 ` Eli Zaretskii
` (2 subsequent siblings)
3 siblings, 1 reply; 13+ messages in thread
From: Lennart Borgman (gmail) @ 2008-06-30 20:30 UTC (permalink / raw
To: Sven Joachim, 508; +Cc: bruce.korb
Sven Joachim wrote:
> On 2008-06-30 21:57 +0200, Eli Zaretskii wrote:
>
>>> From: Sven Joachim <svenjoac@gmx.de>
>>> Date: Mon, 30 Jun 2008 19:53:51 +0200
>>> Cc: 508@emacsbugs.donarmstrong.com
>>>
>>> + (case-fold-search
>>> + (if (memq system-type '(ms-dos windows-nt darwin macos vax-vms axp-vms))
>> You forgot cygwin in this list.
>
> I just pasted the list from the read-file-name-completion-ignore-case
> defcustom in minibuffer.el. Should that list include cygwin as well?
Shouldn't these things be defsubt so that it easier to change and maintain?
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#508: emacs 22.2.1 becomes confused
2008-06-30 20:14 ` Sven Joachim
2008-06-30 20:30 ` Lennart Borgman (gmail)
@ 2008-07-01 2:58 ` Eli Zaretskii
2008-07-01 3:56 ` Kevin Rodgers
[not found] ` <mailman.14056.1214885238.18990.bug-gnu-emacs@gnu.org>
3 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2008-07-01 2:58 UTC (permalink / raw
To: Sven Joachim; +Cc: bruce.korb, 508
> From: Sven Joachim <svenjoac@gmx.de>
> Cc: 508@emacsbugs.donarmstrong.com, bruce.korb@gmail.com
> Date: Mon, 30 Jun 2008 22:14:02 +0200
>
> On 2008-06-30 21:57 +0200, Eli Zaretskii wrote:
>
> >> From: Sven Joachim <svenjoac@gmx.de>
> >> Date: Mon, 30 Jun 2008 19:53:51 +0200
> >> Cc: 508@emacsbugs.donarmstrong.com
> >>
> >> + (case-fold-search
> >> + (if (memq system-type '(ms-dos windows-nt darwin macos vax-vms axp-vms))
> >
> > You forgot cygwin in this list.
>
> I just pasted the list from the read-file-name-completion-ignore-case
> defcustom in minibuffer.el. Should that list include cygwin as well?
Yes, I think so.
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#508: emacs 22.2.1 becomes confused
2008-06-30 20:30 ` Lennart Borgman (gmail)
@ 2008-07-01 3:00 ` Eli Zaretskii
0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2008-07-01 3:00 UTC (permalink / raw
To: Lennart Borgman (gmail); +Cc: bruce.korb, 508, svenjoac
> Date: Mon, 30 Jun 2008 22:30:03 +0200
> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
> CC: Eli Zaretskii <eliz@gnu.org>, bruce.korb@gmail.com
>
> Sven Joachim wrote:
> > On 2008-06-30 21:57 +0200, Eli Zaretskii wrote:
> >
> >>> From: Sven Joachim <svenjoac@gmx.de>
> >>> Date: Mon, 30 Jun 2008 19:53:51 +0200
> >>> Cc: 508@emacsbugs.donarmstrong.com
> >>>
> >>> + (case-fold-search
> >>> + (if (memq system-type '(ms-dos windows-nt darwin macos vax-vms axp-vms))
> >> You forgot cygwin in this list.
> >
> > I just pasted the list from the read-file-name-completion-ignore-case
> > defcustom in minibuffer.el. Should that list include cygwin as well?
>
>
> Shouldn't these things be defsubt so that it easier to change and maintain?
I'm not sure I understand what you are suggesting. Please explain.
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#508: emacs 22.2.1 becomes confused
2008-06-30 20:14 ` Sven Joachim
2008-06-30 20:30 ` Lennart Borgman (gmail)
2008-07-01 2:58 ` Eli Zaretskii
@ 2008-07-01 3:56 ` Kevin Rodgers
[not found] ` <mailman.14056.1214885238.18990.bug-gnu-emacs@gnu.org>
3 siblings, 0 replies; 13+ messages in thread
From: Kevin Rodgers @ 2008-07-01 3:56 UTC (permalink / raw
To: bug-gnu-emacs
Sven Joachim wrote:
> On 2008-06-30 21:57 +0200, Eli Zaretskii wrote:
>
>>> From: Sven Joachim <svenjoac@gmx.de>
>>> Date: Mon, 30 Jun 2008 19:53:51 +0200
>>> Cc: 508@emacsbugs.donarmstrong.com
>>>
>>> + (case-fold-search
>>> + (if (memq system-type '(ms-dos windows-nt darwin macos vax-vms axp-vms))
>> You forgot cygwin in this list.
>
> I just pasted the list from the read-file-name-completion-ignore-case
> defcustom in minibuffer.el.
Why not bind case-fold-search to the value of
read-file-name-completion-ignore-case there?
> Should that list include cygwin as well?
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#508: emacs 22.2.1 becomes confused
[not found] ` <mailman.14056.1214885238.18990.bug-gnu-emacs@gnu.org>
@ 2008-07-01 6:28 ` Sven Joachim
2008-07-03 4:54 ` Stefan Monnier
0 siblings, 1 reply; 13+ messages in thread
From: Sven Joachim @ 2008-07-01 6:28 UTC (permalink / raw
To: Kevin Rodgers; +Cc: 508
On 2008-07-01 05:56 +0200, Kevin Rodgers wrote:
> Sven Joachim wrote:
>> On 2008-06-30 21:57 +0200, Eli Zaretskii wrote:
>>
>>>> From: Sven Joachim <svenjoac@gmx.de>
>>>> Date: Mon, 30 Jun 2008 19:53:51 +0200
>>>> Cc: 508@emacsbugs.donarmstrong.com
>>>>
>>>> + (case-fold-search
>>>> + (if (memq system-type '(ms-dos windows-nt darwin macos vax-vms axp-vms))
>>> You forgot cygwin in this list.
>>
>> I just pasted the list from the read-file-name-completion-ignore-case
>> defcustom in minibuffer.el.
>
> Why not bind case-fold-search to the value of
> read-file-name-completion-ignore-case there?
That would be wrong, IMO. Users may or may not prefer filename
completion to be case sensitive regardless of their filesystems, but the
code in question really depends on the actual feature of the filesystem.
There could be a new defvar (or defconst), like this:
(defvar case-insensitive-systems-alist
'(ms-dos windows-nt cygwin darwin macos vax-vms axp-vms)
"List of systems who have case insensitive filesystems.")
which could then be used in code that depends on the filesystem being
case sensitive or not, and in the read-file-name-completion-ignore-case
defcustom as well.
Sven
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#508: emacs 22.2.1 becomes confused
2008-07-01 6:28 ` Sven Joachim
@ 2008-07-03 4:54 ` Stefan Monnier
2008-07-04 10:04 ` Eli Zaretskii
0 siblings, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2008-07-03 4:54 UTC (permalink / raw
To: Sven Joachim; +Cc: Kevin Rodgers, 508
> There could be a new defvar (or defconst), like this:
> (defvar case-insensitive-systems-alist
> '(ms-dos windows-nt cygwin darwin macos vax-vms axp-vms)
> "List of systems who have case insensitive filesystems.")
Actually, it should not be a variable but a function (and even
a file-name operation, obeying file-name-handlers):
(directory-case-sensitive-p FILE)
-- Stefan
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#508: emacs 22.2.1 becomes confused
2008-07-03 4:54 ` Stefan Monnier
@ 2008-07-04 10:04 ` Eli Zaretskii
0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2008-07-04 10:04 UTC (permalink / raw
To: Stefan Monnier, 508; +Cc: bug-gnu-emacs, kevin.d.rodgers, 508, svenjoac
> Resent-From: Stefan Monnier <monnier@iro.umontreal.ca>
> Resent-To: bug-submit-list@donarmstrong.com
> Resent-CC: Emacs Bugs <bug-gnu-emacs@gnu.org>
> Resent-Sender: don@donarmstrong.com
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Thu, 03 Jul 2008 00:54:57 -0400
> Cc: Kevin Rodgers <kevin.d.rodgers@gmail.com>, 508@emacsbugs.donarmstrong.com
>
> > There could be a new defvar (or defconst), like this:
>
> > (defvar case-insensitive-systems-alist
> > '(ms-dos windows-nt cygwin darwin macos vax-vms axp-vms)
> > "List of systems who have case insensitive filesystems.")
>
> Actually, it should not be a variable but a function (and even
> a file-name operation, obeying file-name-handlers):
>
> (directory-case-sensitive-p FILE)
100% agreement: with the proliferation of network-mounted filesystems,
there's no longer a deterministic way to infer whether a filesystem is
case-sensitive or not from the OS brand. Instead, we should query the
filesystem about that, and the function suggested by Stefan should do
that (when there're no file-name-handlers for the filesystem).
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2008-07-04 10:04 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.14013.1214839638.18990.bug-gnu-emacs@gnu.org>
2008-06-30 17:53 ` bug#508: emacs 22.2.1 becomes confused Sven Joachim
2008-06-30 18:12 ` Bruce Korb
2008-06-30 20:01 ` Eli Zaretskii
2008-06-30 19:57 ` Eli Zaretskii
2008-06-30 20:14 ` Sven Joachim
2008-06-30 20:30 ` Lennart Borgman (gmail)
2008-07-01 3:00 ` Eli Zaretskii
2008-07-01 2:58 ` Eli Zaretskii
2008-07-01 3:56 ` Kevin Rodgers
[not found] ` <mailman.14056.1214885238.18990.bug-gnu-emacs@gnu.org>
2008-07-01 6:28 ` Sven Joachim
2008-07-03 4:54 ` Stefan Monnier
2008-07-04 10:04 ` Eli Zaretskii
2008-06-30 15:03 Bruce Korb
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.