[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sesman 0ea1d3e645 048/100: [Fix #7] Implement WHICH argume
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sesman 0ea1d3e645 048/100: [Fix #7] Implement WHICH argument in `sesman-restart` |
Date: |
Tue, 28 Dec 2021 14:06:01 -0500 (EST) |
branch: elpa/sesman
commit 0ea1d3e6451632c7b2c2a5adad7a04c47fe4db3a
Author: Vitalie Spinu <spinuvit@gmail.com>
Commit: Vitalie Spinu <spinuvit@gmail.com>
[Fix #7] Implement WHICH argument in `sesman-restart`
---
sesman.el | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/sesman.el b/sesman.el
index 1215061c84..9b0abe3250 100644
--- a/sesman.el
+++ b/sesman.el
@@ -312,20 +312,33 @@ If SORT is non-nil, sort in relevance order."
(run-hooks 'sesman-post-command-hook)))
;;;###autoload
-(defun sesman-restart ()
- "Restart sesman session."
- (interactive)
+(defun sesman-restart (&optional which)
+ "Restart sesman session.
+ When WHICH is nil, restart the current session; when a single universal
+argument or 'linked, restart all linked sessions; when a double universal
+argument, t or 'all, restart all sessions. For programmatic use, WHICH can also
+be a session or a name of the session, in which case that session is
restarted."
+ (interactive "P")
(let* ((system (sesman--system))
- (old-session (sesman-ensure-session system)))
- (message "Restarting %s '%s' session" system (car old-session))
- (sesman-restart-session system old-session)))
+ (sessions (sesman--on-C-u-u-sessions system which)))
+ (if (null sessions)
+ (message "No %s sessions found" system)
+ (with-temp-message (format "Restarting %s %s %s" system
+ (if (= 1 (length sessions)) "session"
"sessions")
+ (mapcar #'car sessions))
+ (mapc (lambda (s)
+ (sesman-restart-session system s))
+ sessions))
+ ;; restarting is not guaranteed to finish here, but what can we do?
+ (run-hooks 'sesman-post-command-hook))))
;;;###autoload
(defun sesman-quit (&optional which)
"Terminate a Sesman session.
When WHICH is nil, kill only the current session; when a single universal
-argument or 'linked, kill all linked session; when a double universal argument,
-t or 'all, kill all sessions."
+argument or 'linked, kill all linked sessions; when a double universal
argument,
+t or 'all, kill all sessions. For programmatic use, WHICH can also be a session
+or a name of the session, in which case that session is killed."
(interactive "P")
(let* ((system (sesman--system))
(sessions (sesman--on-C-u-u-sessions system which)))
- [nongnu] elpa/sesman 19151a8b60 065/100: Add colors for marking dir, proj and buf in listings, (continued)
- [nongnu] elpa/sesman 19151a8b60 065/100: Add colors for marking dir, proj and buf in listings, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 1f5b2b2338 075/100: More consistent empty prefix in sesman-info, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 59f4a2442e 077/100: Simplify system API by subsuming sesman-linked/friendly-sessions into sesman-sessions, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 4b2507d1ee 076/100: Optimize sesman-current-session, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman edee869c20 096/100: Sesman menu: Add Browser, Move Unlink, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 93123f6cef 093/100: Rename seman-menu-open -> sesman-menu-open, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 966c13812f 088/100: [Fix #14] Rewrite the usage of when-let*, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman b527f7a638 043/100: Make sesman-system permanent local, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 95f8354d1a 041/100: Add sesman-relevant-[link|session]-p functions, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman cf7997e279 035/100: Add sesman-project generic, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 0ea1d3e645 048/100: [Fix #7] Implement WHICH argument in `sesman-restart`,
ELPA Syncer <=
- [nongnu] elpa/sesman 0e38d4e427 057/100: Remove unnecessary autoloads, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman e4775a2e81 084/100: Remove sesman--expand-path-maybe, ELPA Syncer, 2021/12/28
- [nongnu] elpa/sesman 7bbd02be9e 083/100: Add sesman-follow-symlinks defcustom, ELPA Syncer, 2021/12/28