# HG changeset patch # User Michael Albinus # Date 1144957864 0 # Node ID 2578326defd679873bce448c2fb0affe3ddfb9f7 # Parent a186cf26482b18e3569c54481ede8d75df412a2c * net/tramp.el (tramp-display-shell-command-buffer): New defvar. (tramp-handle-shell-command): Display output buffer only when `tramp-display-shell-command-buffer' is true. (tramp-handle-process-file): Set `tramp-display-shell-command-buffer'. diff -r a186cf26482b -r 2578326defd6 lisp/ChangeLog --- a/lisp/ChangeLog Thu Apr 13 16:41:10 2006 +0000 +++ b/lisp/ChangeLog Thu Apr 13 19:51:04 2006 +0000 @@ -1,3 +1,10 @@ +2006-04-13 Michael Albinus + + * net/tramp.el (tramp-display-shell-command-buffer): New defvar. + (tramp-handle-shell-command): Display output buffer only when + `tramp-display-shell-command-buffer' is true. + (tramp-handle-process-file): Set `tramp-display-shell-command-buffer'. + 2006-04-13 Carsten Dominik * textmodes/org.el (org-set-autofill-regexps): Set only the local diff -r a186cf26482b -r 2578326defd6 lisp/net/tramp.el --- a/lisp/net/tramp.el Thu Apr 13 16:41:10 2006 +0000 +++ b/lisp/net/tramp.el Thu Apr 13 19:51:04 2006 +0000 @@ -3584,6 +3584,10 @@ "Global variable keeping asynchronous process object. Used in `tramp-handle-shell-command'") +(defvar tramp-display-shell-command-buffer t + "Whether to display output buffer of `shell-command'. +This is necessary for handling DISPLAY of `process-file'.") + (defun tramp-handle-shell-command (command &optional output-buffer error-buffer) "Like `shell-command' for tramp files. This will break if COMMAND prints a newline, followed by the value of @@ -3692,7 +3696,8 @@ (skip-chars-forward "^ ") (setq status (read (current-buffer))))) (unless (zerop (buffer-size)) - (display-buffer output-buffer)) + (when tramp-display-shell-command-buffer + (display-buffer output-buffer))) status)) ;; The following is only executed if something strange was ;; happening. Emit a helpful message and do it anyway. @@ -3707,11 +3712,10 @@ (when (and (numberp buffer) (zerop buffer)) (error "Implementation does not handle immediate return")) (when (consp buffer) (error "Implementation does not handle error files")) - (shell-command - (mapconcat 'tramp-shell-quote-argument - (cons program args) - " ") - buffer)) + (let ((tramp-display-shell-command-buffer display)) + (shell-command + (mapconcat 'tramp-shell-quote-argument (cons program args) " ") + buffer))) ;; File Editing.