4

Could anyone please give me a hand to split the display vertically to create a third window that spans across the entire frame when there are two pre-existing windows side by side?

I often have an open window, then I do an org-capture to create a todo, but then I'm not sure about the date, so I open the calendar which gets scrunched underneath Window # 1 -- I'd like the calendar to span the length of the frame.

Example:

Window # 1    |     org-capture window

Then, split screen vertically:

Window # 1    |     org-capture window
______________________________
           calendar
2

Upon examining calendar.el, I saw that much work had been done by the developer(s) to select the window location / size. Rather than using defalias and modifying the functions in calendar.el and/or org-capture.el, the following is a simple method to display the calendar across the entire bottom of the frame when using org-capture.

EDIT:  Replaced (windmove-left) and (windmove-right) with (other-window 1), which is needed when using the lawlist-org-capture function on smaller resolution screens. org-capture splits the screen vertically instead of horizontally when the user has a lower resolution display, and visa-versa on a higher resolution display. (other-window 1) works for both situations.

(defun lawlist-org-capture ()
  (interactive)
  (org-capture)
  (setq lawlist-org-restore-a (buffer-name))
  (other-window 1)
  (setq lawlist-org-restore-b (buffer-name))
  (delete-other-windows)
  (calendar)
  (windmove-up)
  (split-window-horizontally)
  (switch-to-buffer lawlist-org-restore-b)
  (other-window 1)
  (switch-to-buffer lawlist-org-restore-a) )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.