unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#508: emacs 22.2.1 becomes confused
@ 2008-06-30 15:03 ` Bruce Korb
  2008-07-31 21:25   ` bug#508: marked as done (emacs 22.2.1 becomes confused) Emacs bug Tracking System
  0 siblings, 1 reply; 14+ 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] 14+ 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; 14+ 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] 14+ 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; 14+ 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] 14+ 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; 14+ 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] 14+ 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; 14+ 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] 14+ 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; 14+ 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] 14+ 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; 14+ 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] 14+ 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; 14+ 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] 14+ 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; 14+ 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] 14+ 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; 14+ 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] 14+ 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; 14+ 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] 14+ 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; 14+ 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] 14+ 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; 14+ 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] 14+ messages in thread

* bug#508: marked as done (emacs 22.2.1 becomes confused)
  2008-06-30 15:03 ` bug#508: emacs 22.2.1 becomes confused Bruce Korb
@ 2008-07-31 21:25   ` Emacs bug Tracking System
  0 siblings, 0 replies; 14+ messages in thread
From: Emacs bug Tracking System @ 2008-07-31 21:25 UTC (permalink / raw)
  To: Chong Yidong

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]


Your message dated Thu, 31 Jul 2008 17:17:07 -0400
with message-id <87iquleoto.fsf@stupidchicken.com>
and subject line Re: bug#508: emacs 22.2.1 becomes confused
has caused the Emacs bug report #508,
regarding emacs 22.2.1 becomes confused
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)


-- 
508: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=508
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3842 bytes --]

From: "Bruce Korb" <bruce.korb@gmail.com>
To: bug-gnu-emacs@gnu.org
Cc: "Bruce Korb" <bkorb@gnu.org>
Subject: emacs 22.2.1 becomes confused
Date: Mon, 30 Jun 2008 08:03:12 -0700
Message-ID: <668c430c0806300803o222328cdr6505dcbb5165c817@mail.gmail.com>

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.




[-- Attachment #3: Type: message/rfc822, Size: 1335 bytes --]

From: Chong Yidong <cyd@stupidchicken.com>
To: 508-done@emacsbugs.donarmstrong.com
Subject: Re: bug#508: emacs 22.2.1 becomes confused
Date: Thu, 31 Jul 2008 17:17:07 -0400
Message-ID: <87iquleoto.fsf@stupidchicken.com>

Since no one has offered to write a directory-case-sensitive-p function,
I've checked in Sven's first, simpler patch.  Even if it doesn't do the
completely right thing in the failure case (e.g., a vfat home directory
on GNU/Linux), all that does is fail to replace $HOME with ~, which is
hardly fatal.

After the release, if someone wants to write directory-case-sensitive-p,
we can switch to that.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-07-31 21:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87iquleoto.fsf@stupidchicken.com>
2008-06-30 15:03 ` bug#508: emacs 22.2.1 becomes confused Bruce Korb
2008-07-31 21:25   ` bug#508: marked as done (emacs 22.2.1 becomes confused) Emacs bug Tracking System
     [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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).