aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2013-09-03 12:23:10 -0400
committerStefan Monnier2013-09-03 12:23:10 -0400
commit9d3f707c59f69f357c8ff2cdea313bfe771dbfc4 (patch)
tree57fecfd37049271003af0f2ad168c031cc7ffe92
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.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/net/tramp-compat.el2
-rw-r--r--lisp/net/tramp.el25
3 files changed, 21 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 49c6caeceb7..fdd8bdabe64 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12013-09-03 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * net/tramp.el (with-parsed-tramp-file-name): Silence compiler
4 warnings, and factor our common code.
5
12013-09-03 Dmitry Gutov <dgutov@yandex.ru> 62013-09-03 Dmitry Gutov <dgutov@yandex.ru>
2 7
3 * progmodes/ruby-mode.el (ruby-calculate-indent): Consider 8 * progmodes/ruby-mode.el (ruby-calculate-indent): Consider
@@ -7,8 +12,8 @@
72013-09-02 Fabián Ezequiel Gallina <fgallina@gnu.org> 122013-09-02 Fabián Ezequiel Gallina <fgallina@gnu.org>
8 13
9 Format code sent to Python shell for robustness. 14 Format code sent to Python shell for robustness.
10 * progmodes/python.el (python-shell-buffer-substring): New 15 * progmodes/python.el (python-shell-buffer-substring):
11 function. 16 New function.
12 (python-shell-send-region, python-shell-send-buffer): Use it. 17 (python-shell-send-region, python-shell-send-buffer): Use it.
13 18
142013-09-02 Michael Albinus <michael.albinus@gmx.de> 192013-09-02 Michael Albinus <michael.albinus@gmx.de>
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))