emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 25b2277: * lisp/shell.el (shell-mode): Check if buf


From: Juri Linkov
Subject: [Emacs-diffs] master 25b2277: * lisp/shell.el (shell-mode): Check if buffer has a live process.
Date: Wed, 4 Apr 2018 16:44:04 -0400 (EDT)

branch: master
commit 25b22772a7149a5207e4693f149718329a25e135
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    * lisp/shell.el (shell-mode): Check if buffer has a live process.
    
    (Bug#31028)
---
 lisp/shell.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/shell.el b/lisp/shell.el
index 5c228a5..d4a0556 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -568,8 +568,10 @@ buffer."
   (setq list-buffers-directory (expand-file-name default-directory))
   ;; shell-dependent assignments.
   (when (ring-empty-p comint-input-ring)
-    (let ((shell (file-name-nondirectory (car
-                  (process-command (get-buffer-process (current-buffer))))))
+    (let ((shell (if (get-buffer-process (current-buffer))
+                     (file-name-nondirectory
+                      (car (process-command (get-buffer-process 
(current-buffer)))))
+                   ""))
          (hsize (getenv "HISTSIZE")))
       (and (stringp hsize)
           (integerp (setq hsize (string-to-number hsize)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]