diff options
-rw-r--r-- | basic.el | 3 | ||||
-rw-r--r-- | gnus-conf.el | 32 |
2 files changed, 34 insertions, 1 deletions
@@ -199,6 +199,9 @@ This will maintain the frame's width and height as well." (window-height . 0.37)) (,(rx (seq bos "magit: ")) (display-buffer-same-window)) + (,(rx (seq bos "*Group*" eos)) + (display-buffer-in-tab durand-display-in-one-window) + (tab-name . "email")) (,(rx (seq bos "*Flymake")) (display-buffer-at-bottom) (window-height . 0.2)) diff --git a/gnus-conf.el b/gnus-conf.el index 39a211a..689a2fa 100644 --- a/gnus-conf.el +++ b/gnus-conf.el @@ -15,6 +15,36 @@ ;; (nnimap-server-port 143)) )) +;;; display using display-buffer + +(defun durand-display-gnus (&rest _args) + "Display the group buffer using display-buffer." + (cond + ((null (get-buffer "*Group*")) + (user-error "No group buffer!")) + (t + (quit-window) + (display-buffer (get-buffer "*Group*"))))) + +(advice-add #'gnus :after #'durand-display-gnus) + +(defun durand-gnus-kill-tab (&rest _args) + "Kill the tab when exiting Gnus." + (cond + ((durand-member "email" + (mapcar (lambda (tab) (cdr (assq 'name tab))) + (funcall tab-bar-tabs-function)) + #'string=) + (tab-bar-close-tab-by-name "email")))) + +(defun durand-gnus-quit () + "Quit and kill tab at the same time." + (interactive) + (bury-buffer) + (durand-gnus-kill-tab)) + +(add-hook 'gnus-exit-gnus-hook #'durand-gnus-kill-tab) + ;;; repunctuate sentences (add-hook 'gnus-part-display-hook 'gnus-treat-repunctuate) @@ -148,7 +178,7 @@ ;;; exiting -(define-key gnus-group-mode-map (vector ?q) #'bury-buffer) +(define-key gnus-group-mode-map (vector ?q) #'durand-gnus-quit) (define-key gnus-group-mode-map (vector ?x) #'gnus-group-exit) ;;; agent key bindings |