From 692bce5b9eccfae19ae2a5a23a9ccd8d6bf86076 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 27 Oct 2015 20:25:55 -0400 Subject: [PATCH] * lisp/net/tramp-smb.el: Avoid using `add-to-list' on a let-local var * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Use `delete-dups'. * lisp/net/tramp.el (auto-save-file-name-transforms): Declare. --- lisp/net/tramp-smb.el | 7 ++----- lisp/net/tramp.el | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 5910d1fd3a4..c0a6b6afa6d 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -649,8 +649,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (directory &optional full match nosort) "Like `directory-files' for Tramp files." (let ((result (mapcar 'directory-file-name - (file-name-all-completions "" directory))) - res) + (file-name-all-completions "" directory)))) ;; Discriminate with regexp. (when match (setq result @@ -665,9 +664,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." result))) ;; Sort them if necessary. (unless nosort (setq result (sort result 'string-lessp))) - ;; Remove double entries. - (dolist (elt result res) - (add-to-list 'res elt 'append)))) + (delete-dups result))) (defun tramp-smb-handle-expand-file-name (name &optional dir) "Like `expand-file-name' for Tramp files." diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 30a7269240e..2f811bb73ca 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4043,6 +4043,7 @@ Return the local name of the temporary file." 'tramp-delete-temp-file-function))) ;;; Auto saving to a special directory: +(defvar auto-save-file-name-transforms) (defun tramp-handle-make-auto-save-file-name () "Like `make-auto-save-file-name' for Tramp files. -- 2.11.4.GIT