pupo: option to split the active window or the entire frame
This commit is contained in:
parent
4353535a98
commit
e2b49da274
1 changed files with 10 additions and 2 deletions
|
@ -6,6 +6,12 @@
|
|||
|
||||
(require 'window-purpose)
|
||||
|
||||
(defcustom pupo-split-active-window nil
|
||||
"Non-nil if Pupo splits the active window.
|
||||
Nil if Pupo splits the entire frame."
|
||||
:type '(boolean)
|
||||
:group 'pupo)
|
||||
|
||||
(defconst pupo--direction-to-purpose '((left . popl)
|
||||
(right . popr)
|
||||
(top . popt)
|
||||
|
@ -46,8 +52,10 @@ width or height depending on POSITION."
|
|||
('top 'above)
|
||||
('bottom 'below))))
|
||||
(lambda (buffer alist)
|
||||
(let ((window (ignore-errors
|
||||
(split-window (frame-root-window) size side))))
|
||||
(let* ((main-window (if pupo-split-active-window
|
||||
(selected-window)
|
||||
(frame-root-window)))
|
||||
(window (ignore-errors (split-window main-window size side))))
|
||||
(when window
|
||||
(purpose-change-buffer buffer window 'window alist))))))
|
||||
|
||||
|
|
Reference in a new issue