Closed leadpipe closed 2 weeks ago
Thanks for this issue - these bug links are all too familiar to me, in fact, I think I've done something similar with those same bug links, using org link abbreviations, which might be a slightly better experience for you.
Let me think about the best way to solve this - I agree that it should be the case that invalidating the ewoc should redisplay correctly. My guess is that ekg-insert-inlines-and-process
needs to be changed so that it will invoke the mode and wait for fontification before returning the final text.
So I think what you want to advise is ekg-display-note
. It should be called on ewoc-invalidate
, so advising it should do the right thing. ekg-display-note-text
will be called when new notes are added, and that is what is going to render the text according to the mode, so that's also a reasonable thing to advise as well. Please try this and see if it works better for you.
Closing the loop on this:
ekg-display-note
, by advising ekd-display-note-tagged
. (The latter is called by the former.) But this function is not called by ewoc-invalidate
, which simply replaces the previous contents of the ewoc item with the new contents.ewoc-invalidate
, and (when major-mode
is ekg-notes-mode
) directly call ekg--notes-activate-links
to fix up the Org links in the buffer.Thank you for the follow up!
https://github.com/ahyatt/ekg/blob/839c6ce9a40bd7b7a12b791dc74f172ac1f378e6/ekg.el#L1624
I have a number of ways I modify notes to linkify things. My most recent one is adding advice to
ekg-display-note-tagged
to linkify tags that look like shortlinks, meaning turn them into org-mode style links that look like[[http://b/12345][b/12345]]
. This works great for redisplayed notes, but comes through literally for the notes that are updated in place viaewoc-invalidate
.This shows a couple of bugs I've used as tags, just after I've saved the note, as they appear in a notes buffer:
This shows the same bugs in the same notes buffer after I've hit
g
to redisplay the buffer, and org-mode links have been reapplied:Not sure what the best way to address this would be; it appears from a very cursory look that the org-mode linkification requires the text to be in a buffer.