localauthor / org-side-tree

Navigate Org-mode outlines in Emacs via side window
GNU General Public License v3.0
40 stars 4 forks source link

Unable to make org-side-tree work with org-mode-hook #11

Open IceAsteroid opened 6 months ago

IceAsteroid commented 6 months ago

Hi, as always, thanks for this nice package

Adding org-side-org to org-mode-hook doesn't launch org-side-tree when an org file is opened.

I was trying to make the org-side-tree's sidebar launch automatically when an org file is opened, but it just simply couldn't work as expected.

localauthor commented 6 months ago

~org-mode-hook won’t work for this, because it is called right when org-mode is called (if I understand correctly), before the buffer is loaded.~

~I’ll try to think of an alternative way to achieve what you want. Maybe something with find-file-hook.~

edit: ok, try it again with the latest commit and see if that does what you're looking for.

IceAsteroid commented 6 months ago

So it's not the package's issue, that's fine.

My actual question is actually "how to open/close org-side-tree's sidebar when a window is on an org file buffer. From my intuition, the implementation might be completely different, the original title is probably misleading,

Anyway, I'll do some research on my own first. Have a good day :P

localauthor commented 6 months ago

Did you try it again, after the latest change?

localauthor commented 6 months ago

My actual question is actually "how to open/close org-side-tree's sidebar when a window is on an org file buffer. From my intuition, the implementation might be completely different, the original title is probably misleading,

If the window is on an org buffer, then calling the function org-side-tree (either via M-x or with a keybinding) should pop open the side-tree window.

IceAsteroid commented 6 months ago

I meant by "automatically"

IceAsteroid commented 6 months ago

It doesn't work, the sidebar doesn't open up when an org-file is opened. I've set the hook like this (add-hook 'org-mode-hook 'org-side-tree)

localauthor commented 6 months ago

hmm, it's working for me. the side-tree won't open automatically every time you switch to an org buffer, only the first time that org file is opened.

IceAsteroid commented 6 months ago

I knew it, but it didn't even work for the first time opening up an org file. I've tried a minimum init config with org-side-tree, but still no luck.