nschum / highlight-symbol.el

Emacs: automatic and manual symbol highlighting
http://nschum.de/src/emacs/highlight-symbol/
274 stars 41 forks source link

Unfolding headings whjile in org-mode #22

Open priyadarshan opened 10 years ago

priyadarshan commented 10 years ago

If I may submit a request: while in org-mode, and navigating with highlight-symbol-nav-mode, it would be quite useful if headings would temporarily unfold.

Thank you for highlight-symbol, it is indispensable to my workflow.

nschum commented 10 years ago

I don't use org-mode. Do they unfold if you use the normal search?

priyadarshan commented 10 years ago

Hello, yes, normal search unfolds headings.

You could try with this minimal example (within org-mode):

* Heading 1                                                        :sysadmin:
:PROPERTIES:
:CUSTOM_ID: freebsd_10_3847
:END

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit tempor
tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et, mattis
eget, convallis nec, purus. Cum sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae dolor.
Nullam tristique diam non turpis. Cras placerat accumsan nulla. Nullam rutrum.
Nam vestibulum accumsan nisl.

** Heading 2                                                          :elisp:
:PROPERTIES:
:CUSTOM_ID: search_8439
:END

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 

Having org-mode active, and having point on first header, press TAB until the heading fold completely.

If you search for "Lorem", search will unfold to show results. Next, with the first heading unfolded, keep subheading folded. With point within first Lorem, executing highlight-symbol-next will move point to end of subheading, without unfolding it.

nschum commented 10 years ago

OK, so org-mode folds text just using normal overlays.

Looks like isearch manipulate the overlays where isearch-open-invisible-temporary is set. Unfortunately, not trivial code, though.