summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2013-11-05 15:18:41 +0100
committerMichael Albinus <michael.albinus@gmx.de>2013-11-05 15:18:41 +0100
commit158262615caff45976d334f79ff066d565682f1a (patch)
tree7efa26dd044a027a0463837a40097a88d00a8351 /lisp
parent95a23e62a95e69dbe9235c57a8bc71b549714ac3 (diff)
downloademacs-158262615caff45976d334f79ff066d565682f1a.tar.gz
emacs-158262615caff45976d334f79ff066d565682f1a.tar.bz2
emacs-158262615caff45976d334f79ff066d565682f1a.zip
Fix problems found while writing a test suite.
* net/tramp-compat.el (tramp-compat-load): New defun. * net/tramp.el (tramp-handle-load): Use it. * net/tramp-sh.el (tramp-sh-handle-add-name-to-file): Handle the case "(numberp ok-if-already-exists)" correctly.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/net/tramp-compat.el7
-rw-r--r--lisp/net/tramp-sh.el12
-rw-r--r--lisp/net/tramp.el3
4 files changed, 24 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fe43c7ad0aa..10dbbf92b84 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
+2013-11-05 Michael Albinus <michael.albinus@gmx.de>
+
+ Fix problems found while writing a test suite.
+
+ * net/tramp-compat.el (tramp-compat-load): New defun.
+ * net/tramp.el (tramp-handle-load): Use it.
+
+ * net/tramp-sh.el (tramp-sh-handle-add-name-to-file): Handle the case
+ "(numberp ok-if-already-exists)" correctly.
+
2013-11-05 Xue Fuqiao <xfq.free@gmail.com>
* international/characters.el (glyphless-char-display-control):
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index c5f1882931e..8322b7c085b 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -416,6 +416,13 @@ Not actually used. Use `(format \"%o\" i)' instead?"
directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")))
(delete-directory directory))))
+;; MUST-SUFFIX doesn't exist on XEmacs.
+(defun tramp-compat-load (file &optional noerror nomessage nosuffix must-suffix)
+ "Like `load' for Tramp files (compat function)."
+ (if must-suffix
+ (tramp-compat-funcall 'load file noerror nomessage nosuffix must-suffix)
+ (load file noerror nomessage nosuffix)))
+
;; `number-sequence' does not exist in XEmacs. Implementation is
;; taken from Emacs 23.
(defun tramp-compat-number-sequence (from &optional to inc)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 360a22d0c37..f8b99dd918e 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1784,21 +1784,21 @@ tramp-sh-handle-file-name-all-completions: internal error accessing `%s': `%s'"
(with-parsed-tramp-file-name filename v1
(with-parsed-tramp-file-name newname v2
(let ((ln (when v1 (tramp-get-remote-ln v1))))
- (when (and (not ok-if-already-exists)
+ (when (and (numberp ok-if-already-exists)
(file-exists-p newname)
- (not (numberp ok-if-already-exists))
- (y-or-n-p
+ (yes-or-no-p
(format
"File %s already exists; make it a new name anyway? "
newname)))
(tramp-error
- v2 'file-error
- "add-name-to-file: file %s already exists" newname))
+ v2 'file-error "add-name-to-file: file %s already exists" newname))
+ (when ok-if-already-exists (setq ln (concat ln " -f")))
(tramp-flush-file-property v2 (file-name-directory v2-localname))
(tramp-flush-file-property v2 v2-localname)
(tramp-barf-unless-okay
v1
- (format "%s %s %s" ln (tramp-shell-quote-argument v1-localname)
+ (format "%s %s %s" ln
+ (tramp-shell-quote-argument v1-localname)
(tramp-shell-quote-argument v2-localname))
"error with add-name-to-file, see buffer `%s' for details"
(buffer-name))))))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 43bec3bde3b..630208a8fbe 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3150,9 +3150,8 @@ User is always nil."
(let ((tramp-message-show-message (not nomessage)))
(with-tramp-progress-reporter v 0 (format "Loading %s" file)
(let ((local-copy (file-local-copy file)))
- ;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil.
(unwind-protect
- (load local-copy noerror t t)
+ (tramp-compat-load local-copy noerror t nosuffix must-suffix)
(delete-file local-copy)))))
t)))