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

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

[elpa] externals/detached d6afb33600 4/9: Add detached list quit dwim co


From: ELPA Syncer
Subject: [elpa] externals/detached d6afb33600 4/9: Add detached list quit dwim command
Date: Thu, 22 Sep 2022 09:57:36 -0400 (EDT)

branch: externals/detached
commit d6afb336000612491324d605fb18f8f9e7e2bb0e
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>

    Add detached list quit dwim command
---
 detached-list.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/detached-list.el b/detached-list.el
index f7474b4ae4..bcce8048b6 100644
--- a/detached-list.el
+++ b/detached-list.el
@@ -77,6 +77,16 @@
 
 ;;;; Commands
 
+(defun detached-list-quit-dwim ()
+  "Quit DWIM command."
+  (interactive)
+  (if detached-list--filters
+      (detached-list-update-narrowing
+       (cdr detached-list--filters))
+    (if (> (length (window-list)) 1)
+        (kill-buffer-and-window)
+      (kill-current-buffer))))
+
 (defun detached-list-detach-from-session (session)
   "Detach from SESSION at point."
   (interactive
@@ -450,6 +460,7 @@ If prefix-argument is provided unmark instead of mark."
     (define-key map (kbd "n r") #'detached-list-narrow-remote)
     (define-key map (kbd "n s") #'detached-list-narrow-success)
     (define-key map (kbd "n %") #'detached-list-narrow-regexp)
+    (define-key map (kbd "q") #'detached-list-quit-dwim)
     (define-key map (kbd "r") #'detached-list-rerun-session)
     (define-key map (kbd "s") #'imenu)
     (define-key map (kbd "t") #'detached-list-toggle-mark-session)



reply via email to

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