diff options
| -rw-r--r-- | lisp/uniquify.el | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lisp/uniquify.el b/lisp/uniquify.el index 5b5145ad026..4ef051d4e2d 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el | |||
| @@ -160,8 +160,8 @@ contains the name of the directory which the buffer is visiting.") | |||
| 160 | ;; uniquify-fix-list data structure | 160 | ;; uniquify-fix-list data structure |
| 161 | (defstruct (uniquify-item | 161 | (defstruct (uniquify-item |
| 162 | (:constructor nil) (:copier nil) | 162 | (:constructor nil) (:copier nil) |
| 163 | (:constructor uniquify-make-item (base filename buffer proposed))) | 163 | (:constructor uniquify-make-item (base dirname buffer proposed))) |
| 164 | base filename buffer proposed) | 164 | base dirname buffer proposed) |
| 165 | 165 | ||
| 166 | ;; Internal variables used free | 166 | ;; Internal variables used free |
| 167 | (defvar uniquify-possibly-resolvable nil) | 167 | (defvar uniquify-possibly-resolvable nil) |
| @@ -251,13 +251,13 @@ in `uniquify-list-buffers-directory-modes', otherwise returns nil." | |||
| 251 | (uniquify-rationalize-conflicting-sublist conflicting-sublist | 251 | (uniquify-rationalize-conflicting-sublist conflicting-sublist |
| 252 | old-proposed depth))) | 252 | old-proposed depth))) |
| 253 | 253 | ||
| 254 | (defun uniquify-get-proposed-name (base filename &optional depth) | 254 | (defun uniquify-get-proposed-name (base dirname &optional depth) |
| 255 | (unless depth (setq depth uniquify-min-dir-content)) | 255 | (unless depth (setq depth uniquify-min-dir-content)) |
| 256 | (assert (equal (directory-file-name filename) filename)) ;No trailing slash. | 256 | (assert (equal (directory-file-name dirname) dirname)) ;No trailing slash. |
| 257 | 257 | ||
| 258 | ;; Distinguish directories by adding extra separator. | 258 | ;; Distinguish directories by adding extra separator. |
| 259 | (if (and uniquify-trailing-separator-p | 259 | (if (and uniquify-trailing-separator-p |
| 260 | (file-directory-p (expand-file-name base filename)) | 260 | (file-directory-p (expand-file-name base dirname)) |
| 261 | (not (string-equal base ""))) | 261 | (not (string-equal base ""))) |
| 262 | (cond ((eq uniquify-buffer-name-style 'forward) | 262 | (cond ((eq uniquify-buffer-name-style 'forward) |
| 263 | (setq base (file-name-as-directory base))) | 263 | (setq base (file-name-as-directory base))) |
| @@ -267,18 +267,18 @@ in `uniquify-list-buffers-directory-modes', otherwise returns nil." | |||
| 267 | 267 | ||
| 268 | (let ((extra-string nil) | 268 | (let ((extra-string nil) |
| 269 | (n depth)) | 269 | (n depth)) |
| 270 | (while (and (> n 0) filename) | 270 | (while (and (> n 0) dirname) |
| 271 | (let ((file (file-name-nondirectory filename))) | 271 | (let ((file (file-name-nondirectory dirname))) |
| 272 | (when (setq filename (file-name-directory filename)) | 272 | (when (setq dirname (file-name-directory dirname)) |
| 273 | (setq filename (directory-file-name filename))) | 273 | (setq dirname (directory-file-name dirname))) |
| 274 | (setq n (1- n)) | 274 | (setq n (1- n)) |
| 275 | (push (if (zerop (length file)) ;nil or "". | 275 | (push (if (zerop (length file)) ;nil or "". |
| 276 | (prog1 "" (setq filename nil)) ;Could be `filename' iso "". | 276 | (prog1 "" (setq dirname nil)) ;Could be `dirname' iso "". |
| 277 | file) | 277 | file) |
| 278 | extra-string))) | 278 | extra-string))) |
| 279 | (when (zerop n) | 279 | (when (zerop n) |
| 280 | (if (and filename extra-string | 280 | (if (and dirname extra-string |
| 281 | (equal filename (file-name-directory filename))) | 281 | (equal dirname (file-name-directory dirname))) |
| 282 | ;; We're just before the root. Let's add the leading / already. | 282 | ;; We're just before the root. Let's add the leading / already. |
| 283 | ;; With "/a/b"+"/c/d/b" this leads to "/a/b" and "d/b" but with | 283 | ;; With "/a/b"+"/c/d/b" this leads to "/a/b" and "d/b" but with |
| 284 | ;; "/a/b"+"/c/a/b" this leads to "/a/b" and "a/b". | 284 | ;; "/a/b"+"/c/a/b" this leads to "/a/b" and "a/b". |
| @@ -322,7 +322,7 @@ in `uniquify-list-buffers-directory-modes', otherwise returns nil." | |||
| 322 | (setf (uniquify-item-proposed item) | 322 | (setf (uniquify-item-proposed item) |
| 323 | (uniquify-get-proposed-name | 323 | (uniquify-get-proposed-name |
| 324 | (uniquify-item-base item) | 324 | (uniquify-item-base item) |
| 325 | (uniquify-item-filename item) | 325 | (uniquify-item-dirname item) |
| 326 | depth))) | 326 | depth))) |
| 327 | (uniquify-rationalize-a-list conf-list depth)) | 327 | (uniquify-rationalize-a-list conf-list depth)) |
| 328 | (unless (string= old-name "") | 328 | (unless (string= old-name "") |