[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#62732: 29.0.60; uniquify-trailing-separator-p affects any buffer who
From: |
Stefan Monnier |
Subject: |
bug#62732: 29.0.60; uniquify-trailing-separator-p affects any buffer whose name matches a dir in CWD |
Date: |
Fri, 05 May 2023 16:30:28 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
> Ah, while I'm at it, here's a fix (based on the patch in the preceding
> mail) for a different bug which I just noticed: create-file-buffer's
> documentations states:
>
>>Emacs treats buffers whose names begin with a space as internal buffers.
>>To avoid confusion when visiting a file whose name begins with a space,
>>this function prepends a "|" to the final result if necessary.
>
> But uniquify renames the buffer away from having that "|". This patch
> fixes that bug.
How 'bout the patch below (based on the current code), instead?
Stefan
diff --git a/lisp/uniquify.el b/lisp/uniquify.el
index dee9ecba2ea..c252d5461aa 100644
--- a/lisp/uniquify.el
+++ b/lisp/uniquify.el
@@ -498,7 +498,7 @@ uniquify--create-file-buffer-advice
(when uniquify-buffer-name-style
(let ((filename (expand-file-name (directory-file-name filename))))
(uniquify-rationalize-file-buffer-names
- (file-name-nondirectory filename)
+ (buffer-name buf)
(file-name-directory filename)
buf))))