-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
org-appear doesn't work with experimental org-mode branch feature/org-fold #5
Comments
As far as I can see, from a cursory look at the the |
Maybe just summon @yantar92 here. He is really fast and helpful to resolve issues regarding his branch. |
=feature/org-fold= does not hide emphasis markers using invisible text property. The visibility is set using alternative "buffer-local" text properties. To switch visibility of emphasis marker in a region, I recommend to use =font-lock-fontify-region= with locally bound =org-hide-emphasis-markers= (see =org-fold-show-set-visibility= for an example how it can be done). This approach should work on master as well. |
I do not see why |
Yes, I managed to make it work with sub/superscripts by locally binding |
Binding |
Nope, at least on master, it doesn't. Incidentally, do you know of a better way to prevent |
Judging from the source code of
After thinking, it makes sense. The problem is how |
Thanks a lot for the discussion, @yantar92! The version of
|
To reveal a link in org-fold, you can simply run
Do you refer to nested emphasis? |
I tried that but it seemed to mess with link faces -- only the description part is properly highlighted, the rest of the link is displayed as normal text. I now realise that this may be an issue of
Sorry, I probably meant to say "nested emphasis children". Could you please clarify about the thing on your todo list? What's it going to do exactly? |
Fixed.
I meant something like |
Support for links is now added in org-fold-support branch. I'm not sure if we're talking about the same thing, @yantar92. What I meant is this. In the version of
In the version that uses
|
I also meant that kind of situation. Though the example I provided is probably even more tricky. Would will happen if you have |
Answering my own question:
Emphasis markers are not revealed in the last case, because |
Who in their right mind would nest emphasis like that? Jokes aside, yes, this is trickier. There's actually a bug related to that right now in |
Seems like |
For the record, org-appear works fine with org-fold (at least for emphasis). The problem with intersecting emphasis is not real because they are not really supported by Org. Fontification works by accident... |
Thanks, @willbchang and @yantar92, for the information!
The only element currently not supported with org-fold is links. I will work on resolving that before org-fold is merged. |
FYI, org-fold has been merged. yantar92/org#42 |
@yantar92 Is there an easy way to temporarily unfold lines for a swiper-like search? I need a function to unfold which also gives me a restoration function as return value, such that I can fold again afterwards. And then I need a function to unfold finally (maybe by just not calling the restoration function again.) Does org-fold come with such a functionality? I saw there is org-fold-show-context. |
Is there an easy way to temporarily unfold lines for a swiper-like
search?
(org-fold-show-set-visibility 'local)
I need a function to unfold which also gives me a restoration function as return value, such that I can fold again afterwards. And then I need a function to unfold finally (maybe by just not calling the restoration function again.) Does org-fold come with such a functionality? I saw there is org-fold-show-context.
This is more tricky. There is currently no API function to do this
(though link/emphasis visibility is restored upon re-fontification).
You can use org-fold-core--isearch-show-temporary used to implement
temporary visibility for isearch, but it may be a subject of change in
future.
If you want to add this functionality officially (it was never present
in the past, AFAIK), feel free to open a discussion in Org ML. Or I was
planning to talk about some Org internals during next Org Profiling
Meetup (previous meetup:
***@***.***). We may discuss
org-fold-core internals if you are interested.
|
@yantar92 Thanks! This is helpful. A simple official API for unfolding and subsequent restoration would be nice to have. Such an API didn't exist previously since Org just relied on the standard Isearch unfolding mechanism for overlay used by outline and hideshow. |
The mainline version of I am not closing the issue for now since there are conflicts with packages using |
I am a happy user of yantar92/org's
feature/org-fold
branch because of its noticeable performance boost with big org files, however I just noticed thatorg-appear
doesn't work with it."doesn't work" here means that after I enable
org-appear-mode
and place cursor over word surrounded by someorg-mode
emphasis, they aren't revealed, they stay hidden.When I switch to normal
org-mode
, issue is gone andorg-appear
works as intended, so I am confident to say that the issue must be either in thefeature/org-fold
branch itself or in theory issue could have been introduced toorg-mode
somewhere after 6b83c6e4ea, because that's the current version of vanillaorg-mode
used in doom andorg-appear
works fine with it.I tested this on stable emacs 27 and vanilla doom emacs profile.
The text was updated successfully, but these errors were encountered: