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

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

bug#4902: 23.1; directory-abbrev-alist is not handled early enough


From: David J. Biesack
Subject: bug#4902: 23.1; directory-abbrev-alist is not handled early enough
Date: Tue, 10 Nov 2009 16:29:36 -0500

> From: Stefan Monnier <address@hidden>
> CC: <address@hidden>
> Date: Tue, 10 Nov 2009 16:02:26 -0500
> 
> > For example, if the path /mount/somefile.x shows up in RMAIL
> > or in a source file, I want to do find-file-at-point 
> > on that path. When I do, Emacs tries to open c:/mount/somefile.x
> > instead.
> 
> As the docstring of directory-abbrev-alist says:
> 
>    FROM and TO should be equivalent names, which refer to the
>    same directory.
>
> So the feature you want is not the feature provided by
> directory-abbrev-alist :-(

:-(
 
> Maybe we could change the code so as to expand the scope of
> directory-abbrev-alist to include your situation, but I'm not actually
> sure that's a good idea, because it doesn't seem clear exactly when that
> rewrite should take place.
> 
> Maybe if you give us a bit more context to your problem, we can come up
> with a better solution.
> For starters explain to us: if the system doesn't have a "/mount"
> directory, why does it show up in source files, email, and filemenu?

Sure, here is my context.

Our source code, doc, tools, etc is stored on netapps.  We split
development between Linux and Windows. For the most part, source
filenames are passed around or mentioned in doc or email reports etc. using Unix
paths: /sas/dev/mva-v930/tkacl for example. On Windows, these
paths are available via Samba and UNC paths etc. as 
//dntsrc/sas/dev/mva-v930/tkacl .
For example, we run builds from Windows but they run remotely on Unix
and therefore all compiler messages refer to the files via the Unix names,
and different hosts do different mangling of the names.

But when I see a path in a source file or email it is almost always in Unix 
format.

Similarly, our network login directories are on the netapps, for example,
my "home" directory is /u/sasdjb , but that is only available from
Windows via a UNC path, //dntsrc/u/sasdjb or or //sashq/too/u/sasdjb
or /nfs/sanyo/vol/vol2/u22/sasdjb or via a mapped network
drive, u:/ 

Obviously, there are too many different names for the same file,
and I want Emacs to normalize all files to a canonical
form; i.e. all the variations of my network home should
be normalized to u:/ and so forth.

directory-abbrev-alist:

'(("^//dntsrc/u/sasdjb" . "u:")
  ("^/u/sasdjb" . "u:")
  ("^//sashq/root/u/sasdjb" . "u:")
  ("^/nfs/sanyo/vol/vol2/u22/sasdjb" . "u:/")
  ("^//sashq/root/u/sasdjb" . "u:")
  ("^/sas/" . "//dntsrc/sas/")
  ("^/sasgen" . "//dntsrc/sasgen/"))

If I'm running Emacs on Linux, I would normalize all
these variations the other way:

directory-abbrev-alist:

'(("^//dntsrc/u/sasdjb" . "/u/sasdjb")
  ("^u:" . "/u/sasdjb")
  ("^//sashq/root/u/sasdjb" . "/u/sasdjb")
  ("^/nfs/sanyo/vol/vol2/u22/sasdjb" . "/u/sasdjb")
  ("^//sashq/root/u/sasdjb" . "/u/sasdjb")
  ("^//dntsrc/sas/" . "/sas/")
  ("^//dntsrc/sasgen/" . "/sasgen"))

There are many ways in which I can open files in Emacs

C-x C-f
filemenu http://www.eskimo.com/~seldon/filemenu.el
find-file-at-point
gud/gdb
compile/next-error

and probably 5 or 6 other ways, and I'd like them to all honor 
directory-abbrev-alist

>         Stefan

-- 
David J. Biesack, SAS
SAS Campus Dr. Cary, NC 27513
www.sas.com    (919) 531-7771





reply via email to

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