[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r115061: * net/tramp-sh.el (tramp-do-copy-or-rename-
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] trunk r115061: * net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer) |
Date: |
Mon, 11 Nov 2013 15:18:15 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 115061
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Mon 2013-11-11 16:18:07 +0100
message:
* net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer)
(tramp-sh-handle-file-local-copy): Don't write a message when
saving temporary files.
* net/tramp-smb.el (tramp-smb-handle-copy-directory): Fix bug when
both directories are remote.
(tramp-smb-handle-directory-files): Do not return double entries.
Do not expand full file names.
(tramp-smb-handle-insert-directory): Accept nil SWITCHES.
(tramp-smb-handle-write-region): Implement APPEND.
(tramp-smb-get-stat-capability): Fix a stupid bug.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/net/tramp-sh.el trampsh.el-20100913133439-a1faifh29eqoi4nh-1
lisp/net/tramp-smb.el
trampsmb.el-20091113204419-o5vbwnq5f7feedwu-2515
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-11-11 05:18:53 +0000
+++ b/lisp/ChangeLog 2013-11-11 15:18:07 +0000
@@ -1,3 +1,17 @@
+2013-11-11 Michael Albinus <address@hidden>
+
+ * net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer)
+ (tramp-sh-handle-file-local-copy): Don't write a message when
+ saving temporary files.
+
+ * net/tramp-smb.el (tramp-smb-handle-copy-directory): Fix bug when
+ both directories are remote.
+ (tramp-smb-handle-directory-files): Do not return double entries.
+ Do not expand full file names.
+ (tramp-smb-handle-insert-directory): Accept nil SWITCHES.
+ (tramp-smb-handle-write-region): Implement APPEND.
+ (tramp-smb-get-stat-capability): Fix a stupid bug.
+
2013-11-11 Stefan Monnier <address@hidden>
* bindings.el (ctl-x-map): Bind C-x SPC to rectangle-mark-mode.
=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el 2013-11-10 08:35:04 +0000
+++ b/lisp/net/tramp-sh.el 2013-11-11 15:18:07 +0000
@@ -2013,7 +2013,7 @@
;; `jka-compr-inhibit' to t.
(let ((coding-system-for-write 'binary)
(jka-compr-inhibit t))
- (write-region (point-min) (point-max) newname)))
+ (write-region (point-min) (point-max) newname nil 'no-message)))
;; KEEP-DATE handling.
(when keep-date (set-file-times newname (nth 5 (file-attributes filename))))
;; Set the mode.
@@ -2932,7 +2932,8 @@
;; epa-file gets confused.
(let (file-name-handler-alist
(coding-system-for-write 'binary))
- (write-region (point-min) (point-max) tmpfile)))
+ (write-region
+ (point-min) (point-max) tmpfile nil 'no-message)))
;; If tramp-decoding-function is not defined for this
;; method, we invoke tramp-decoding-command instead.
@@ -2942,7 +2943,8 @@
(let (file-name-handler-alist
(coding-system-for-write 'binary))
(with-current-buffer (tramp-get-buffer v)
- (write-region (point-min) (point-max) tmpfile2)))
+ (write-region
+ (point-min) (point-max) tmpfile2 nil 'no-message)))
(unwind-protect
(tramp-call-local-coding-command
loc-dec tmpfile2 tmpfile)
=== modified file 'lisp/net/tramp-smb.el'
--- a/lisp/net/tramp-smb.el 2013-10-28 19:30:40 +0000
+++ b/lisp/net/tramp-smb.el 2013-11-11 15:18:07 +0000
@@ -411,10 +411,12 @@
(tramp-compat-temporary-file-directory)))))
(unwind-protect
(progn
- (tramp-compat-copy-directory
- dirname tmpdir keep-date parents)
- (tramp-compat-copy-directory
- tmpdir newname keep-date parents))
+ (make-directory tmpdir)
+ (tramp-compat-copy-directory
+ dirname tmpdir keep-date 'parents)
+ (tramp-compat-copy-directory
+ (expand-file-name (file-name-nondirectory dirname) tmpdir)
+ newname keep-date parents))
(tramp-compat-delete-directory tmpdir 'recursive))))
;; We can copy recursively.
@@ -640,7 +642,8 @@
(directory &optional full match nosort)
"Like `directory-files' for Tramp files."
(let ((result (mapcar 'directory-file-name
- (file-name-all-completions "" directory))))
+ (file-name-all-completions "" directory)))
+ res)
;; Discriminate with regexp.
(when match
(setq result
@@ -651,12 +654,13 @@
(when full
(setq result
(mapcar
- (lambda (x) (expand-file-name x directory))
+ (lambda (x) (format "%s/%s" directory x))
result)))
;; Sort them if necessary.
(unless nosort (setq result (sort result 'string-lessp)))
- ;; That's it.
- result))
+ ;; Remove double entries.
+ (dolist (elt result res)
+ (add-to-list 'res elt 'append))))
(defun tramp-smb-handle-expand-file-name (name &optional dir)
"Like `expand-file-name' for Tramp files."
@@ -924,6 +928,7 @@
(filename switches &optional wildcard full-directory-p)
"Like `insert-directory' for Tramp files."
(setq filename (expand-file-name filename))
+ (unless switches (setq switches ""))
(if full-directory-p
;; Called from `dired-add-entry'.
(setq filename (file-name-as-directory filename))
@@ -1441,9 +1446,6 @@
"Like `write-region' for Tramp files."
(setq filename (expand-file-name filename))
(with-parsed-tramp-file-name filename nil
- (unless (eq append nil)
- (tramp-error
- v 'file-error "Cannot append to file using Tramp (`%s')" filename))
;; XEmacs takes a coding system as the seventh argument, not `confirm'.
(when (and (not (featurep 'xemacs))
confirm (file-exists-p filename))
@@ -1456,6 +1458,8 @@
(tramp-flush-file-property v localname)
(let ((curbuf (current-buffer))
(tmpfile (tramp-compat-make-temp-file filename)))
+ (when (and append (file-exists-p filename))
+ (copy-file filename tmpfile 'ok))
;; We say `no-message' here because we don't want the visited file
;; modtime data to be clobbered from the temp file. We call
;; `set-visited-file-modtime' ourselves later on.
@@ -1727,7 +1731,7 @@
;; When we are not logged in yet, we return nil.
(if (and (tramp-smb-get-share vec)
(let ((p (tramp-get-connection-process vec)))
- p (processp p) (memq (process-status p) '(run open))))
+ (and p (processp p) (memq (process-status p) '(run open)))))
(with-tramp-connection-property
(tramp-get-connection-process vec) "stat-capability"
(tramp-smb-send-command vec "stat \"/\""))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r115061: * net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer),
Michael Albinus <=