Skip to content

Commit 7e0777b

Browse files
jackkammabo-abo
authored andcommitted
ace-window.el (ace-display-buffer): Add
Fixes #187
1 parent edbbb1b commit 7e0777b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

ace-window.el

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,22 @@ Amend MODE-LINE to the mode line for the duration of the selection."
613613
(aw-select " Ace - Delete Other Windows"
614614
#'delete-other-windows))
615615

616+
;;;###autoload
617+
(defun ace-display-buffer (buffer alist)
618+
"Make `display-buffer' and `pop-to-buffer' select using `ace-window'.
619+
See sample config for `display-buffer-base-action' and `display-buffer-alist':
620+
https://github.com/abo-abo/ace-window/wiki/display-buffer."
621+
(let* ((aw-ignore-current (cdr (assq 'inhibit-same-window alist)))
622+
(rf (cdr (assq 'reusable-frames alist)))
623+
(aw-scope (cl-case rf
624+
((nil) 'frame)
625+
(visible 'visible)
626+
((0 t) 'global))))
627+
(unless (or (<= (length (aw-window-list)) 1)
628+
(not aw-scope))
629+
(window--display-buffer
630+
buffer (aw-select "Ace - Display Buffer") 'reuse))))
631+
616632
(declare-function transpose-frame "ext:transpose-frame")
617633
(defun aw-transpose-frame (w)
618634
"Select any window on frame and `tranpose-frame'."

0 commit comments

Comments
 (0)