changeset 112244:fb129cb53476

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 \`.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 07 Jan 2011 17:55:13 +0200
parents 8c06638b3497
children 3a76bad41614
files doc/lispref/ChangeLog doc/lispref/files.texi lisp/ChangeLog lisp/files.el
diffstat 4 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/doc/lispref/ChangeLog	Fri Jan 07 17:32:12 2011 +0200
+++ b/doc/lispref/ChangeLog	Fri Jan 07 17:55:13 2011 +0200
@@ -1,3 +1,8 @@
+2011-01-07  Eli Zaretskii  <eliz@gnu.org>
+
+	* files.texi (Directory Names): Explain why FROM in
+	directory-abbrev-alist should begin with \`.  (Bug#7777)
+
 2010-12-25  Eli Zaretskii  <eliz@gnu.org>
 
 	* modes.texi (Emulating Mode Line): Fix last change.
--- a/doc/lispref/files.texi	Fri Jan 07 17:32:12 2011 +0200
+++ b/doc/lispref/files.texi	Fri Jan 07 17:55:13 2011 +0200
@@ -1933,10 +1933,13 @@
 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.
--- a/lisp/ChangeLog	Fri Jan 07 17:32:12 2011 +0200
+++ b/lisp/ChangeLog	Fri Jan 07 17:55:13 2011 +0200
@@ -1,3 +1,7 @@
+2011-01-07  Eli Zaretskii  <eliz@gnu.org>
+
+	* files.el (directory-abbrev-alist): Doc fix.  (Bug#7777)
+
 2011-01-06  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* vc-bzr.el (vc-bzr-annotate-command, vc-bzr-annotate-time):
--- a/lisp/files.el	Fri Jan 07 17:32:12 2011 +0200
+++ b/lisp/files.el	Fri Jan 07 17:55:13 2011 +0200
@@ -56,7 +56,10 @@
 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;