changeset 106090:e0ed1e2210d7

* net/tramp.el (tramp-advice-file-expand-wildcards): Simplify. Don't set `ad-return-value' if `ad-do-it' doesn't.
author Michael Albinus <michael.albinus@gmx.de>
date Tue, 17 Nov 2009 10:35:36 +0000
parents b40edfe3e412
children 0e0a17aff6ec
files lisp/net/tramp.el
diffstat 1 files changed, 10 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/tramp.el	Tue Nov 17 09:53:45 2009 +0000
+++ b/lisp/net/tramp.el	Tue Nov 17 10:35:36 2009 +0000
@@ -8364,21 +8364,16 @@
   (defadvice file-expand-wildcards
     (around tramp-advice-file-expand-wildcards activate)
     (let ((name (ad-get-arg 0)))
-      (if (tramp-tramp-file-p name)
-	  ;; If it's a Tramp file, dissect it and look if wildcards
-	  ;; need to be expanded at all.
-	  (if (string-match
-	       "[[*?]"
-	       (tramp-file-name-localname (tramp-dissect-file-name name)))
-	      (progn
-		ad-do-it
-		(unless ad-return-value
-		  (setq ad-return-value (list name))))
-	    (setq ad-return-value (list name)))
-	;; If it is not a Tramp file, just run the original function.
-	ad-do-it
-	(unless ad-return-value
-	  (setq ad-return-value (list name))))))
+      ;; If it's a Tramp file, dissect it and look if wildcards need
+      ;; to be expanded at all.
+      (if (and
+	   (tramp-tramp-file-p name)
+	   (not	(string-match
+		 "[[*?]"
+		 (tramp-file-name-localname (tramp-dissect-file-name name)))))
+	  (setq ad-return-value (list name))
+	;; Otherwise, just run the original function.
+	ad-do-it)))
   (add-hook
    'tramp-unload-hook
    (lambda ()