aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2015-10-27 20:25:55 -0400
committerStefan Monnier2015-10-27 20:25:55 -0400
commit692bce5b9eccfae19ae2a5a23a9ccd8d6bf86076 (patch)
tree5a2410b212f370b3c871bbd9fefbc2704f2e01e9
parent3f4a192ba6f74237736fb287038f560ca22d7d22 (diff)
downloademacs-692bce5b9eccfae19ae2a5a23a9ccd8d6bf86076.tar.gz
emacs-692bce5b9eccfae19ae2a5a23a9ccd8d6bf86076.zip
* 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.
-rw-r--r--lisp/net/tramp-smb.el7
-rw-r--r--lisp/net/tramp.el1
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."
649 (directory &optional full match nosort) 649 (directory &optional full match nosort)
650 "Like `directory-files' for Tramp files." 650 "Like `directory-files' for Tramp files."
651 (let ((result (mapcar 'directory-file-name 651 (let ((result (mapcar 'directory-file-name
652 (file-name-all-completions "" directory))) 652 (file-name-all-completions "" directory))))
653 res)
654 ;; Discriminate with regexp. 653 ;; Discriminate with regexp.
655 (when match 654 (when match
656 (setq result 655 (setq result
@@ -665,9 +664,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
665 result))) 664 result)))
666 ;; Sort them if necessary. 665 ;; Sort them if necessary.
667 (unless nosort (setq result (sort result 'string-lessp))) 666 (unless nosort (setq result (sort result 'string-lessp)))
668 ;; Remove double entries. 667 (delete-dups result)))
669 (dolist (elt result res)
670 (add-to-list 'res elt 'append))))
671 668
672(defun tramp-smb-handle-expand-file-name (name &optional dir) 669(defun tramp-smb-handle-expand-file-name (name &optional dir)
673 "Like `expand-file-name' for Tramp files." 670 "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."
4043 'tramp-delete-temp-file-function))) 4043 'tramp-delete-temp-file-function)))
4044 4044
4045;;; Auto saving to a special directory: 4045;;; Auto saving to a special directory:
4046(defvar auto-save-file-name-transforms)
4046 4047
4047(defun tramp-handle-make-auto-save-file-name () 4048(defun tramp-handle-make-auto-save-file-name ()
4048 "Like `make-auto-save-file-name' for Tramp files. 4049 "Like `make-auto-save-file-name' for Tramp files.