After upgrading to Emacs 24.4.1, when I call org-agenda with no splits it will show on the bottom half of the frame. Previously, it would show on the right half. How do I configure this behaviour?
2 Answers
I believe this behavior is not specific to org-agenda, but rather depends on the size of the window and the variables split-width-threshold
and split-height-threshold
. If your window is wide enough the agenda will open on the right.
You may want to try a lower split-width-threshold
if you prefer to split things vertically (new window on the right). If you really only want to do this for org-agenda, some advice might work:
(defadvice org-agenda (around split-vertically activate)
(let ((split-width-threshold 80)) ; or whatever width makes sense for you
ad-do-it))
Another option is to define a command to toggle from a horizontal split to a vertical split, as described here: http://whattheemacsd.com/buffer-defuns.el-03.html
-
Awesome, thanks! The problem seemed to be the window was large enough to split both vertically and horizontally, so it chose vertical - is there a way to get it to change which split it prefers if it can do both? Oct 23, 2014 at 18:53
-
4Check out the doc for
split-window-sensibly
-- I think you can setsplit-height-threshold
to nil. That seems to prefer the width threshold and create windows on the right by default, but still fall back to putting the new window below if the current width is not enough.– glucasOct 23, 2014 at 19:53 -
I changed
split-width-threshold
from 160 default value to 80 on a 1920x1200 monitor. Now most things split vertically. Jan 16, 2021 at 19:48
I combined the toggle-window-split function from http://whattheemacsd.com/buffer-defuns.el-03.html with advicing and it works pretty well:
See that the toggle-window-split function is available/loaded and advice like so:
(advice-add 'org-agenda :after #'toggle-window-split)