It always bothered me that I couldn’t jump straight to a narrowed task coming from the org-agenda. I now figured how to achieve that and the solution was shockingly simple:
https://svbck.org/blog/2024-02-14-a-small-but-useful-agenda-tweak.html
@svbck Good one!
@jbaty Thanks, I’m glad you like my solution!
@svbck Never thought I needed that but it does sound really cool. Will try for a couple of days!
@svbck After a couple of minutes I of course wanted to tweak something: I'd prefer to close a buffer over `C-x n w` widening it, I believe, so I hunted for a function that uses indirect buffers for that.
And lo and behold:
1) org-agenda-tree-to-indirect-buffer
Opens an indirect buffer in a split window focusing on the task. The split is meh, though.
2) org-tree-to-indirect-buffer
Omits all the splitting, just shows the sub-tree at point in an indirect buffer.
Works automagically
@ctietze Cool. This sounds great! For some reason though that opens two buffers for me. One with the todo.org file and the indirect one.... Will have to look into that.
@ctietze I get now what you meant with rather closing a buffer instead of widening. Haven't thought about that. I rarely acceess my todo.org file directly, usually interact only via the agenda, thus haven't noticed this. I will try to get your version to work here for me and try to figure out why it also opens the whole todo file instead of only the subtree.
Any chance you have configured a dedicated window (or such) for the agenda?
@jbaty @ctietze aahhh. Cool. I think I’m a little slow on the uptake today, but I actually like split, as I have then the agenda up (depending on frame/window size) and the task below it. I do whatever I wanted there (add note, subtask) jump back to other window and with o close the other window.
Meaning, in my workflow I tend to have only one window.
Though as I write this now it got me thinking would it your idea even be better. Similar to Elfeed in essence.
@svbck My display-buffer-alist entry is reprinted below:
("\\*Org Agenda\\*"
(display-buffer-in-tab display-buffer-reuse-mode-window)
(ignore-current-tab . t)
(tab-name . "Org Files")
(window-width . 100)
(dedicated . side)
(side . left)
(inhibit-same-window))
@ctietze Nice. Thanks a lot. I will look into that later today.