# HG changeset patch # User Richard M. Stallman # Date 895554468 0 # Node ID 26e470569368d06796bafe470163119ef027b123 # Parent 4a0e11be35926360590f095539c5b2f4e41481d6 (uniquify-ignore-buffers-re): New variable. (uniquify-rationalize-file-buffer-names): Implement it. diff -r 4a0e11be3592 -r 26e470569368 lisp/uniquify.el --- a/lisp/uniquify.el Tue May 19 04:27:28 1998 +0000 +++ b/lisp/uniquify.el Tue May 19 05:07:48 1998 +0000 @@ -70,6 +70,8 @@ ;; Ignore non-file non-dired buffers. Colin Rafferty 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 9 Sep 97 ;; Valuable feedback was provided by ;; Paul Smith , @@ -124,6 +126,14 @@ :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 @@ (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))))))