aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net
diff options
context:
space:
mode:
authorStefan Monnier2013-09-03 12:23:10 -0400
committerStefan Monnier2013-09-03 12:23:10 -0400
commit9d3f707c59f69f357c8ff2cdea313bfe771dbfc4 (patch)
tree57fecfd37049271003af0f2ad168c031cc7ffe92 /lisp/net
parentbc923770d292650f38458a220343929b9973ba90 (diff)
downloademacs-9d3f707c59f69f357c8ff2cdea313bfe771dbfc4.tar.gz
emacs-9d3f707c59f69f357c8ff2cdea313bfe771dbfc4.zip
* lisp/net/tramp.el (with-parsed-tramp-file-name): Silence compiler
warnings, and factor our common code.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp-compat.el2
-rw-r--r--lisp/net/tramp.el25
2 files changed, 14 insertions, 13 deletions
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 3081c45cc7d..8f9d9d8fee5 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -186,7 +186,7 @@
186;; `with-temp-message' does not exist in XEmacs. 186;; `with-temp-message' does not exist in XEmacs.
187(if (fboundp 'with-temp-message) 187(if (fboundp 'with-temp-message)
188 (defalias 'tramp-compat-with-temp-message 'with-temp-message) 188 (defalias 'tramp-compat-with-temp-message 'with-temp-message)
189 (defmacro tramp-compat-with-temp-message (message &rest body) 189 (defmacro tramp-compat-with-temp-message (_message &rest body)
190 "Display MESSAGE temporarily if non-nil while BODY is evaluated." 190 "Display MESSAGE temporarily if non-nil while BODY is evaluated."
191 `(progn ,@body))) 191 `(progn ,@body)))
192 192
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index ff0200c1161..6c3ae376dc3 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1632,18 +1632,19 @@ Remaining args are Lisp expressions to be evaluated (inside an implicit
1632 1632
1633If VAR is nil, then we bind `v' to the structure and `method', `user', 1633If VAR is nil, then we bind `v' to the structure and `method', `user',
1634`host', `localname', `hop' to the components." 1634`host', `localname', `hop' to the components."
1635 `(let* ((,(or var 'v) (tramp-dissect-file-name ,filename)) 1635 (let ((bindings
1636 (,(if var (intern (concat (symbol-name var) "-method")) 'method) 1636 (mapcar (lambda (elem)
1637 (tramp-file-name-method ,(or var 'v))) 1637 `(,(if var (intern (format "%s-%s" var elem)) elem)
1638 (,(if var (intern (concat (symbol-name var) "-user")) 'user) 1638 (,(intern (format "tramp-file-name-%s" elem))
1639 (tramp-file-name-user ,(or var 'v))) 1639 ,(or var 'v))))
1640 (,(if var (intern (concat (symbol-name var) "-host")) 'host) 1640 '(method user host localname hop))))
1641 (tramp-file-name-host ,(or var 'v))) 1641 `(let* ((,(or var 'v) (tramp-dissect-file-name ,filename))
1642 (,(if var (intern (concat (symbol-name var) "-localname")) 'localname) 1642 ,@bindings)
1643 (tramp-file-name-localname ,(or var 'v))) 1643 ;; We don't know which of those vars will be used, so we bind them all,
1644 (,(if var (intern (concat (symbol-name var) "-hop")) 'hop) 1644 ;; and then add here a dummy use of all those variables, so we don't get
1645 (tramp-file-name-hop ,(or var 'v)))) 1645 ;; flooded by warnings about those vars `body' didn't use.
1646 ,@body)) 1646 (ignore ,@(mapcar #'car bindings))
1647 ,@body)))
1647 1648
1648(put 'with-parsed-tramp-file-name 'lisp-indent-function 2) 1649(put 'with-parsed-tramp-file-name 'lisp-indent-function 2)
1649(put 'with-parsed-tramp-file-name 'edebug-form-spec '(form symbolp body)) 1650(put 'with-parsed-tramp-file-name 'edebug-form-spec '(form symbolp body))