[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/detached 66bc2811fb 08/10: Add possibility to toggle in
From: |
ELPA Syncer |
Subject: |
[elpa] externals/detached 66bc2811fb 08/10: Add possibility to toggle initial-mode when rerun |
Date: |
Thu, 27 Oct 2022 02:57:38 -0400 (EDT) |
branch: externals/detached
commit 66bc2811fb9f70b431bd149945c6939940736e22
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Add possibility to toggle initial-mode when rerun
This patch makes it convenient to toggle the initial-mode of a session
when it is being rerun. Previously the user could only avoid attaching
to a session, but this change can also revert that decision.
---
detached-list.el | 22 ++++++++++++++--------
detached.el | 5 ++++-
2 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/detached-list.el b/detached-list.el
index 1dda53fe43..6d71959ccc 100644
--- a/detached-list.el
+++ b/detached-list.el
@@ -213,19 +213,25 @@ Optionally DELETE the session if prefix-argument is
provided."
detached-list-open-session-display-buffer-action))
(detached-view-dwim session)))
-(defun detached-list-rerun-session (session &optional suppress-output)
+(defun detached-list-rerun-session (session &optional toggle-suppress-output)
"Rerun SESSION at point.
-Optionally SUPPRESS-OUTPUT."
+Optionally TOGGLE-SUPPRESS-OUTPUT."
(interactive
(list (tabulated-list-get-id)
current-prefix-arg))
- (when (eq 'create-and-attach (detached--session-initial-mode session))
- (when-let ((single-window (> (length (window-list)) 1))
- (buffer (current-buffer)))
- (delete-window (get-buffer-window))
- (bury-buffer buffer)))
- (detached-rerun-session session suppress-output))
+ (let ((detached-session-mode
+ (if toggle-suppress-output
+ (if (eq 'create (detached--session-initial-mode session))
+ 'create-and-attach
+ 'create)
+ (detached--session-initial-mode session))))
+ (unless (eq detached-session-mode 'create)
+ (when-let ((single-window (> (length (window-list)) 1))
+ (buffer (current-buffer)))
+ (delete-window (get-buffer-window))
+ (bury-buffer buffer)))
+ (detached-rerun-session session)))
(defun detached-list-diff-marked-sessions ()
"Diff two sessions."
diff --git a/detached.el b/detached.el
index 1a9539a3c7..e27b6a255f 100644
--- a/detached.el
+++ b/detached.el
@@ -407,6 +407,8 @@ Optionally SUPPRESS-OUTPUT if prefix-argument is provided."
(let* ((detached-session-origin (or detached-session-origin 'shell-command))
(detached-session-action (or detached-session-action
detached-shell-command-session-action))
+ (detached-session-mode (or detached-session-mode
+ (if suppress-output 'create
'create-and-attach)))
(detached--current-session (detached-create-session command)))
(detached-start-session command suppress-output)))
@@ -464,7 +466,8 @@ The session is compiled by opening its output and enabling
(when (detached-valid-session session)
(let* ((default-directory
(detached--session-working-directory session))
- (detached-session-mode (detached--session-initial-mode session))
+ (detached-session-mode (or detached-session-mode
+ (detached--session-initial-mode
session)))
(detached-session-action (detached--session-action session))
(command (detached--session-command session)))
(if suppress-output
- [elpa] externals/detached updated (7796d2e6f2 -> d0dc9d0f92), ELPA Syncer, 2022/10/27
- [elpa] externals/detached 413cd86120 01/10: Remove validation of session when copying command, ELPA Syncer, 2022/10/27
- [elpa] externals/detached 30bd263210 06/10: Add criteria working/session-directory, ELPA Syncer, 2022/10/27
- [elpa] externals/detached 7b058ef99e 09/10: Update command string in detached-list-mode, ELPA Syncer, 2022/10/27
- [elpa] externals/detached 6aea11b5e8 03/10: Update detached-list diff sessions command, ELPA Syncer, 2022/10/27
- [elpa] externals/detached f943404ee6 04/10: Add unique narrow criteria, ELPA Syncer, 2022/10/27
- [elpa] externals/detached 66bc2811fb 08/10: Add possibility to toggle initial-mode when rerun,
ELPA Syncer <=
- [elpa] externals/detached acac8bd3eb 02/10: Update to correct order of criteria, ELPA Syncer, 2022/10/27
- [elpa] externals/detached 655b3b03e9 07/10: Update detached-list narrow bindings, ELPA Syncer, 2022/10/27
- [elpa] externals/detached a3a7cd963c 05/10: Remove regexp suffix for some criteria, ELPA Syncer, 2022/10/27
- [elpa] externals/detached d0dc9d0f92 10/10: Merge status and state in detached-list, ELPA Syncer, 2022/10/27