;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
:type 'boolean
:group 'uniquify)
-(defvar uniquify-list-buffers-directory-modes '(dired-mode cvs-mode)
+(defvar uniquify-list-buffers-directory-modes '(dired-mode cvs-mode vc-dir-mode)
"List of modes for which uniquify should obey `list-buffers-directory'.
That means that when `buffer-file-name' is set to nil, `list-buffers-directory'
contains the name of the directory which the buffer is visiting.")
proposed)
;; Divide fix-list into items with same proposed names and pass them
;; to uniquify-rationalize-conflicting-sublist.
- (dolist (item (sort fix-list 'uniquify-item-greaterp))
+ (dolist (item (sort (copy-sequence fix-list) 'uniquify-item-greaterp))
(setq proposed (uniquify-item-proposed item))
(unless (equal proposed old-proposed)
(uniquify-rationalize-conflicting-sublist conflicting-sublist
(setq dirname (directory-file-name dirname)))
(setq n (1- n))
(push (if (zerop (length file)) ;nil or "".
- (prog1 "" (setq dirname nil)) ;Could be `dirname' iso "".
+ (prog1 (or (file-remote-p dirname) "")
+ (setq dirname nil)) ;Could be `dirname' iso "".
file)
extra-string)))
(when (zerop n)