summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2006-04-13 19:51:04 +0000
committerMichael Albinus <michael.albinus@gmx.de>2006-04-13 19:51:04 +0000
commit32f9593c7c9103b02ac41cd671f02ba541fba48a (patch)
tree2f2db437058a586d5f6494221af21dd50d2c1d66 /lisp
parentbb1d56c87cb096fbe6930569e6a0542a2857af85 (diff)
downloademacs-32f9593c7c9103b02ac41cd671f02ba541fba48a.tar.gz
* 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'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/net/tramp.el16
2 files changed, 17 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b73aec79444..b2948a5cecc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-13 Michael Albinus <michael.albinus@gmx.de>
+
+ * 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 <dominik@science.uva.nl>
* textmodes/org.el (org-set-autofill-regexps): Set only the local
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 58f74133cd5..5abd3dd36e4 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3584,6 +3584,10 @@ the result will be a local, non-Tramp, filename."
"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 @@ This will break if COMMAND prints a newline, followed by the value of
(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 @@ This will break if COMMAND prints a newline, followed by the value of
(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.