aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2013-11-05 15:18:41 +0100
committerMichael Albinus2013-11-05 15:18:41 +0100
commit158262615caff45976d334f79ff066d565682f1a (patch)
tree7efa26dd044a027a0463837a40097a88d00a8351
parent95a23e62a95e69dbe9235c57a8bc71b549714ac3 (diff)
downloademacs-158262615caff45976d334f79ff066d565682f1a.tar.gz
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.
-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 @@
12013-11-05 Michael Albinus <michael.albinus@gmx.de>
2
3 Fix problems found while writing a test suite.
4
5 * net/tramp-compat.el (tramp-compat-load): New defun.
6 * net/tramp.el (tramp-handle-load): Use it.
7
8 * net/tramp-sh.el (tramp-sh-handle-add-name-to-file): Handle the case
9 "(numberp ok-if-already-exists)" correctly.
10
12013-11-05 Xue Fuqiao <xfq.free@gmail.com> 112013-11-05 Xue Fuqiao <xfq.free@gmail.com>
2 12
3 * international/characters.el (glyphless-char-display-control): 13 * 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?"
416 directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))) 416 directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")))
417 (delete-directory directory)))) 417 (delete-directory directory))))
418 418
419;; MUST-SUFFIX doesn't exist on XEmacs.
420(defun tramp-compat-load (file &optional noerror nomessage nosuffix must-suffix)
421 "Like `load' for Tramp files (compat function)."
422 (if must-suffix
423 (tramp-compat-funcall 'load file noerror nomessage nosuffix must-suffix)
424 (load file noerror nomessage nosuffix)))
425
419;; `number-sequence' does not exist in XEmacs. Implementation is 426;; `number-sequence' does not exist in XEmacs. Implementation is
420;; taken from Emacs 23. 427;; taken from Emacs 23.
421(defun tramp-compat-number-sequence (from &optional to inc) 428(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'"
1784 (with-parsed-tramp-file-name filename v1 1784 (with-parsed-tramp-file-name filename v1
1785 (with-parsed-tramp-file-name newname v2 1785 (with-parsed-tramp-file-name newname v2
1786 (let ((ln (when v1 (tramp-get-remote-ln v1)))) 1786 (let ((ln (when v1 (tramp-get-remote-ln v1))))
1787 (when (and (not ok-if-already-exists) 1787 (when (and (numberp ok-if-already-exists)
1788 (file-exists-p newname) 1788 (file-exists-p newname)
1789 (not (numberp ok-if-already-exists)) 1789 (yes-or-no-p
1790 (y-or-n-p
1791 (format 1790 (format
1792 "File %s already exists; make it a new name anyway? " 1791 "File %s already exists; make it a new name anyway? "
1793 newname))) 1792 newname)))
1794 (tramp-error 1793 (tramp-error
1795 v2 'file-error 1794 v2 'file-error "add-name-to-file: file %s already exists" newname))
1796 "add-name-to-file: file %s already exists" newname)) 1795 (when ok-if-already-exists (setq ln (concat ln " -f")))
1797 (tramp-flush-file-property v2 (file-name-directory v2-localname)) 1796 (tramp-flush-file-property v2 (file-name-directory v2-localname))
1798 (tramp-flush-file-property v2 v2-localname) 1797 (tramp-flush-file-property v2 v2-localname)
1799 (tramp-barf-unless-okay 1798 (tramp-barf-unless-okay
1800 v1 1799 v1
1801 (format "%s %s %s" ln (tramp-shell-quote-argument v1-localname) 1800 (format "%s %s %s" ln
1801 (tramp-shell-quote-argument v1-localname)
1802 (tramp-shell-quote-argument v2-localname)) 1802 (tramp-shell-quote-argument v2-localname))
1803 "error with add-name-to-file, see buffer `%s' for details" 1803 "error with add-name-to-file, see buffer `%s' for details"
1804 (buffer-name)))))) 1804 (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."
3150 (let ((tramp-message-show-message (not nomessage))) 3150 (let ((tramp-message-show-message (not nomessage)))
3151 (with-tramp-progress-reporter v 0 (format "Loading %s" file) 3151 (with-tramp-progress-reporter v 0 (format "Loading %s" file)
3152 (let ((local-copy (file-local-copy file))) 3152 (let ((local-copy (file-local-copy file)))
3153 ;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil.
3154 (unwind-protect 3153 (unwind-protect
3155 (load local-copy noerror t t) 3154 (tramp-compat-load local-copy noerror t nosuffix must-suffix)
3156 (delete-file local-copy))))) 3155 (delete-file local-copy)))))
3157 t))) 3156 t)))
3158 3157