summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorLars Hansen <larsh@soem.dk>2006-10-29 12:55:35 +0000
committerLars Hansen <larsh@soem.dk>2006-10-29 12:55:35 +0000
commit8e7225a26292e10aff20e01c27d93fa9d5fa17a8 (patch)
treef54ae7861599f7a38ef7a992106421bf65141517 /lisp/net
parentb90a614915352447f3b5de4f17d304ac7813bcfd (diff)
downloademacs-8e7225a26292e10aff20e01c27d93fa9d5fa17a8.tar.gz
(with-parsed-tramp-file-name): Correct debug spec. Highlight as keyword.
(tramp-do-copy-or-rename-file): Correct data for 'file-already-exists. Don't call tramp-method-out-of-band-p for local files. (tramp-touch): Quote file name.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp.el21
1 files changed, 10 insertions, 11 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 97b08e7e704..0b914a811d1 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2018,11 +2018,10 @@ If VAR is nil, then we bind `v' to the structure and `multi-method',
,@body))
(put 'with-parsed-tramp-file-name 'lisp-indent-function 2)
-;; To be activated for debugging containing this macro
-;; It works only when VAR is nil. Otherwise, it can be deactivated by
-;; (put 'with-parsed-tramp-file-name 'edebug-form-spec 0)
-;; I'm too stupid to write a precise SPEC for it.
-(put 'with-parsed-tramp-file-name 'edebug-form-spec t)
+;; Enable debugging.
+(def-edebug-spec with-parsed-tramp-file-name (form symbolp body))
+;; Highlight as keyword.
+(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-parsed-tramp-file-name\\>"))
(defmacro tramp-let-maybe (variable value &rest body)
"Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete.
@@ -2905,7 +2904,7 @@ and `rename'. FILENAME and NEWNAME must be absolute file names."
(unless ok-if-already-exists
(when (file-exists-p newname)
(signal 'file-already-exists
- (list newname))))
+ (list "File already exists" newname))))
(let ((t1 (tramp-tramp-file-p filename))
(t2 (tramp-tramp-file-p newname))
v1-multi-method v1-method v1-user v1-host v1-localname
@@ -2978,10 +2977,10 @@ and `rename'. FILENAME and NEWNAME must be absolute file names."
;; copy-program can be invoked.
(if (and (not v1-multi-method)
(not v2-multi-method)
- (or (tramp-method-out-of-band-p
- v1-multi-method v1-method v1-user v1-host)
- (tramp-method-out-of-band-p
- v2-multi-method v2-method v2-user v2-host)))
+ (or (and t1 (tramp-method-out-of-band-p
+ v1-multi-method v1-method v1-user v1-host))
+ (and t2 (tramp-method-out-of-band-p
+ v2-multi-method v2-method v2-user v2-host))))
(tramp-do-copy-or-rename-file-out-of-band
op filename newname keep-date)
;; Use the generic method via a Tramp buffer.
@@ -5045,7 +5044,7 @@ TIME is an Emacs internal time value as returned by `current-time'."
multi-method method user host
(format "TZ=UTC; export TZ; touch -t %s %s"
touch-time
- localname)
+ (tramp-shell-quote-argument localname))
t))
(pop-to-buffer buf)
(error "tramp-touch: touch failed, see buffer `%s' for details"