summaryrefslogtreecommitdiff
path: root/lisp/uniquify.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-05-19 05:07:48 +0000
committerRichard M. Stallman <rms@gnu.org>1998-05-19 05:07:48 +0000
commit9a9c6f9f44db46791da538de0bdfca28377cd388 (patch)
tree033e95fc208bb3e866de11ebcc835d099fc6127a /lisp/uniquify.el
parent1ea3de08e7a5087968ce8f405b1e570b36811a61 (diff)
downloademacs-9a9c6f9f44db46791da538de0bdfca28377cd388.tar.gz
(uniquify-ignore-buffers-re): New variable.
(uniquify-rationalize-file-buffer-names): Implement it.
Diffstat (limited to 'lisp/uniquify.el')
-rw-r--r--lisp/uniquify.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/uniquify.el b/lisp/uniquify.el
index 5a8c31ca624..5e4749389e5 100644
--- a/lisp/uniquify.el
+++ b/lisp/uniquify.el
@@ -70,6 +70,8 @@
;; Ignore non-file non-dired buffers. Colin Rafferty <craffert@ml.com> 3 Mar 97
;; Use last component, not "", for file name of directories. mernst 27 Jun 97
;; Use directory-file-name; code cleanup. mernst 6 Sep 97
+;; Add uniquify-ignore-buffers-re.
+;; Andre Srinivasan <andre@visigenic.com> 9 Sep 97
;; Valuable feedback was provided by
;; Paul Smith <psmith@baynetworks.com>,
@@ -124,6 +126,14 @@ other buffer names are changed."
:type 'boolean
:group 'uniquify)
+(defcustom uniquify-ignore-buffers-re nil
+ "*Regular expression matching buffer names that should not be uniqified.
+For instance, set this to \"^draft-[0-9]+$\" to avoid having uniquify rename
+draft buffers even if `uniquify-after-kill-buffer-p' is non-nil and the
+visited file name isn't the same as that of the buffer."
+ :type 'boolean
+ :group 'uniquify)
+
(defcustom uniquify-min-dir-content 0
"*Minimum number of directory name components included in buffer name."
:type 'integer
@@ -196,6 +206,9 @@ file name elements. Arguments cause only a subset of buffers to be renamed."
(uniquify-buffer-file-name buffer)))
(rawname (and bfn (uniquify-file-name-nondirectory bfn)))
(deserving (and rawname
+ (not (and uniquify-ignore-buffers-re
+ (string-match uniquify-ignore-buffers-re
+ (buffer-name buffer))))
(or (not newbuffile)
(equal rawname
(uniquify-file-name-nondirectory newbuffile))))))