*** /home/albinus/src/tramp/lisp/tramp.el.~2.626.~ 2008-01-28 22:10:50.000000000 +0100 --- /home/albinus/src/tramp/lisp/tramp.el 2008-01-29 21:35:59.000000000 +0100 *************** *** 3789,3795 **** ((bufferp output-buffer) output-buffer) ((stringp output-buffer) (get-buffer-create output-buffer)) (output-buffer (current-buffer)) ! (t (generate-new-buffer (if asynchronous "*Async Shell Command*" "*Shell Command Output*"))))) --- 3789,3795 ---- ((bufferp output-buffer) output-buffer) ((stringp output-buffer) (get-buffer-create output-buffer)) (output-buffer (current-buffer)) ! (t (get-buffer-create (if asynchronous "*Async Shell Command*" "*Shell Command Output*"))))) *************** *** 3801,3822 **** (if (and (not asynchronous) error-buffer) (with-parsed-tramp-file-name default-directory nil (list output-buffer (tramp-make-tramp-temp-file v))) ! output-buffer))) ! (prog1 ! ;; Run the process. ! (if (integerp asynchronous) (apply 'start-file-process "*Async Shell*" buffer args) ! (apply 'process-file (car args) nil buffer nil (cdr args))) ! ;; Insert error messages if they were separated. ! (when (listp buffer) ! (with-current-buffer error-buffer (insert-file-contents (cadr buffer))) ! (delete-file (cadr buffer))) ! ;; There's some output, display it. ! (when (with-current-buffer output-buffer (> (point-max) (point-min))) ! (if (functionp 'display-message-or-buffer) ! (funcall (symbol-function 'display-message-or-buffer) output-buffer) ! (pop-to-buffer output-buffer)))))) ;; File Editing. --- 3801,3842 ---- (if (and (not asynchronous) error-buffer) (with-parsed-tramp-file-name default-directory nil (list output-buffer (tramp-make-tramp-temp-file v))) ! output-buffer)) ! (proc (get-buffer-process output-buffer))) ! ;; Check whether there is another process running. Tramp does not ! ;; support 2 (asynchronous) processes in parallel. ! (when proc ! (if (yes-or-no-p "A command is running. Kill it? ") ! (ignore-errors (kill-process proc)) ! (error "Shell command in progress"))) ! ! (with-current-buffer output-buffer ! (setq buffer-read-only nil ! buffer-undo-list t) ! (erase-buffer)) ! ! (if (integerp asynchronous) ! (prog1 ! ;; Run the process. (apply 'start-file-process "*Async Shell*" buffer args) ! ;; Display output. ! (pop-to-buffer output-buffer)) ! ! (prog1 ! ;; Run the process. ! (apply 'process-file (car args) nil buffer nil (cdr args)) ! ;; Insert error messages if they were separated. ! (when (listp buffer) ! (with-current-buffer error-buffer ! (insert-file-contents (cadr buffer))) ! (delete-file (cadr buffer))) ! ;; There's some output, display it. ! (when (with-current-buffer output-buffer (> (point-max) (point-min))) ! (if (functionp 'display-message-or-buffer) ! (funcall (symbol-function 'display-message-or-buffer) ! output-buffer) ! (pop-to-buffer output-buffer))))))) ;; File Editing.