diff options
Diffstat (limited to 'bard-emacs-modules/bard-emacs-window.el')
| -rw-r--r-- | bard-emacs-modules/bard-emacs-window.el | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/bard-emacs-modules/bard-emacs-window.el b/bard-emacs-modules/bard-emacs-window.el index 88bbe05..87d1ed8 100644 --- a/bard-emacs-modules/bard-emacs-window.el +++ b/bard-emacs-modules/bard-emacs-window.el @@ -1,6 +1,7 @@ (require 'bard-window) -;; settings for prot- +(setq focus-follows-mouse t) +(setq mouse-autoselect-window t) (setq window-combination-resize t) (setq even-window-sizes 'height-only) (setq window-sides-vertical nil) @@ -23,13 +24,40 @@ :ensure t :config (setq beframe-functions-in-frames '(project-prompt-project-dir)) - + (setq beframe-create-frame-scratch-buffer nil) + (setq beframe-global-buffers '("*scratch*" "*Messages*" "*Backtrace*")) (beframe-mode 1) (define-key global-map (kbd "C-x f") #'other-frame-prefix) (define-key global-map (kbd "C-c b") beframe-prefix-map) (define-key global-map (kbd "C-x C-b") #'beframe-buffer-menu) - (define-key global-map (kbd "C-x B") #'select-frame-by-name)) + (define-key global-map (kbd "C-x B") #'select-frame-by-name) + + ;; Consult integration + (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))) (setq display-buffer-alist `(("\\`\\*Async Shell Command\\*\\'" @@ -68,7 +96,7 @@ (derived-mode . Buffer-menu-mode) (derived-mode . log-view-mode) (derived-mode . help-mode) ; See the hooks for `visual-line-mode' - "\\*\\(|Buffer List\\|Occur\\|Man.*\\|vc-change-log\\|eldoc.*\\).*" + "\\*\\(|Buffer List\\|Occur\\|Man.*\\|Org Select\\|vc-change-log\\|eldoc.*\\).*" prot-window-shell-or-term-p ,world-clock-buffer-name)) (prot-window-display-buffer-below-or-pop) @@ -82,3 +110,6 @@ (define-key global-map (kbd "C-x C-p") #'previous-buffer) (define-key global-map (kbd "C-x <up>") #'next-buffer) (define-key global-map (kbd "C-x <down>") #'previous-buffer) + +(provide 'bard-emacs-window) +;;; bard-emacs-window.el ends here |
