emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/crux 4302357 052/112: Make crux-visit-term-buffer ask to r


From: ELPA Syncer
Subject: [nongnu] elpa/crux 4302357 052/112: Make crux-visit-term-buffer ask to restart dead process (#36)
Date: Wed, 11 Aug 2021 09:57:51 -0400 (EDT)

branch: elpa/crux
commit 430235753cda1e9af75d209e36a2c9c4f6599a80
Author: Justin Burkett <justin@burkett.cc>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>

    Make crux-visit-term-buffer ask to restart dead process (#36)
---
 crux.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/crux.el b/crux.el
index 579816d..9fe00f2 100644
--- a/crux.el
+++ b/crux.el
@@ -120,11 +120,16 @@ the current buffer."
     (switch-to-buffer-other-window buffer-name)))
 
 (defun crux-visit-term-buffer ()
-  "Create or visit a terminal buffer."
+  "Create or visit a terminal buffer.
+If the process in that buffer died, ask to restart."
   (interactive)
   (crux-start-or-switch-to (lambda ()
                              (ansi-term crux-shell (concat 
crux-term-buffer-name "-term")))
-                           (format "*%s-term*" crux-term-buffer-name)))
+                           (format "*%s-term*" crux-term-buffer-name))
+  (when (and (null (get-buffer-process (current-buffer)))
+             (y-or-n-p "The process has died. Do you want to restart it? "))
+    (kill-buffer-and-window)
+    (crux-visit-term-buffer)))
 
 (defun crux-indent-rigidly-and-copy-to-clipboard (begin end arg)
   "Indent region between BEGIN and END by ARG columns and copy to clipboard."



reply via email to

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