(lastname (if (string= lastname "") ; FILENAME is a root directory
filename lastname))
(lastname (cond
- ((not (and uniquify-trailing-separator-p
+ ((not (and uniquify-trailing-separator-flag
(file-directory-p filename)))
lastname)
((eq uniquify-buffer-name-style 'forward)
:version "24.4"
:require 'uniquify)
-(defcustom uniquify-after-kill-buffer-p t
+(define-obsolete-variable-alias 'uniquify-after-kill-buffer-p
+ 'uniquify-after-kill-buffer-flag "31.1")
+(defcustom uniquify-after-kill-buffer-flag t
"If non-nil, rerationalize buffer names after a buffer has been killed."
- :type 'boolean)
+ :type 'boolean
+ :version "31.1")
(defcustom uniquify-ignore-buffers-re nil
"Regular expression matching buffer names that should not be uniquified.
-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."
+For instance, set this to \"^draft-[0-9]+$\" to avoid having uniquify
+rename draft buffers even if `uniquify-after-kill-buffer-flag' is
+non-nil and the visited file name isn't the same as that of the buffer."
:type '(choice (const :tag "Uniquify all buffers" nil) regexp))
(defcustom uniquify-min-dir-content 0
file name components (default \"\\\")."
:type '(choice (const nil) string))
-(defcustom uniquify-trailing-separator-p nil
- "If non-nil, add a file name separator to Dired buffer names.
+(define-obsolete-variable-alias 'uniquify-trailing-separator-p
+ 'uniquify-trailing-separator-flag "31.1")
+(defcustom uniquify-trailing-separator-flag nil
+ "Non-nil means add a file name separator to Dired buffer names.
If `uniquify-buffer-name-style' is `forward', add the separator at the end;
if it is `reverse', add the separator at the beginning; otherwise, this
variable is ignored."
- :type 'boolean)
+ :type 'boolean
+ :version "31.1")
(defcustom uniquify-strip-common-suffix
;; Using it when uniquify-min-dir-content>0 doesn't make much sense.
(defun uniquify-kill-buffer-function ()
"Re-rationalize buffer names, ignoring current buffer.
For use on `kill-buffer-hook'."
- (and uniquify-after-kill-buffer-p
+ (and uniquify-after-kill-buffer-flag
(uniquify-maybe-rerationalize-w/o-cb)))
;; Ideally we'd like to add it buffer-locally, but that doesn't work
(make-directory b-path 'parents)
(let ((uniquify-buffer-name-style 'forward)
(uniquify-strip-common-suffix t)
- (uniquify-trailing-separator-p nil))
+ (uniquify-trailing-separator-flag nil))
(let ((bufs (list (find-file-noselect a-path)
(find-file-noselect b-path))))
(should (equal (mapcar #'buffer-name bufs)
(mapc #'kill-buffer bufs)))
(let ((uniquify-buffer-name-style 'forward)
(uniquify-strip-common-suffix nil)
- (uniquify-trailing-separator-p t))
+ (uniquify-trailing-separator-flag t))
(let ((bufs (list (find-file-noselect a-path)
(find-file-noselect b-path))))
(should (equal (mapcar #'buffer-name bufs)
(mapc #'kill-buffer bufs)))
(let ((uniquify-buffer-name-style 'forward)
(uniquify-strip-common-suffix t)
- (uniquify-trailing-separator-p t))
+ (uniquify-trailing-separator-flag t))
(let ((bufs (list (find-file-noselect a-path)
(find-file-noselect b-path))))
(should (equal (mapcar #'buffer-name bufs)
(ert-deftest uniquify-rename-to-dir ()
"Giving a buffer a name which matches a directory doesn't rename the buffer"
(let ((uniquify-buffer-name-style 'forward)
- (uniquify-trailing-separator-p t))
+ (uniquify-trailing-separator-flag t))
(save-excursion
(find-file "../README")
(rename-buffer "lisp" t)
(ert-deftest uniquify-separator-style-reverse ()
(let ((uniquify-buffer-name-style 'reverse)
- (uniquify-trailing-separator-p t))
+ (uniquify-trailing-separator-flag t))
(save-excursion
(should (file-directory-p "../lib-src"))
(find-file "../lib-src")
(kill-buffer))))
(ert-deftest uniquify-separator-ignored ()
- "If uniquify-buffer-name-style isn't forward or reverse,
-uniquify-trailing-separator-p is ignored"
+ "If `uniquify-buffer-name-style' isn't forward or reverse,
+`uniquify-trailing-separator-flag' is ignored."
(let ((uniquify-buffer-name-style 'post-forward-angle-brackets)
- (uniquify-trailing-separator-p t))
+ (uniquify-trailing-separator-flag t))
(save-excursion
(should (file-directory-p "../lib-src"))
(find-file "../lib-src")