aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2013-11-11 16:18:07 +0100
committerMichael Albinus2013-11-11 16:18:07 +0100
commit7ce8fcc3224e694afb7add9461e56687ad317868 (patch)
tree54c8a49a9334c53d2ebbdfae81dc41bd5ab28d35
parent7818df11b85d4829b61f6d967aa421621985b18a (diff)
downloademacs-7ce8fcc3224e694afb7add9461e56687ad317868.tar.gz
emacs-7ce8fcc3224e694afb7add9461e56687ad317868.zip
* 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.
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/net/tramp-sh.el8
-rw-r--r--lisp/net/tramp-smb.el24
3 files changed, 33 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1e1992fae2a..7c4c76eeb12 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12013-11-11 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp-sh.el (tramp-do-copy-or-rename-file-via-buffer)
4 (tramp-sh-handle-file-local-copy): Don't write a message when
5 saving temporary files.
6
7 * net/tramp-smb.el (tramp-smb-handle-copy-directory): Fix bug when
8 both directories are remote.
9 (tramp-smb-handle-directory-files): Do not return double entries.
10 Do not expand full file names.
11 (tramp-smb-handle-insert-directory): Accept nil SWITCHES.
12 (tramp-smb-handle-write-region): Implement APPEND.
13 (tramp-smb-get-stat-capability): Fix a stupid bug.
14
12013-11-11 Stefan Monnier <monnier@iro.umontreal.ca> 152013-11-11 Stefan Monnier <monnier@iro.umontreal.ca>
2 16
3 * bindings.el (ctl-x-map): Bind C-x SPC to rectangle-mark-mode. 17 * bindings.el (ctl-x-map): Bind C-x SPC to rectangle-mark-mode.
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 9b15c3655e0..8bed62d7190 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2013,7 +2013,7 @@ KEEP-DATE is non-nil if NEWNAME should have the same timestamp as FILENAME."
2013 ;; `jka-compr-inhibit' to t. 2013 ;; `jka-compr-inhibit' to t.
2014 (let ((coding-system-for-write 'binary) 2014 (let ((coding-system-for-write 'binary)
2015 (jka-compr-inhibit t)) 2015 (jka-compr-inhibit t))
2016 (write-region (point-min) (point-max) newname))) 2016 (write-region (point-min) (point-max) newname nil 'no-message)))
2017 ;; KEEP-DATE handling. 2017 ;; KEEP-DATE handling.
2018 (when keep-date (set-file-times newname (nth 5 (file-attributes filename)))) 2018 (when keep-date (set-file-times newname (nth 5 (file-attributes filename))))
2019 ;; Set the mode. 2019 ;; Set the mode.
@@ -2932,7 +2932,8 @@ the result will be a local, non-Tramp, filename."
2932 ;; epa-file gets confused. 2932 ;; epa-file gets confused.
2933 (let (file-name-handler-alist 2933 (let (file-name-handler-alist
2934 (coding-system-for-write 'binary)) 2934 (coding-system-for-write 'binary))
2935 (write-region (point-min) (point-max) tmpfile))) 2935 (write-region
2936 (point-min) (point-max) tmpfile nil 'no-message)))
2936 2937
2937 ;; If tramp-decoding-function is not defined for this 2938 ;; If tramp-decoding-function is not defined for this
2938 ;; method, we invoke tramp-decoding-command instead. 2939 ;; method, we invoke tramp-decoding-command instead.
@@ -2942,7 +2943,8 @@ the result will be a local, non-Tramp, filename."
2942 (let (file-name-handler-alist 2943 (let (file-name-handler-alist
2943 (coding-system-for-write 'binary)) 2944 (coding-system-for-write 'binary))
2944 (with-current-buffer (tramp-get-buffer v) 2945 (with-current-buffer (tramp-get-buffer v)
2945 (write-region (point-min) (point-max) tmpfile2))) 2946 (write-region
2947 (point-min) (point-max) tmpfile2 nil 'no-message)))
2946 (unwind-protect 2948 (unwind-protect
2947 (tramp-call-local-coding-command 2949 (tramp-call-local-coding-command
2948 loc-dec tmpfile2 tmpfile) 2950 loc-dec tmpfile2 tmpfile)
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 4f294050bb9..e322b6764a1 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -411,10 +411,12 @@ pass to the OPERATION."
411 (tramp-compat-temporary-file-directory))))) 411 (tramp-compat-temporary-file-directory)))))
412 (unwind-protect 412 (unwind-protect
413 (progn 413 (progn
414 (make-directory tmpdir)
414 (tramp-compat-copy-directory 415 (tramp-compat-copy-directory
415 dirname tmpdir keep-date parents) 416 dirname tmpdir keep-date 'parents)
416 (tramp-compat-copy-directory 417 (tramp-compat-copy-directory
417 tmpdir newname keep-date parents)) 418 (expand-file-name (file-name-nondirectory dirname) tmpdir)
419 newname keep-date parents))
418 (tramp-compat-delete-directory tmpdir 'recursive)))) 420 (tramp-compat-delete-directory tmpdir 'recursive))))
419 421
420 ;; We can copy recursively. 422 ;; We can copy recursively.
@@ -640,7 +642,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
640 (directory &optional full match nosort) 642 (directory &optional full match nosort)
641 "Like `directory-files' for Tramp files." 643 "Like `directory-files' for Tramp files."
642 (let ((result (mapcar 'directory-file-name 644 (let ((result (mapcar 'directory-file-name
643 (file-name-all-completions "" directory)))) 645 (file-name-all-completions "" directory)))
646 res)
644 ;; Discriminate with regexp. 647 ;; Discriminate with regexp.
645 (when match 648 (when match
646 (setq result 649 (setq result
@@ -651,12 +654,13 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
651 (when full 654 (when full
652 (setq result 655 (setq result
653 (mapcar 656 (mapcar
654 (lambda (x) (expand-file-name x directory)) 657 (lambda (x) (format "%s/%s" directory x))
655 result))) 658 result)))
656 ;; Sort them if necessary. 659 ;; Sort them if necessary.
657 (unless nosort (setq result (sort result 'string-lessp))) 660 (unless nosort (setq result (sort result 'string-lessp)))
658 ;; That's it. 661 ;; Remove double entries.
659 result)) 662 (dolist (elt result res)
663 (add-to-list 'res elt 'append))))
660 664
661(defun tramp-smb-handle-expand-file-name (name &optional dir) 665(defun tramp-smb-handle-expand-file-name (name &optional dir)
662 "Like `expand-file-name' for Tramp files." 666 "Like `expand-file-name' for Tramp files."
@@ -924,6 +928,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
924 (filename switches &optional wildcard full-directory-p) 928 (filename switches &optional wildcard full-directory-p)
925 "Like `insert-directory' for Tramp files." 929 "Like `insert-directory' for Tramp files."
926 (setq filename (expand-file-name filename)) 930 (setq filename (expand-file-name filename))
931 (unless switches (setq switches ""))
927 (if full-directory-p 932 (if full-directory-p
928 ;; Called from `dired-add-entry'. 933 ;; Called from `dired-add-entry'.
929 (setq filename (file-name-as-directory filename)) 934 (setq filename (file-name-as-directory filename))
@@ -1441,9 +1446,6 @@ errors for shares like \"C$/\", which are common in Microsoft Windows."
1441 "Like `write-region' for Tramp files." 1446 "Like `write-region' for Tramp files."
1442 (setq filename (expand-file-name filename)) 1447 (setq filename (expand-file-name filename))
1443 (with-parsed-tramp-file-name filename nil 1448 (with-parsed-tramp-file-name filename nil
1444 (unless (eq append nil)
1445 (tramp-error
1446 v 'file-error "Cannot append to file using Tramp (`%s')" filename))
1447 ;; XEmacs takes a coding system as the seventh argument, not `confirm'. 1449 ;; XEmacs takes a coding system as the seventh argument, not `confirm'.
1448 (when (and (not (featurep 'xemacs)) 1450 (when (and (not (featurep 'xemacs))
1449 confirm (file-exists-p filename)) 1451 confirm (file-exists-p filename))
@@ -1456,6 +1458,8 @@ errors for shares like \"C$/\", which are common in Microsoft Windows."
1456 (tramp-flush-file-property v localname) 1458 (tramp-flush-file-property v localname)
1457 (let ((curbuf (current-buffer)) 1459 (let ((curbuf (current-buffer))
1458 (tmpfile (tramp-compat-make-temp-file filename))) 1460 (tmpfile (tramp-compat-make-temp-file filename)))
1461 (when (and append (file-exists-p filename))
1462 (copy-file filename tmpfile 'ok))
1459 ;; We say `no-message' here because we don't want the visited file 1463 ;; We say `no-message' here because we don't want the visited file
1460 ;; modtime data to be clobbered from the temp file. We call 1464 ;; modtime data to be clobbered from the temp file. We call
1461 ;; `set-visited-file-modtime' ourselves later on. 1465 ;; `set-visited-file-modtime' ourselves later on.
@@ -1727,7 +1731,7 @@ Result is the list (LOCALNAME MODE SIZE MTIME)."
1727 ;; When we are not logged in yet, we return nil. 1731 ;; When we are not logged in yet, we return nil.
1728 (if (and (tramp-smb-get-share vec) 1732 (if (and (tramp-smb-get-share vec)
1729 (let ((p (tramp-get-connection-process vec))) 1733 (let ((p (tramp-get-connection-process vec)))
1730 p (processp p) (memq (process-status p) '(run open)))) 1734 (and p (processp p) (memq (process-status p) '(run open)))))
1731 (with-tramp-connection-property 1735 (with-tramp-connection-property
1732 (tramp-get-connection-process vec) "stat-capability" 1736 (tramp-get-connection-process vec) "stat-capability"
1733 (tramp-smb-send-command vec "stat \"/\"")))) 1737 (tramp-smb-send-command vec "stat \"/\""))))