aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-01-08 17:01:13 -0500
committerChong Yidong2011-01-08 17:01:13 -0500
commitc40b51e0ff77adfbe27150de0e154bd0015a4ec5 (patch)
treeeaaa84b12661dda5343a39e4bb7b72cf02edc4d7
parentad2d9b0e33e4eef277b67f58ec8b024d0dd1e0e7 (diff)
downloademacs-c40b51e0ff77adfbe27150de0e154bd0015a4ec5.tar.gz
emacs-c40b51e0ff77adfbe27150de0e154bd0015a4ec5.zip
Move directory-abbrev-alist doc from Lispref to Emacs manual.
* doc/emacs/files.texi (File Aliases): Move directory-abbrev-alist doc from Lisp manual. Explain why directory-abbrev-alist elements should be anchored (Bug#7777). * doc/lispref/files.texi (Directory Names): Move directory-abbrev-alist doc to Emacs manual.
-rw-r--r--doc/emacs/ChangeLog6
-rw-r--r--doc/emacs/files.texi26
-rw-r--r--doc/lispref/ChangeLog4
-rw-r--r--doc/lispref/files.texi55
4 files changed, 44 insertions, 47 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 829f61efb38..4825f08979f 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,9 @@
12011-01-08 Chong Yidong <cyd@stupidchicken.com>
2
3 * files.texi (File Aliases): Move directory-abbrev-alist doc from Lisp
4 manual. Explain why directory-abbrev-alist elements should be anchored
5 (Bug#7777).
6
12011-01-07 Eli Zaretskii <eliz@gnu.org> 72011-01-07 Eli Zaretskii <eliz@gnu.org>
2 8
3 * msdog.texi (Windows Startup): Correct inaccurate description of 9 * msdog.texi (Windows Startup): Correct inaccurate description of
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 4df81caa8f2..530c2bb94f7 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -1158,7 +1158,6 @@ links point to directories.
1158 1158
1159@vindex find-file-existing-other-name 1159@vindex find-file-existing-other-name
1160@vindex find-file-suppress-same-file-warnings 1160@vindex find-file-suppress-same-file-warnings
1161
1162 Normally, if you visit a file which Emacs is already visiting under 1161 Normally, if you visit a file which Emacs is already visiting under
1163a different name, Emacs displays a message in the echo area and uses 1162a different name, Emacs displays a message in the echo area and uses
1164the existing buffer visiting that file. This can happen on systems 1163the existing buffer visiting that file. This can happen on systems
@@ -1180,6 +1179,31 @@ then the file name recorded for a buffer is the file's @dfn{truename}
1180than the name you specify. Setting @code{find-file-visit-truename} also 1179than the name you specify. Setting @code{find-file-visit-truename} also
1181implies the effect of @code{find-file-existing-other-name}. 1180implies the effect of @code{find-file-existing-other-name}.
1182 1181
1182@cindex directory name abbreviation
1183@vindex directory-abbrev-alist
1184 Sometimes, a directory is ordinarily accessed through a symbolic
1185link, and you may want Emacs to preferentially display its ``linked''
1186name instead of its truename. To do this, customize the variable
1187@code{directory-abbrev-alist}. Each element in this list should have
1188the form @code{(@var{from} . @var{to})}, which says to replace
1189@var{from} with @var{to} when it appears in a directory name. For
1190this feature to work properly, @var{from} and @var{to} should point to
1191the same file. The @var{from} string is actually a regular expression
1192(@pxref{Regexps}); it should always start with @samp{\`}, to avoid
1193matching to an incorrect part of the original directory name. The
1194@var{to} string should be an ordinary absolute directory name. Do not
1195use @samp{~} to stand for a home directory in the @var{to} string;
1196Emacs performs these substitutions separately.
1197
1198 Here's an example, from a system on which file system
1199@file{/home/fsf} and so on are normally accessed through symbolic
1200links named @file{/fsf} and so on.
1201
1202@example
1203(("\\`/home/fsf" . "/fsf")
1204 ("\\`/home/gd" . "/gd"))
1205@end example
1206
1183@node Directories 1207@node Directories
1184@section File Directories 1208@section File Directories
1185 1209
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 1c4e6b9074f..e1180124c05 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,7 +1,7 @@
12011-01-08 Chong Yidong <cyd@stupidchicken.com> 12011-01-08 Chong Yidong <cyd@stupidchicken.com>
2 2
3 * files.texi (Directory Names): Explain why directory-abbrev-alist 3 * files.texi (Directory Names): Move directory-abbrev-alist doc to
4 elements should be anchored (Bug#7777). 4 Emacs manual.
5 5
62011-01-07 Eli Zaretskii <eliz@gnu.org> 62011-01-07 Eli Zaretskii <eliz@gnu.org>
7 7
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index c2a14b5025e..1f66da98347 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1920,55 +1920,22 @@ Don't try concatenating a slash by hand, as in
1920because this is not portable. Always use 1920because this is not portable. Always use
1921@code{file-name-as-directory}. 1921@code{file-name-as-directory}.
1922 1922
1923@cindex directory name abbreviation
1924 Directory name abbreviations are useful for directories that are
1925normally accessed through symbolic links. Sometimes the users recognize
1926primarily the link's name as ``the name'' of the directory, and find it
1927annoying to see the directory's ``real'' name. If you define the link
1928name as an abbreviation for the ``real'' name, Emacs shows users the
1929abbreviation instead.
1930
1931@defopt directory-abbrev-alist
1932The variable @code{directory-abbrev-alist} contains an alist of
1933abbreviations to use for file directories. Each element has the form
1934@code{(@var{from} . @var{to})}, and says to replace @var{from} with
1935@var{to} when it appears in a directory name.
1936
1937The @var{from} string is actually a regular expression. It ought to
1938always start with @samp{\`}, to avoid incorrectly matching to a
1939relative portion of the supplied directory name.
1940
1941The @var{to} string should be an ordinary absolute directory name.
1942Do not use @samp{~} to stand for a home directory in that string; the
1943function @code{abbreviate-file-name} performs these substitutions.
1944
1945You can set this variable in @file{site-init.el} to describe the
1946abbreviations appropriate for your site.
1947
1948Here's an example, from a system on which file system @file{/home/fsf}
1949and so on are normally accessed through symbolic links named @file{/fsf}
1950and so on.
1951
1952@example
1953(("\\`/home/fsf" . "/fsf")
1954 ("\\`/home/gp" . "/gp")
1955 ("\\`/home/gd" . "/gd"))
1956@end example
1957@end defopt
1958
1959 To convert a directory name to its abbreviation, use this 1923 To convert a directory name to its abbreviation, use this
1960function: 1924function:
1961 1925
1962@defun abbreviate-file-name filename 1926@defun abbreviate-file-name filename
1963@anchor{Definition of abbreviate-file-name} 1927@anchor{Definition of abbreviate-file-name}
1964This function applies abbreviations from @code{directory-abbrev-alist} 1928This function returns an abbreviated form of @var{filename}. It
1965to its argument, and also substitutes @samp{~} for the user's home 1929applies the abbreviations specified in @code{directory-abbrev-alist}
1966directory if the argument names a file in the home directory or one of 1930(@pxref{File Aliases,,File Aliases, emacs, The GNU Emacs Manual}),
1967its subdirectories. (If the home directory is a root directory, it is 1931then substitutes @samp{~} for the user's home directory if the
1968not replaced with @samp{~}, because this does not make the result 1932argument names a file in the home directory or one of its
1969shorter on many systems.) You can use it for directory names and for 1933subdirectories. If the home directory is a root directory, it is not
1970file names, because it recognizes abbreviations even as part of the 1934replaced with @samp{~}, because this does not make the result shorter
1971name. 1935on many systems.
1936
1937You can use this function for directory names and for file names,
1938because it recognizes abbreviations even as part of the name.
1972@end defun 1939@end defun
1973 1940
1974@node File Name Expansion 1941@node File Name Expansion