unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* bug with automount-dir-prefix handling in abbreviate-file-name
@ 2009-08-06 16:35 Ami Fischman
  2009-08-06 16:58 ` Andreas Schwab
  2009-08-06 18:09 ` Stefan Monnier
  0 siblings, 2 replies; 8+ messages in thread
From: Ami Fischman @ 2009-08-06 16:35 UTC (permalink / raw)
  To: emacs-devel

The default value of automount-dir-prefix is "^/tmp_mnt/" implying
that the prefix should have a trailing slash.  But using "^/home/" as
the prefix such as in:
(let ((automount-dir-prefix "^/home/"))
  (find-file "~/"))
results in an error:

Debugger entered--Lisp error: (file-error "Setting current directory"
"no such file or directory" "/fischman/")
  call-process("ls" nil t nil "--dired" "-al" "--" "/fischman/.")
  apply(call-process "ls" nil t nil ("--dired" "-al" "--" "/fischman/."))
  insert-directory("/fischman/" "--dired -al" nil t)
  dired-insert-directory("/fischman/" "-al" nil nil t)
  dired-readin-insert()
  dired-readin()
  dired-internal-noselect("/fischman/" nil)
  dired-noselect("~/")
  run-hook-with-args-until-success(dired-noselect "~/")
  find-file-noselect("~/" nil nil nil)
  find-file("~/")
  (let ((automount-dir-prefix "^/home/")) (find-file "~/"))
  eval((let ((automount-dir-prefix "^/home/")) (find-file "~/")))
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)

The error is caused by abbreviate-file-name stripping /home from /home/fischman.

Removing the trailing slash like this:
(let ((automount-dir-prefix "^/home"))
  (find-file "~/"))
works fine (brings up a dired buffer containing my homedir).

This is all with emacs 23.1 started as "emacs -Q".  The same behavior
occurs in 22.1.1 and 21.4.1.

-a




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

* Re: bug with automount-dir-prefix handling in abbreviate-file-name
  2009-08-06 16:35 bug with automount-dir-prefix handling in abbreviate-file-name Ami Fischman
@ 2009-08-06 16:58 ` Andreas Schwab
  2009-08-06 17:07   ` Ami Fischman
  2009-08-06 18:09 ` Stefan Monnier
  1 sibling, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2009-08-06 16:58 UTC (permalink / raw)
  To: Ami Fischman; +Cc: emacs-devel

Ami Fischman <ami@fischman.org> writes:

> The error is caused by abbreviate-file-name stripping /home from /home/fischman.

Which is exactly the point of automount-dir-prefix.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




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

* Re: bug with automount-dir-prefix handling in abbreviate-file-name
  2009-08-06 16:58 ` Andreas Schwab
@ 2009-08-06 17:07   ` Ami Fischman
  0 siblings, 0 replies; 8+ messages in thread
From: Ami Fischman @ 2009-08-06 17:07 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: emacs-devel

Are you saying that everything is working as intended, or are you
saying that abbreviate-file-name's behavior is as expected, but that
the find-file failure is a bug?

The only reason I mentioned abbreviate-file-name was to point out
where in the backtrace the directory name became unusable.  It still
seems like a bug to me that this results in an error.

Perhaps a clearer demonstration of what I think the problem is is to
use the default values:
sudo mkdir -p /tmp_mnt/fooblah
emacs -Q
C-x C-f /tmp_mnt/fooblah/
results in the message:
apply: Setting current directory: no such file or directory, /fooblah/
and no dired buffer.

-a


On Thu, Aug 6, 2009 at 9:58 AM, Andreas Schwab<schwab@linux-m68k.org> wrote:
> Ami Fischman <ami@fischman.org> writes:
>
>> The error is caused by abbreviate-file-name stripping /home from /home/fischman.
>
> Which is exactly the point of automount-dir-prefix.
>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
>




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

* Re: bug with automount-dir-prefix handling in abbreviate-file-name
  2009-08-06 16:35 bug with automount-dir-prefix handling in abbreviate-file-name Ami Fischman
  2009-08-06 16:58 ` Andreas Schwab
@ 2009-08-06 18:09 ` Stefan Monnier
  2009-08-06 18:39   ` Ami Fischman
  1 sibling, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2009-08-06 18:09 UTC (permalink / raw)
  To: Ami Fischman; +Cc: emacs-devel

> The default value of automount-dir-prefix is "^/tmp_mnt/" implying
> that the prefix should have a trailing slash.  But using "^/home/" as
> the prefix such as in:
> (let ((automount-dir-prefix "^/home/"))
>   (find-file "~/"))
> results in an error:

¿¡¿Why would you want to set automount-dir-prefix to such a value?!?

I think you're confused.  Most likely you don't need
automount-dir-prefix (few people use automounters nowadays, and all
automounters I know don't use anything like the /tmp_mnt used back
then).  If you've accidentally used a directory named /tmp_mnt, then I'd
suggest you set automount-dir-prefix to something harmless like "\\'a".


        Stefan




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

* Re: bug with automount-dir-prefix handling in abbreviate-file-name
  2009-08-06 18:09 ` Stefan Monnier
@ 2009-08-06 18:39   ` Ami Fischman
  2009-08-07  4:45     ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Ami Fischman @ 2009-08-06 18:39 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Me being confused is a very likely possibility.

Many people still use automounters in corporate and academic
environments, where /home is likely an NFS automounter that makes
people's home directories available on demand from any machine they
happen to log onto, on a potentially worldwide network.  Latency in
such a network can be significant enough to be a real annoyance.

I started using automount-dir-prefix a while ago (~1 year?) because it
solved a particular problem: various emacs packages walk up the
directory tree searching for specific files and directories (things
like project settings, aka dir-locals-file).  Before adding
automount-dir-prefix, this would result in emacs speculatively asking
the NFS server about the existence of paths like /home/.dir-locals.el,
which could take several seconds to complete (the automounter may
consider mounting directories all over the world to satisfy various
requests).  Adding the path to automount-dir-prefix made these
annoying periodic pauses go away.  Looking at the current files.el
now, it looks like locate-dominating-file may have been reimplemented
to deal with this issue precisely, using
locate-dominating-stop-dir-regexp.  In fact it looks like you're the
one who did it (http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=db8475d9dd2b674318c88e8dc09da3549596bd5d).
 Thanks!

I suspect that automount-dir-prefix was meant to address some other
problem that possibly manifested only in older automounters, but I've
been unable to find evidence to back this up.  Can you explain more
explicitly what that behavior was and what the variable is actually
meant to do?

Cheers,
-a

On Thu, Aug 6, 2009 at 11:09 AM, Stefan Monnier<monnier@iro.umontreal.ca> wrote:
>> The default value of automount-dir-prefix is "^/tmp_mnt/" implying
>> that the prefix should have a trailing slash.  But using "^/home/" as
>> the prefix such as in:
>> (let ((automount-dir-prefix "^/home/"))
>>   (find-file "~/"))
>> results in an error:
>
> ¿¡¿Why would you want to set automount-dir-prefix to such a value?!?
>
> I think you're confused.  Most likely you don't need
> automount-dir-prefix (few people use automounters nowadays, and all
> automounters I know don't use anything like the /tmp_mnt used back
> then).  If you've accidentally used a directory named /tmp_mnt, then I'd
> suggest you set automount-dir-prefix to something harmless like "\\'a".
>
>
>        Stefan
>




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

* Re: bug with automount-dir-prefix handling in abbreviate-file-name
  2009-08-06 18:39   ` Ami Fischman
@ 2009-08-07  4:45     ` Stefan Monnier
  2009-08-07  8:54       ` Andreas Schwab
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2009-08-07  4:45 UTC (permalink / raw)
  To: Ami Fischman; +Cc: emacs-devel

> I suspect that automount-dir-prefix was meant to address some other
> problem that possibly manifested only in older automounters, but I've
> been unable to find evidence to back this up.  Can you explain more
> explicitly what that behavior was and what the variable is actually
> meant to do?

automount-dir-prefix was designed for automounters that didn't benefit
from as good kernel suppport as is available nowadays, so in order to
automount /foo/bar, they mounted it onto /tmp_mnt/foo/bar and then made
/foo/bar a symlink to it.


        Stefan




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

* Re: bug with automount-dir-prefix handling in abbreviate-file-name
  2009-08-07  4:45     ` Stefan Monnier
@ 2009-08-07  8:54       ` Andreas Schwab
  2009-08-07 14:20         ` Ami Fischman
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2009-08-07  8:54 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Ami Fischman, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> automount-dir-prefix was designed for automounters that didn't benefit
> from as good kernel suppport as is available nowadays, so in order to
> automount /foo/bar, they mounted it onto /tmp_mnt/foo/bar and then made
> /foo/bar a symlink to it.

There is also directory-abbrev-alist, which can handle this case as
well, allowing to have more than one such transformation.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




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

* Re: bug with automount-dir-prefix handling in abbreviate-file-name
  2009-08-07  8:54       ` Andreas Schwab
@ 2009-08-07 14:20         ` Ami Fischman
  0 siblings, 0 replies; 8+ messages in thread
From: Ami Fischman @ 2009-08-07 14:20 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Stefan Monnier, emacs-devel

Thanks for the details.  It might make sense to expand the
documentation of automount-dir-prefix to be more explicit about what
kind of automounters it is/was meant for.

-a

On Fri, Aug 7, 2009 at 1:54 AM, Andreas Schwab<schwab@linux-m68k.org> wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>> automount-dir-prefix was designed for automounters that didn't benefit
>> from as good kernel suppport as is available nowadays, so in order to
>> automount /foo/bar, they mounted it onto /tmp_mnt/foo/bar and then made
>> /foo/bar a symlink to it.
>
> There is also directory-abbrev-alist, which can handle this case as
> well, allowing to have more than one such transformation.
>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
>




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

end of thread, other threads:[~2009-08-07 14:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-06 16:35 bug with automount-dir-prefix handling in abbreviate-file-name Ami Fischman
2009-08-06 16:58 ` Andreas Schwab
2009-08-06 17:07   ` Ami Fischman
2009-08-06 18:09 ` Stefan Monnier
2009-08-06 18:39   ` Ami Fischman
2009-08-07  4:45     ` Stefan Monnier
2009-08-07  8:54       ` Andreas Schwab
2009-08-07 14:20         ` Ami Fischman

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).