mirror of https://github.com/djcb/mu.git
Merge pull request #2142 from tsdh/function-valued-mu4e-split-view
Allow a function as mu4e-split-view value
This commit is contained in:
commit
4ecb59aed5
|
@ -1269,16 +1269,16 @@ of `mu4e-split-view', and return a window for the message view."
|
|||
(kill-buffer (mu4e-get-view-buffer)))
|
||||
;; get a new view window
|
||||
(setq mu4e~headers-view-win
|
||||
(let* ((new-win-func
|
||||
(cond
|
||||
((eq mu4e-split-view 'horizontal) ;; split horizontally
|
||||
'(split-window-vertically mu4e-headers-visible-lines))
|
||||
((eq mu4e-split-view 'vertical) ;; split vertically
|
||||
'(split-window-horizontally mu4e-headers-visible-columns)))))
|
||||
(cond ((with-demoted-errors "Unable to split window: %S"
|
||||
(eval new-win-func)))
|
||||
(t ;; no splitting; just use the currently selected one
|
||||
(selected-window)))))))
|
||||
(with-demoted-errors "Unable to split window: %S"
|
||||
(cond
|
||||
((eq mu4e-split-view 'horizontal) ;; split horizontally
|
||||
(split-window-vertically mu4e-headers-visible-lines))
|
||||
((eq mu4e-split-view 'vertical) ;; split vertically
|
||||
(split-window-horizontally mu4e-headers-visible-columns))
|
||||
((functionp mu4e-split-view)
|
||||
(funcall mu4e-split-view))
|
||||
(t ;; no splitting; just use the currently selected one
|
||||
(selected-window)))))))
|
||||
|
||||
;;; Search-based marking
|
||||
|
||||
|
|
|
@ -91,8 +91,10 @@ A symbol which is either:
|
|||
* `vertical': split vertically (headers on the left).
|
||||
* `single-window': view and headers in one window (mu4e will try not to
|
||||
touch your window layout), main view in minibuffer
|
||||
* a function: the function is responsible to return some window for
|
||||
the view.
|
||||
* anything else: don't split (show either headers or messages,
|
||||
not both)
|
||||
not both).
|
||||
Also see `mu4e-headers-visible-lines'
|
||||
and `mu4e-headers-visible-columns'."
|
||||
:type '(choice (const :tag "Split horizontally" horizontal)
|
||||
|
@ -516,4 +518,3 @@ Or go to the top level if there is none."
|
|||
|
||||
(provide 'mu4e-helpers)
|
||||
;;; mu4e-helpers.el ends here
|
||||
|
||||
|
|
Loading…
Reference in New Issue