radian-software/ctrlf

Interaction with org-goto

Closed this issue · 2 comments

Currently the org-goto function with outline interface use isearch as default.
Is there any way to config it to use this package as alternative?
So we can use ctrlf to search only org headlines.

Hmm, I think so, although it might require a bit of work. I looked into it, and the way this works is that org-goto sets the value of isearch-search-fun-function before calling into Isearch. So CTRLF would have to understand isearch-search-fun-function, which is basically a user-provided alternative implementation of re-search-forward. We could then use the value of that variable when appropriate here: https://github.com/raxod502/ctrlf/blob/b8a7899faf9d37f1990dfefd9c6b2998c40d7fcc/ctrlf.el#L620-L622

After doing that, it would probably make the most sense to write a new function to replace org-goto which would invoke CTRLF with the isearch-search-fun-function value from org-goto, rather than trying to overwrite all the keymaps and stuff.

I find out I'm not using org-goto with isearch that often.
If we don't want auto search, org-goto-auto-isearch can be set to nil, and then ctrlf will work.
If we only want to search headings, consult-org-heading, C-u M-x org-refile or set org-goto-interface to outline-path-completion could be better choices.
Thanks for the research about my issue, and sorry for the late reply.