diff options
author | Raúl Benencia <id@rbenencia.name> | 2023-08-01 08:17:44 -0700 |
---|---|---|
committer | Raúl Benencia <id@rbenencia.name> | 2023-08-01 08:17:44 -0700 |
commit | 0ff357940946def05fe9e20d4ddef4553b23f71a (patch) | |
tree | 70bf38e54bbf86ac137f43d223ecb568d65d0dfc /.emacs.d/rul-lisp/packages/rul-wm.el | |
parent | f8d48cc50badb8a98f4fd6e0dfaf0beeb9f30eef (diff) |
emacs: add new display-buffer-alist rules
Diffstat (limited to '.emacs.d/rul-lisp/packages/rul-wm.el')
-rw-r--r-- | .emacs.d/rul-lisp/packages/rul-wm.el | 58 |
1 files changed, 37 insertions, 21 deletions
diff --git a/.emacs.d/rul-lisp/packages/rul-wm.el b/.emacs.d/rul-lisp/packages/rul-wm.el index 7b44163..eac14e7 100644 --- a/.emacs.d/rul-lisp/packages/rul-wm.el +++ b/.emacs.d/rul-lisp/packages/rul-wm.el @@ -1,3 +1,4 @@ +;;;; window.el ;; Inspiration: https://christiantietze.de/posts/2022/12/updated-org-mode-agenda-display-buffer-alist/ (defun rul/display-buffer-org-agenda-managed-p (buffer-name action) "Determine whether BUFFER-NAME is an org-agenda managed buffer." @@ -5,36 +6,51 @@ (or (derived-mode-p 'org-mode 'org-agenda-mode) (member (buffer-file-name) (org-agenda-files))))) -(add-to-list 'display-buffer-alist - `("\\*Org Agenda\\*" - (display-buffer-in-tab ;; Make sure to use the "Org Files" tab - display-buffer-reuse-mode-window) - (ignore-current-tab . t) - (tab-name . "Org") - (dedicated . side) ;; Make the Agenda a dedicated side-window - (side . left) ;; to the left so it always stays open. - (inhibit-same-window . nil))) - -(add-to-list 'display-buffer-alist - '(rul/display-buffer-org-agenda-managed-p - (display-buffer-reuse-mode-window ;; Prioritize reuse of current window - display-buffer-in-tab) ;; over switching to the Org tab. - (tab-name . "Org"))) +(setq display-buffer-alist + '(;; Org Agenda in dedicated side-window + ("\\*Org Agenda\\*" + (display-buffer-in-tab + display-buffer-reuse-mode-window) + (ignore-current-tab . t) + (tab-name . "Org") + (dedicated . side) + (side . left) + (inhibit-same-window . nil)) + ;; Attempt window reuse for org-mode + (rul/display-buffer-org-agenda-managed-p + (display-buffer-reuse-mode-window + display-buffer-in-tab) + (tab-name . "Org")) + (;; Notmuch in dedicated tab + ".*notmuch.*" + (display-buffer-in-tab + display-buffer-reuse-mode-window) + (ignore-current-tab . t) + (tab-name . "Mail")) + (;; Notmuch in dedicated tab + ".*elfeed.*" + (display-buffer-in-tab + display-buffer-reuse-mode-window) + (ignore-current-tab . t) + (tab-name . "Elfeed")) + )) -; tab-bar configuration -(global-set-key (kbd "C-<next>") 'tab-bar-switch-to-next-tab) -(global-set-key (kbd "C-<prior>") 'tab-bar-switch-to-prev-tab) -;(setq switch-to-buffer-obey-display-actions nil) +;;;; tab-bar.el +(let ((map global-map)) +(define-key map (kbd "C-<next>") 'tab-bar-switch-to-next-tab) +(define-key map (kbd "C-<prior>") 'tab-bar-switch-to-prev-tab) +(define-key map (kbd "<f8>") 'tab-bar-mode)) (setq tab-bar-format '(tab-bar-format-tabs - tab-bar-format-align-right - tab-bar-format-global + ;; tab-bar-format-align-right + ;; tab-bar-format-global )) (setq tab-bar-new-tab-to 'rightmost) (setq tab-bar-close-button-show nil) (set-face-attribute 'tab-bar nil :height 0.8) (tab-bar-mode 1) + (provide 'rul-wm) |