Update with all your recent suggestions, is this more like it? --- lisp/ChangeLog | 8 ++++++++ lisp/tramp.el | 31 +++++++++++++++++++------------ 2 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4a9d8cb..0cafcf2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,13 @@ 2009-08-18 Julian Scheid <[email protected]> + * tramp.el (tramp-process-inhibit-flush): New defvar. + (tramp-vc-registered-read-file-names): Set + tramp-process-inhibit-flush. + (tramp-handle-process-file): Merge three remote ops into one. Do + not flush all caches when tramp-process-inhibit-flush is set. + +2009-08-18 Julian Scheid <[email protected]> + * tramp.el (tramp-check-cached-permissions) New defun. (tramp-handle-file-readable-p): Use it. (tramp-handle-file-writable-p): Likewise. diff --git a/lisp/tramp.el b/lisp/tramp.el index 854ac8c..b452897 100644 --- a/lisp/tramp.el +++ b/lisp/tramp.el @@ -4190,6 +4190,11 @@ beginning of local filename are not substituted." (tramp-set-connection-property v "process-name" nil) (tramp-set-connection-property v "process-buffer" nil)))) +(defvar tramp-process-inhibit-flush nil + "When non-nil, do not flush all file and directory caches for +the current connection when an external process is invoked on the +remote host.") + (defun tramp-handle-process-file (program &optional infile destination display &rest args) "Like `process-file' for Tramp files." @@ -4254,20 +4259,20 @@ beginning of local filename are not substituted." (setq outbuf (current-buffer)))) (when stderr (setq command (format "%s 2>%s" command stderr))) - ;; Goto working directory. - (tramp-send-command - v (format "cd %s" (tramp-shell-quote-argument localname))) ;; Send the command. It might not return in time, so we protect it. (condition-case nil (unwind-protect - (tramp-send-command v command) + (setq ret + (tramp-send-command-and-check + v (format "\\cd %s; %s" + (tramp-shell-quote-argument localname) + command))) ;; We should show the output anyway. (when outbuf - (let ((output-string - (with-current-buffer (tramp-get-connection-buffer v) - (buffer-substring (point-min) (point-max))))) - (with-current-buffer outbuf - (insert output-string))) + (with-current-buffer outbuf + (insert + (with-current-buffer (tramp-get-buffer v) + (buffer-string)))) (when display (display-buffer outbuf)))) ;; When the user did interrupt, we should do it also. We use ;; return code -1 as marker. @@ -4279,14 +4284,15 @@ beginning of local filename are not substituted." (kill-buffer (tramp-get-connection-buffer v)) (setq ret 1))) - ;; Check return code. - (unless ret (setq ret (tramp-send-command-and-check v nil))) ;; Provide error file. (when tmpstderr (rename-file tmpstderr (cadr destination) t)) ;; Cleanup. We remove all file cache values for the connection, ;; because the remote process could have changed them. (when tmpinput (delete-file tmpinput)) - (tramp-flush-directory-property v "") + + (unless tramp-process-inhibit-flush + (tramp-flush-directory-property v "")) + ;; Return exit status. (if (equal ret -1) (keyboard-quit) @@ -4963,6 +4969,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." (with-parsed-tramp-file-name file nil (let (tramp-vc-registered-file-names (tramp-cache-inhibit-cache (current-time)) + (tramp-process-inhibit-flush t) (file-name-handler-alist `((,tramp-file-name-regexp . tramp-vc-file-name-handler)))) -- 1.6.4 _______________________________________________ Tramp-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/tramp-devel
