aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref
diff options
context:
space:
mode:
Diffstat (limited to 'doc/lispref')
-rw-r--r--doc/lispref/ChangeLog10
-rw-r--r--doc/lispref/files.texi51
2 files changed, 21 insertions, 40 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 1cff2853a27..e1180124c05 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,13 @@
12011-01-08 Chong Yidong <cyd@stupidchicken.com>
2
3 * files.texi (Directory Names): Move directory-abbrev-alist doc to
4 Emacs manual.
5
62011-01-07 Eli Zaretskii <eliz@gnu.org>
7
8 * files.texi (Directory Names): Explain why FROM in
9 directory-abbrev-alist should begin with \`. (Bug#7777)
10
12010-12-25 Eli Zaretskii <eliz@gnu.org> 112010-12-25 Eli Zaretskii <eliz@gnu.org>
2 12
3 * modes.texi (Emulating Mode Line): Fix last change. 13 * modes.texi (Emulating Mode Line): Fix last change.
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index c2e057783c5..1f66da98347 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1920,51 +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. The @var{from} string is
1936actually a regular expression; it should always start with @samp{\`}.
1937The @var{to} string should be an ordinary absolute directory name. Do
1938not use @samp{~} to stand for a home directory in that string. The
1939function @code{abbreviate-file-name} performs these substitutions.
1940
1941You can set this variable in @file{site-init.el} to describe the
1942abbreviations appropriate for your site.
1943
1944Here's an example, from a system on which file system @file{/home/fsf}
1945and so on are normally accessed through symbolic links named @file{/fsf}
1946and so on.
1947
1948@example
1949(("\\`/home/fsf" . "/fsf")
1950 ("\\`/home/gp" . "/gp")
1951 ("\\`/home/gd" . "/gd"))
1952@end example
1953@end defopt
1954
1955 To convert a directory name to its abbreviation, use this 1923 To convert a directory name to its abbreviation, use this
1956function: 1924function:
1957 1925
1958@defun abbreviate-file-name filename 1926@defun abbreviate-file-name filename
1959@anchor{Definition of abbreviate-file-name} 1927@anchor{Definition of abbreviate-file-name}
1960This function applies abbreviations from @code{directory-abbrev-alist} 1928This function returns an abbreviated form of @var{filename}. It
1961to its argument, and also substitutes @samp{~} for the user's home 1929applies the abbreviations specified in @code{directory-abbrev-alist}
1962directory if the argument names a file in the home directory or one of 1930(@pxref{File Aliases,,File Aliases, emacs, The GNU Emacs Manual}),
1963its subdirectories. (If the home directory is a root directory, it is 1931then substitutes @samp{~} for the user's home directory if the
1964not replaced with @samp{~}, because this does not make the result 1932argument names a file in the home directory or one of its
1965shorter on many systems.) You can use it for directory names and for 1933subdirectories. If the home directory is a root directory, it is not
1966file names, because it recognizes abbreviations even as part of the 1934replaced with @samp{~}, because this does not make the result shorter
1967name. 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.
1968@end defun 1939@end defun
1969 1940
1970@node File Name Expansion 1941@node File Name Expansion