From 4320be4251090803282bcd80937342fda25b4ccb Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 7 Jan 2011 17:55:13 +0200 Subject: [PATCH] Fix bug #7777 with documentation of directory-abbrev-alist. lisp/files.el (directory-abbrev-alist): Doc fix. doc/lispref/files.texi (Directory Names): Explain why FROM in directory-abbrev-alist should begin with \`. --- doc/lispref/ChangeLog | 5 +++++ doc/lispref/files.texi | 11 +++++++---- lisp/ChangeLog | 4 ++++ lisp/files.el | 5 ++++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 1cff2853a27..bdaae56cb5c 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2011-01-07 Eli Zaretskii + + * files.texi (Directory Names): Explain why FROM in + directory-abbrev-alist should begin with \`. (Bug#7777) + 2010-12-25 Eli Zaretskii * modes.texi (Emulating Mode Line): Fix last change. diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index c2e057783c5..f0060cd6622 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -1933,10 +1933,13 @@ The variable @code{directory-abbrev-alist} contains an alist of abbreviations to use for file directories. Each element has the form @code{(@var{from} . @var{to})}, and says to replace @var{from} with @var{to} when it appears in a directory name. The @var{from} string is -actually a regular expression; it should always start with @samp{\`}. -The @var{to} string should be an ordinary absolute directory name. Do -not use @samp{~} to stand for a home directory in that string. The -function @code{abbreviate-file-name} performs these substitutions. +actually a regular expression; it is matched against directory names +anchored at the first character, so it should start with @samp{\`}, to +support directory names with embedded newlines (which will defeat +@samp{^}). The @var{to} string should be an ordinary absolute +directory name. Do not use @samp{~} to stand for a home directory in +that string. The function @code{abbreviate-file-name} performs these +substitutions. You can set this variable in @file{site-init.el} to describe the abbreviations appropriate for your site. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8b72e41e9ad..3f0f8e85271 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-01-07 Eli Zaretskii + + * files.el (directory-abbrev-alist): Doc fix. (Bug#7777) + 2011-01-06 Stefan Monnier * vc-bzr.el (vc-bzr-annotate-command, vc-bzr-annotate-time): diff --git a/lisp/files.el b/lisp/files.el index 690caf13960..ab027b507f6 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -56,7 +56,10 @@ when it has unsaved changes." A list of elements of the form (FROM . TO), each meaning to replace FROM with TO when it appears in a directory name. This replacement is done when setting up the default directory of a newly visited file. -*Every* FROM string should start with \"\\\\`\". + +FROM is matched against directory names anchored at the first +character, so it should start with a \"\\\\`\", or, if directory +names cannot have embedded newlines, with a \"^\". FROM and TO should be equivalent names, which refer to the same directory. Do not use `~' in the TO strings; -- 2.39.2