From: Stefan Monnier Date: Wed, 28 Oct 2015 00:25:55 +0000 (-0400) Subject: * lisp/net/tramp-smb.el: Avoid using `add-to-list' on a let-local var X-Git-Tag: emacs-25.0.90~1003^2^2~5 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=692bce5b9eccfae19ae2a5a23a9ccd8d6bf86076;p=emacs.git * 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. --- 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.