org-side-tree icon indicating copy to clipboard operation
org-side-tree copied to clipboard

Option to track open buffer instantly

Open heraplem opened this issue 11 months ago • 1 comments

Right now, the side tree only updates on a timer, I assume because it would be prohibitively expensive to update after every keystroke. But it wouldn't be so expensive to update immediately after every buffer switch.

This would require only a small amount of code. The core would look something like this:

(defun +org-sidetree-maybe-update ()
  (when (eq 'org-mode major-mode)
    (org-side-tree-update)))

(add-hook 'window-configuration-change-hook 'org-sidetree-maybe-update)

There would also need to be a configuration variable and maybe some light integration logic.

heraplem avatar Jan 30 '25 19:01 heraplem

The side-tree buffer updates on a timer in order to display changes in the corresponding org-mode document in (near) real time. I’m curious, what are the specific drawbacks of this approach, such that an alternative would be worth introducing?

Also, what is the scenario you have in mind that would make window-configuration-change-hook a suitable alternative trigger? It seems a bit limited to me.

Nicholas Coltharp @.***> writes:

Right now, the side tree only updates on a timer, I assume because it would be prohibitively expensive to update after every keystroke. But it wouldn't be so expensive to update immediately after every buffer switch.

This would require only a small amount of code. The core would look something like this:

(defun +org-sidetree-maybe-update () (when (eq 'org-mode major-mode) (org-side-tree-update)))

(add-hook 'window-configuration-change-hook 'org-sidetree-maybe-update)

There would also need to be a configuration variable and maybe some light integration logic.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

localauthor avatar Jan 30 '25 19:01 localauthor