aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus2017-08-22 16:22:33 +0200
committerMichael Albinus2017-08-22 16:22:33 +0200
commit336707efb3d173c396ac522490ef2b1b6664eebf (patch)
tree38fcba9e9fe74e9adf11e3101d6832553e5ad43a /lisp
parentee9392a699a5b674388e650c61405cbe3b94e852 (diff)
downloademacs-336707efb3d173c396ac522490ef2b1b6664eebf.tar.gz
emacs-336707efb3d173c396ac522490ef2b1b6664eebf.zip
Test `file-expand-wildcards' for Tramp
* lisp/net/tramp-compat.el (tramp-advice-file-expand-wildcards): Remove, not needed anymore. * test/lisp/net/tramp-tests.el (top): Require seq.el. (tramp-test16-directory-files): Simplify. (tramp-test16-file-expand-wildcards): New test. (tramp-test28-interrupt-process): Skip for older Emacsen.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/tramp-compat.el27
1 files changed, 0 insertions, 27 deletions
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index b2df4d6324b..9a50d624487 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -50,33 +50,6 @@
50 `(when (functionp ,function) 50 `(when (functionp ,function)
51 (with-no-warnings (funcall ,function ,@arguments)))) 51 (with-no-warnings (funcall ,function ,@arguments))))
52 52
53;; We currently use "[" and "]" in the filename format for IPv6 hosts
54;; of GNU Emacs. This means that Emacs wants to expand wildcards if
55;; `find-file-wildcards' is non-nil, and then barfs because no
56;; expansion could be found. We detect this situation and do
57;; something really awful: we have `file-expand-wildcards' return the
58;; original filename if it can't expand anything. Let's just hope
59;; that this doesn't break anything else. It is not needed anymore
60;; since GNU Emacs 23.2.
61(unless (featurep 'files 'remote-wildcards)
62 (defadvice file-expand-wildcards
63 (around tramp-advice-file-expand-wildcards activate)
64 (let ((name (ad-get-arg 0)))
65 ;; If it's a Tramp file, look if wildcards need to be expanded
66 ;; at all.
67 (if (and
68 (tramp-tramp-file-p name)
69 (not (string-match "[[*?]" (file-remote-p name 'localname))))
70 (setq ad-return-value (list name))
71 ;; Otherwise, just run the original function.
72 ad-do-it)))
73 (add-hook
74 'tramp-unload-hook
75 (lambda ()
76 (ad-remove-advice
77 'file-expand-wildcards 'around 'tramp-advice-file-expand-wildcards)
78 (ad-activate 'file-expand-wildcards))))
79
80(defsubst tramp-compat-temporary-file-directory () 53(defsubst tramp-compat-temporary-file-directory ()
81 "Return name of directory for temporary files. 54 "Return name of directory for temporary files.
82It is the default value of `temporary-file-directory'." 55It is the default value of `temporary-file-directory'."