]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix window position in Tramp's shell-command
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 10 Feb 2020 18:59:49 +0000 (19:59 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 10 Feb 2020 18:59:49 +0000 (19:59 +0100)
* lisp/net/tramp.el (tramp-handle-shell-command): Fix `window-start'
in output buffer.  (Bug#39171)

lisp/net/tramp.el

index 19d36c3a97b5a69e39efae4656723016d8cf6d5f..0e44656f2a455997c6216aee9c6b5b01d306378d 100644 (file)
@@ -3721,9 +3721,9 @@ support symbolic links."
            (if (process-live-p p)
              ;; Display output.
              (with-current-buffer output-buffer
-               (display-buffer output-buffer '(nil (allow-no-window . t)))
                (setq mode-line-process '(":%s"))
-               (shell-mode)
+               (unless (eq major-mode 'shell-mode)
+                 (shell-mode))
                (set-process-filter p #'comint-output-filter)
                (set-process-sentinel p #'shell-command-sentinel)
                (when error-file
@@ -3733,7 +3733,8 @@ support symbolic links."
                     (with-current-buffer error-buffer
                       (insert-file-contents-literally
                        error-file nil nil nil 'replace))
-                    (delete-file error-file)))))
+                    (delete-file error-file))))
+               (display-buffer output-buffer '(nil (allow-no-window . t))))
 
              (when error-file
                (delete-file error-file)))))