From 70b7e0afe02669df44fd719c2ab35561b565f2df Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Fri, 6 Dec 2024 12:01:29 +0100 Subject: [PATCH] Avoid empty unique qualifier in buffer name * lisp/uniquify.el (uniquify-get-proposed-name): If the unique qualifier will end up being empty just return the base name. --- lisp/uniquify.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/uniquify.el b/lisp/uniquify.el index efe42762a6b..677270d6a91 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el @@ -397,7 +397,10 @@ uniquify-get-proposed-name (setq uniquify-possibly-resolvable t)) (cond - ((null extra-string) base) + ((or (null extra-string) + (and (= 1 (length extra-string)) + (string= "" (car extra-string)))) + base) ((string-equal base "") ;Happens for dired buffers on the root directory. (mapconcat #'identity extra-string "/")) ((eq uniquify-buffer-name-style 'reverse) -- 2.47.0