diff options
| author | Richard M. Stallman | 1998-05-19 05:07:48 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-05-19 05:07:48 +0000 |
| commit | 9a9c6f9f44db46791da538de0bdfca28377cd388 (patch) | |
| tree | 033e95fc208bb3e866de11ebcc835d099fc6127a | |
| parent | 1ea3de08e7a5087968ce8f405b1e570b36811a61 (diff) | |
| download | emacs-9a9c6f9f44db46791da538de0bdfca28377cd388.tar.gz emacs-9a9c6f9f44db46791da538de0bdfca28377cd388.zip | |
(uniquify-ignore-buffers-re): New variable.
(uniquify-rationalize-file-buffer-names): Implement it.
| -rw-r--r-- | lisp/uniquify.el | 13 |
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 @@ | |||
| 70 | ;; Ignore non-file non-dired buffers. Colin Rafferty <craffert@ml.com> 3 Mar 97 | 70 | ;; Ignore non-file non-dired buffers. Colin Rafferty <craffert@ml.com> 3 Mar 97 |
| 71 | ;; Use last component, not "", for file name of directories. mernst 27 Jun 97 | 71 | ;; Use last component, not "", for file name of directories. mernst 27 Jun 97 |
| 72 | ;; Use directory-file-name; code cleanup. mernst 6 Sep 97 | 72 | ;; Use directory-file-name; code cleanup. mernst 6 Sep 97 |
| 73 | ;; Add uniquify-ignore-buffers-re. | ||
| 74 | ;; Andre Srinivasan <andre@visigenic.com> 9 Sep 97 | ||
| 73 | 75 | ||
| 74 | ;; Valuable feedback was provided by | 76 | ;; Valuable feedback was provided by |
| 75 | ;; Paul Smith <psmith@baynetworks.com>, | 77 | ;; Paul Smith <psmith@baynetworks.com>, |
| @@ -124,6 +126,14 @@ other buffer names are changed." | |||
| 124 | :type 'boolean | 126 | :type 'boolean |
| 125 | :group 'uniquify) | 127 | :group 'uniquify) |
| 126 | 128 | ||
| 129 | (defcustom uniquify-ignore-buffers-re nil | ||
| 130 | "*Regular expression matching buffer names that should not be uniqified. | ||
| 131 | For instance, set this to \"^draft-[0-9]+$\" to avoid having uniquify rename | ||
| 132 | draft buffers even if `uniquify-after-kill-buffer-p' is non-nil and the | ||
| 133 | visited file name isn't the same as that of the buffer." | ||
| 134 | :type 'boolean | ||
| 135 | :group 'uniquify) | ||
| 136 | |||
| 127 | (defcustom uniquify-min-dir-content 0 | 137 | (defcustom uniquify-min-dir-content 0 |
| 128 | "*Minimum number of directory name components included in buffer name." | 138 | "*Minimum number of directory name components included in buffer name." |
| 129 | :type 'integer | 139 | :type 'integer |
| @@ -196,6 +206,9 @@ file name elements. Arguments cause only a subset of buffers to be renamed." | |||
| 196 | (uniquify-buffer-file-name buffer))) | 206 | (uniquify-buffer-file-name buffer))) |
| 197 | (rawname (and bfn (uniquify-file-name-nondirectory bfn))) | 207 | (rawname (and bfn (uniquify-file-name-nondirectory bfn))) |
| 198 | (deserving (and rawname | 208 | (deserving (and rawname |
| 209 | (not (and uniquify-ignore-buffers-re | ||
| 210 | (string-match uniquify-ignore-buffers-re | ||
| 211 | (buffer-name buffer)))) | ||
| 199 | (or (not newbuffile) | 212 | (or (not newbuffile) |
| 200 | (equal rawname | 213 | (equal rawname |
| 201 | (uniquify-file-name-nondirectory newbuffile)))))) | 214 | (uniquify-file-name-nondirectory newbuffile)))))) |