From: Michael Albinus Date: Tue, 17 Nov 2009 10:38:44 +0000 (+0000) Subject: * net/tramp.el (tramp-advice-file-expand-wildcards): Simplify. X-Git-Tag: emacs-pretest-23.1.90~370 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e268e987dccd39b3ae6aa61a558e9d5b8349b8d7;p=emacs.git * net/tramp.el (tramp-advice-file-expand-wildcards): Simplify. Don't set `ad-return-value' if `ad-do-it' doesn't. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 409bcfa20bd..58ea6df92db 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-11-17 Michael Albinus + + * net/tramp.el (tramp-advice-file-expand-wildcards): Simplify. + Don't set `ad-return-value' if `ad-do-it' doesn't. + 2009-11-17 Jan Djärv * menu-bar.el: Put "Use system font" in Option-menu. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index ec2ae75e151..dc755d04a4a 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -8364,21 +8364,16 @@ Only works for Bourne-like shells." (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 ()