aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2014-06-08 00:41:27 -0700
committerGlenn Morris2014-06-08 00:41:27 -0700
commit99d8aedf0d6ab3fff025f72daf1f9bd28b07a8d2 (patch)
tree98f15969887d9453ae88fd66eb4d1d1fa3eafa01
parentb6542afeae56abe6b20019df63b76539728fca54 (diff)
downloademacs-99d8aedf0d6ab3fff025f72daf1f9bd28b07a8d2.tar.gz
emacs-99d8aedf0d6ab3fff025f72daf1f9bd28b07a8d2.zip
Doc edits re uniquify
* doc/emacs/buffers.texi (Uniquify): Copyedits. * doc/emacs/files.texi (Visiting): Update for uniquify changes. * doc/lispref/files.texi (Subroutines of Visiting): Mention uniquify. * doc/misc/vip.texi (Files): Defer to Emacs manual for uniquify details. * lisp/bookmark.el (bookmark-load): Doc fix. * lisp/uniquify.el (uniquify-buffer-name-style): Doc fix. * lisp/files.el: Comment. * etc/NEWS: Related edit.
-rw-r--r--doc/emacs/ChangeLog3
-rw-r--r--doc/emacs/buffers.texi27
-rw-r--r--doc/emacs/files.texi6
-rw-r--r--doc/lispref/ChangeLog2
-rw-r--r--doc/lispref/files.texi5
-rw-r--r--doc/misc/ChangeLog2
-rw-r--r--doc/misc/vip.texi6
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/bookmark.el3
-rw-r--r--lisp/files.el2
-rw-r--r--lisp/uniquify.el30
12 files changed, 58 insertions, 37 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index f277526aea6..8f10c90dc07 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,5 +1,8 @@
12014-06-08 Glenn Morris <rgm@gnu.org> 12014-06-08 Glenn Morris <rgm@gnu.org>
2 2
3 * buffers.texi (Uniquify): Copyedits.
4 * files.texi (Visiting): Update for uniquify changes.
5
3 * dired.texi (Marks vs Flags): 6 * dired.texi (Marks vs Flags):
4 * rmail.texi (Rmail Scrolling): Markup fixes re SPC. 7 * rmail.texi (Rmail Scrolling): Markup fixes re SPC.
5 8
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi
index 89b56da7723..54a84989e2e 100644
--- a/doc/emacs/buffers.texi
+++ b/doc/emacs/buffers.texi
@@ -608,20 +608,16 @@ convenient to switch between buffers.
608@cindex unique buffer names 608@cindex unique buffer names
609@cindex directories in buffer names 609@cindex directories in buffer names
610 When several buffers visit identically-named files, Emacs must give 610 When several buffers visit identically-named files, Emacs must give
611the buffers distinct names. The default method 611the buffers distinct names. The default method adds a suffix based on
612(@code{uniquify-buffer-name-style} set to 612the names of the directories that contain the files. For example, if
613@code{post-forward-angle-brackets}) for making buffer names unique 613you visit files @file{/foo/bar/mumble/name} and
614adds @samp{<dir1>}, @samp{<dir2>}, etc.@: to the end of the buffer 614@file{/baz/quux/mumble/name} at the same time, their buffers will be
615names, where @file{dir1} and @file{dir2} are the minimal parts of the 615named @samp{name<bar/mumble>} and @samp{name<quux/mumble>}, respectively.
616leading directories needed to make the buffer name unique. For 616Emacs adds as many directory parts as are needed to make a unique name.
617example, if you have files @file{/foo/bar/mumble/name} and
618@file{/baz/quux/mumble/name} visited, their buffers will be named
619@samp{name<bar/mumble>} and @samp{name<quux/mumble>} correspondingly.
620 617
621@vindex uniquify-buffer-name-style 618@vindex uniquify-buffer-name-style
622 There are several styles to make buffer names unique. To select 619 You can choose from several different styles for constructing unique
623one, customize the variable @code{uniquify-buffer-name-style} 620buffer names, by customizing the option @code{uniquify-buffer-name-style}.
624(@pxref{Easy Customization}).
625 621
626 The @code{forward} naming method includes part of the file's 622 The @code{forward} naming method includes part of the file's
627directory name at the beginning of the buffer name; using this method, 623directory name at the beginning of the buffer name; using this method,
@@ -631,8 +627,8 @@ buffers visiting the files @file{/u/rms/tmp/Makefile} and
631 627
632 In contrast, the @code{post-forward} naming method would call the 628 In contrast, the @code{post-forward} naming method would call the
633buffers @samp{Makefile|tmp} and @samp{Makefile|zaphod}. The default 629buffers @samp{Makefile|tmp} and @samp{Makefile|zaphod}. The default
634method @code{post-forward-angle-brackets} is like @code{post-forward} 630method @code{post-forward-angle-brackets} is like @code{post-forward},
635except that it prepends the unique path in angle brackets. The 631except that it encloses the unique path in angle brackets. The
636@code{reverse} naming method would call them @samp{Makefile\tmp} and 632@code{reverse} naming method would call them @samp{Makefile\tmp} and
637@samp{Makefile\zaphod}. The nontrivial difference between 633@samp{Makefile\zaphod}. The nontrivial difference between
638@code{post-forward} and @code{reverse} occurs when just one directory 634@code{post-forward} and @code{reverse} occurs when just one directory
@@ -641,8 +637,7 @@ the directory names in reverse order, so that @file{/top/middle/file}
641becomes @samp{file\middle\top}, while @code{post-forward} puts them in 637becomes @samp{file\middle\top}, while @code{post-forward} puts them in
642forward order after the file name, as in @samp{file|top/middle}. If 638forward order after the file name, as in @samp{file|top/middle}. If
643@code{uniquify-buffer-name-style} is set to @code{nil}, the buffer 639@code{uniquify-buffer-name-style} is set to @code{nil}, the buffer
644names simply get a @samp{<2>} etc. prepended. This used to be the 640names simply get @samp{<2>}, @samp{<3>}, etc. appended.
645default behavior in Emacs versions up to 24.4.
646 641
647 Which rule to follow for putting the directory names in the buffer 642 Which rule to follow for putting the directory names in the buffer
648name is not very important if you are going to @emph{look} at the 643name is not very important if you are going to @emph{look} at the
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 894e61d0f04..ee80c49af0b 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -171,9 +171,9 @@ the mode line (@pxref{Mode Line}). Emacs normally constructs the
171buffer name from the file name, omitting the directory name. For 171buffer name from the file name, omitting the directory name. For
172example, a file named @file{/usr/rms/emacs.tex} is visited in a buffer 172example, a file named @file{/usr/rms/emacs.tex} is visited in a buffer
173named @samp{emacs.tex}. If there is already a buffer with that name, 173named @samp{emacs.tex}. If there is already a buffer with that name,
174Emacs constructs a unique name; the normal method is to append 174Emacs constructs a unique name; the normal method is to add a suffix
175@samp{<2>}, @samp{<3>}, and so on, but you can select other methods. 175based on the directory name (e.g., @samp{<rms>}, @samp{<tmp>},
176@xref{Uniquify}. 176and so on), but you can select other methods. @xref{Uniquify}.
177 177
178@cindex creating files 178@cindex creating files
179 To create a new file, just visit it using the same command, @kbd{C-x 179 To create a new file, just visit it using the same command, @kbd{C-x
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 1a4c9c3a57c..aa5589e1c16 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,5 +1,7 @@
12014-06-08 Glenn Morris <rgm@gnu.org> 12014-06-08 Glenn Morris <rgm@gnu.org>
2 2
3 * files.texi (Subroutines of Visiting): Mention uniquify.
4
3 * numbers.texi (Comparison of Numbers): Copyedits. 5 * numbers.texi (Comparison of Numbers): Copyedits.
4 6
52014-06-06 Glenn Morris <rgm@gnu.org> 72014-06-06 Glenn Morris <rgm@gnu.org>
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 278b49e51e0..b071c6a8f35 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -254,11 +254,16 @@ is permanent local, so it is unaffected by changes of major modes.
254which are sometimes useful in user Lisp code: @code{create-file-buffer} 254which are sometimes useful in user Lisp code: @code{create-file-buffer}
255and @code{after-find-file}. This section explains how to use them. 255and @code{after-find-file}. This section explains how to use them.
256 256
257@c FIXME This does not describe the default behavior, because
258@c uniquify is enabled by default and advises this function.
259@c This is confusing. uniquify should be folded into the function proper.
257@defun create-file-buffer filename 260@defun create-file-buffer filename
258This function creates a suitably named buffer for visiting 261This function creates a suitably named buffer for visiting
259@var{filename}, and returns it. It uses @var{filename} (sans directory) 262@var{filename}, and returns it. It uses @var{filename} (sans directory)
260as the name if that name is free; otherwise, it appends a string such as 263as the name if that name is free; otherwise, it appends a string such as
261@samp{<2>} to get an unused name. See also @ref{Creating Buffers}. 264@samp{<2>} to get an unused name. See also @ref{Creating Buffers}.
265Note that the @file{uniquify} library affects the result of this
266function. @xref{Uniquify,,, emacs, The GNU Emacs Manual}.
262 267
263@strong{Please note:} @code{create-file-buffer} does @emph{not} 268@strong{Please note:} @code{create-file-buffer} does @emph{not}
264associate the new buffer with a file and does not select the buffer. 269associate the new buffer with a file and does not select the buffer.
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 6ddf4266db8..8e9eb83ca03 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,5 +1,7 @@
12014-06-08 Glenn Morris <rgm@gnu.org> 12014-06-08 Glenn Morris <rgm@gnu.org>
2 2
3 * vip.texi (Files): Defer to Emacs manual for uniquify details.
4
3 * info.texi (Help-Small-Screen): Clarify details of S-SPC. 5 * info.texi (Help-Small-Screen): Clarify details of S-SPC.
4 (Help-Small-Screen, Help-]): Do not mention S-SPC. 6 (Help-Small-Screen, Help-]): Do not mention S-SPC.
5 (Emacs Info Variables): Markup fix. 7 (Emacs Info Variables): Markup fix.
diff --git a/doc/misc/vip.texi b/doc/misc/vip.texi
index 193d50f3a46..e11a5eb4c8b 100644
--- a/doc/misc/vip.texi
+++ b/doc/misc/vip.texi
@@ -895,9 +895,9 @@ just type @samp{vip.el} followed by @key{RET}. If the file @file{vip.el}
895already exists in the directory, Emacs will visit that file, and if not, 895already exists in the directory, Emacs will visit that file, and if not,
896the file will be created. Emacs will use the file name (@file{vip.el}, in 896the file will be created. Emacs will use the file name (@file{vip.el}, in
897this case) as the name of the buffer visiting the file. In order to make 897this case) as the name of the buffer visiting the file. In order to make
898the buffer name unique, Emacs may append @samp{<2>}, @samp{<3>} etc., to 898the buffer name unique, Emacs may add a suffix (@pxref{Uniquify,,,
899the buffer name. As the @dfn{file name completion} is provided here, you 899emacs, The GNU Emacs Manual}). As @dfn{file name completion} is provided here, you
900can sometime save typing. For instance, suppose there is only one file in the 900can sometimes save typing. For instance, suppose there is only one file in the
901default directory whose name starts with @samp{v}, that is @samp{vip.el}. 901default directory whose name starts with @samp{v}, that is @samp{vip.el}.
902Then if you just type @kbd{v @key{TAB}} then it will be completed to 902Then if you just type @kbd{v @key{TAB}} then it will be completed to
903@samp{vip.el}. Thus, in this case, you just have to type @kbd{v v @key{TAB} 903@samp{vip.el}. Thus, in this case, you just have to type @kbd{v v @key{TAB}
diff --git a/etc/NEWS b/etc/NEWS
index ebd816f5d65..3deb493029c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -402,6 +402,10 @@ conventions. To use it, add it to the `fill-nobreak-predicate' hook.
402 402
403+++ 403+++
404** Uniquify is enabled by default, with `post-forward-angle-brackets' style. 404** Uniquify is enabled by default, with `post-forward-angle-brackets' style.
405In other words, if you visit two files that have the same base name,
406then rather than creating buffers basename and basename<2>,
407Emacs uses basename<dirA> and basename<dirB>. To change this,
408customize `uniquify-buffer-name-style'. Set it to nil for the old behavior.
405 409
406+++ 410+++
407** New command `C-x SPC' (`rectangle-mark-mode') makes a rectangular region. 411** New command `C-x SPC' (`rectangle-mark-mode') makes a rectangular region.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6e89afc6715..66afe67a614 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12014-06-08 Glenn Morris <rgm@gnu.org>
2
3 * bookmark.el (bookmark-load):
4 * uniquify.el (uniquify-buffer-name-style): Doc fixes.
5
12014-06-06 Juri Linkov <juri@jurta.org> 62014-06-06 Juri Linkov <juri@jurta.org>
2 7
3 * desktop.el: Activate auto-saving on window configuration changes. 8 * desktop.el: Activate auto-saving on window configuration changes.
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 5307cada0ac..eab2ea7144f 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1420,8 +1420,7 @@ explicitly.
1420 1420
1421If you load a file containing bookmarks with the same names as 1421If you load a file containing bookmarks with the same names as
1422bookmarks already present in your Emacs, the new bookmarks will get 1422bookmarks already present in your Emacs, the new bookmarks will get
1423unique numeric suffixes \"<2>\", \"<3>\", ... following the same 1423unique numeric suffixes \"<2>\", \"<3>\", etc."
1424method buffers use to resolve name collisions."
1425 (interactive 1424 (interactive
1426 (list (read-file-name 1425 (list (read-file-name
1427 (format "Load bookmarks from: (%s) " 1426 (format "Load bookmarks from: (%s) "
diff --git a/lisp/files.el b/lisp/files.el
index 2e66a303dc6..718421b1899 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1654,6 +1654,8 @@ killed."
1654 (let (kill-buffer-query-functions kill-buffer-hook) 1654 (let (kill-buffer-query-functions kill-buffer-hook)
1655 (kill-buffer obuf)))))) 1655 (kill-buffer obuf))))))
1656 1656
1657;; FIXME we really need to fold the uniquify stuff in here by default,
1658;; not using advice, and add it to the doc string.
1657(defun create-file-buffer (filename) 1659(defun create-file-buffer (filename)
1658 "Create a suitably named buffer for visiting FILENAME, and return it. 1660 "Create a suitably named buffer for visiting FILENAME, and return it.
1659FILENAME (sans directory) is used unchanged if that name is free; 1661FILENAME (sans directory) is used unchanged if that name is free;
diff --git a/lisp/uniquify.el b/lisp/uniquify.el
index 5d973c72897..f0e86dc544f 100644
--- a/lisp/uniquify.el
+++ b/lisp/uniquify.el
@@ -26,7 +26,7 @@
26 26
27;;; Commentary: 27;;; Commentary:
28 28
29;; Emacs's standard method for making buffer names unique adds <2>, <3>, 29;; Emacs's traditional method for making buffer names unique adds <2>, <3>,
30;; etc. to the end of (all but one of) the buffers. This file replaces 30;; etc. to the end of (all but one of) the buffers. This file replaces
31;; that behavior, for buffers visiting files and dired buffers, with a 31;; that behavior, for buffers visiting files and dired buffers, with a
32;; uniquification that adds parts of the file name until the buffer names 32;; uniquification that adds parts of the file name until the buffer names
@@ -94,23 +94,27 @@
94 94
95 95
96(defcustom uniquify-buffer-name-style 'post-forward-angle-brackets 96(defcustom uniquify-buffer-name-style 'post-forward-angle-brackets
97 "If non-nil, buffer names are uniquified with parts of directory name. 97 "How to construct unique buffer names for files with the same base name.
98The value determines the buffer name style and is one of `forward', 98The value can be one of: `forward', `reverse', `post-forward',
99`reverse', `post-forward', or `post-forward-angle-brackets'. 99`post-forward-angle-brackets', or nil.
100For example, files `/foo/bar/mumble/name' and `/baz/quux/mumble/name' 100
101For example, the files `/foo/bar/mumble/name' and `/baz/quux/mumble/name'
101would have the following buffer names in the various styles: 102would have the following buffer names in the various styles:
102 forward bar/mumble/name quux/mumble/name 103
103 reverse name\\mumble\\bar name\\mumble\\quux 104 forward bar/mumble/name quux/mumble/name
104 post-forward name|bar/mumble name|quux/mumble 105 reverse name\\mumble\\bar name\\mumble\\quux
105 post-forward-angle-brackets name<bar/mumble> name<quux/mumble> 106 post-forward name|bar/mumble name|quux/mumble
106 nil name name<2> 107 post-forward-angle-brackets name<bar/mumble> name<quux/mumble>
107Of course, the \"mumble\" part may be stripped as well, depending on the setting 108 nil name name<2>
108of `uniquify-strip-common-suffix'." 109
110The \"mumble\" part may be stripped as well, depending on the
111setting of `uniquify-strip-common-suffix'. For more options that
112you can set, browse the `uniquify' custom group."
109 :type '(radio (const forward) 113 :type '(radio (const forward)
110 (const reverse) 114 (const reverse)
111 (const post-forward) 115 (const post-forward)
112 (const post-forward-angle-brackets) 116 (const post-forward-angle-brackets)
113 (const :tag "standard Emacs behavior (nil)" nil)) 117 (const :tag "numeric suffixes" nil))
114 :version "24.4" 118 :version "24.4"
115 :require 'uniquify 119 :require 'uniquify
116 :group 'uniquify) 120 :group 'uniquify)