From a57228b7243f9c2d7843b63a2ec2c806105646fb Mon Sep 17 00:00:00 2001 From: Tiago Saboga Date: Sat, 28 Mar 2015 09:07:50 -0400 Subject: [PATCH] mu4e: avoid error when splitting headers window --- mu4e/mu4e-headers.el | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index b0dae9cd..c5f3316a 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -985,13 +985,16 @@ of `mu4e-split-view', and return a window for the message view." (kill-buffer mu4e~view-buffer)) ;; get a new view window (setq mu4e~headers-view-win - (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)) - (t ;; no splitting; just use the currently selected one - (selected-window)))) + (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" + (eval new-win-func))) + (t ;; no splitting; just use the currently selected one + (selected-window))))) mu4e~headers-view-win) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;