2

If I have an org file open:

 +----------------------------------------+
 |                                        |
 |                                        |
 |                                        |
 |                org file                |
 |                                        |
 |                                        |
 |                                        |
 |                                        |
 |                                        |
 |                                        |
 +----------------------------------------+

And open the Agenda view:

 +----------------------------------------+
 |                  |                     |
 |                  |                     |
 |                  |                     |
 |    org file      |       agenda        |
 |                  |                     |
 |                  |                     |
 |                  |                     |
 |                  |                     |
 |                  |                     |
 |                  |                     |
 +------------------+---------------------+

And then hit TAB on a todo item, it does (org-agenda-goto) and jumps to the item in the original window:

 +----------------------------------------+
 |                  |                     |
 |                  |                     |
 |                  |                     |
 |    org file      |       agenda        |
 |    jumped to     |                     |
 |    item          |                     |
 |                  |                     |
 |                  |                     |
 |                  |                     |
 |                  |                     |
 +------------------+---------------------+

Which is great. If I do (org-agenda-tree-to-indirect-buffer), however, it opens in a teeny window below the agenda:

 +----------------------------------------+
 |                  |                     |
 |                  |                     |
 |                  |                     |
 |    org file      |       agenda        |
 |                  |                     |
 |                  |                     |
 |                  |                     |
 |                  |                     |
 |                  +---------------------+
 |                  |     org item i.b.   |
 +------------------+---------------------+

What I'd like to happen is:

 +----------------------------------------+
 |                  |                     |
 |                  |                     |
 |                  |                     |
 |    org item i.b. |       agenda        |
 |                  |                     |
 |                  |                     |
 |                  |                     |
 |                  |                     |
 |                  |                     |
 |                  |                     |
 +------------------+---------------------+

I could do this by just typing TAB , s b, which isn't so bad, but out of general interest I'm wondering how do I control the placement of the new window that org-agenda-tree-to-indirect-buffer creates?

2
  • 1
    If you set org-indirect-buffer-display to 'current-window, does that achieve the desired behavior? (setq org-indirect-buffer-display 'current-window) The default value is 'other-window. To see available choices, type C-h v aka M-x describe-variable ....
    – lawlist
    Commented Nov 8, 2019 at 1:04
  • Thanks - that doesn't work unfortunately. Oddly, both 'current-window and 'other-window open the indirect buffer in the same place for me. (I checked and the variable is being updated OK - e.g. if I use 'new-frame the indirect buffer appears in a new frame).
    – ngm
    Commented Nov 8, 2019 at 20:08

1 Answer 1

0

I agree with this request. Here's a workaround:

In org-agenda.el I found the function: org-agenda-tree-to-indirect-buffer and changed the line which calls "split-window".

I added the parameters nil 't to the split-window call:

Before:

 (unwind-protect
        (unless (and indirect-window (window-live-p indirect-window))
          (setq indirect-window (split-window agenda-window)))

After:

(unwind-protect
        (unless (and indirect-window (window-live-p indirect-window))
          (setq indirect-window (split-window agenda-window nil 't)))

It's a hack, and may mess up other functionality but it works for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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