aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/rul-lisp/packages/rul-wm.el
diff options
context:
space:
mode:
authorRaúl Benencia <id@rbenencia.name>2024-10-16 20:02:55 -0700
committerRaúl Benencia <id@rbenencia.name>2024-10-17 09:12:44 -0700
commit11f99ab0413be1d01860282f6db3e3435ef3ebf4 (patch)
treef72af411ad82fe46d438a4d3b3dcb5ebe973c681 /.emacs.d/rul-lisp/packages/rul-wm.el
parentad4a90d825c06b7a23caf350ea392edc6e47b97d (diff)
emacs: beframe support
Diffstat (limited to '.emacs.d/rul-lisp/packages/rul-wm.el')
-rw-r--r--.emacs.d/rul-lisp/packages/rul-wm.el36
1 files changed, 33 insertions, 3 deletions
diff --git a/.emacs.d/rul-lisp/packages/rul-wm.el b/.emacs.d/rul-lisp/packages/rul-wm.el
index 59fc2f4..0af3eef 100644
--- a/.emacs.d/rul-lisp/packages/rul-wm.el
+++ b/.emacs.d/rul-lisp/packages/rul-wm.el
@@ -59,8 +59,38 @@ Also see `prot-window-delete-popup-frame'." command)
:ensure t
:defer t
:config
- (setq
- olivetti-body-width 100
- ))
+ (setq olivetti-body-width 100))
+
+(use-package beframe
+ :ensure t
+ :hook (after-init . beframe-mode)
+ :config
+ (define-key global-map (kbd "C-c b") beframe-prefix-map)
+
+ ;;Integration with Consult
+ (defvar consult-buffer-sources)
+ (declare-function consult--buffer-state "consult")
+
+ (with-eval-after-load 'consult
+ (defface beframe-buffer
+ '((t :inherit font-lock-string-face))
+ "Face for `consult' framed buffers.")
+
+ (defun my-beframe-buffer-names-sorted (&optional frame)
+ "Return the list of buffers from `beframe-buffer-names' sorted by visibility.
+With optional argument FRAME, return the list of buffers of FRAME."
+ (beframe-buffer-names frame :sort #'beframe-buffer-sort-visibility))
+
+ (defvar beframe-consult-source
+ `( :name "Frame-specific buffers (current frame)"
+ :narrow ?F
+ :category buffer
+ :face beframe-buffer
+ :history beframe-history
+ :items ,#'my-beframe-buffer-names-sorted
+ :action ,#'switch-to-buffer
+ :state ,#'consult--buffer-state))
+
+ (add-to-list 'consult-buffer-sources 'beframe-consult-source)))
(provide 'rul-wm)
nihil fit ex nihilo