Karthik, thanks, I disabled org-link-beautify-mode, then re-verify your
patch, confirmed it works as expected.
Then I will fix org-link-beautify preview logic. Thanks for your reviewing
my package code to find out reason.
I forget to notice message body after applied mail patch. my fault.

Ihor, the patch can be applied.


[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Mon, Mar 31, 2025 at 12:38 AM Karthik Chikmagalur <
karthikchikmaga...@gmail.com> wrote:

> > The patch is not working correctly.
> >
> > [...]
> >
> > When I expand all sub-heading. The second link is previewed, but the
> > first link DIS-previewed. The correct result should be two links both
> > previewed.
>
> As mentioned in my email with the patch, this is a bug with
> org-link-beautify:
>
> > Stardiviner, under these changes this logic in your org-link-beautify
> > package is incorrect:
>
> > --8<---------------cut here---------------start------------->8---
> >     (unless (overlay-get ov 'org-image-overlay)
> >       (overlay-put ov 'display ...)
> >       (overlay-put ov 'after-string ...)
> >       (overlay-put ov 'keymap  org-link-beautify-keymap))))
> > --8<---------------cut here---------------end--------------->8---
>
> > Your beautify-* functions return nil if there is already an image
> > overlay.  This will mean that the overlays are removed.  If you want
> > your function to do nothing you should return t.  See this part
> > of the docstring for org-link-parameters:
>
> > --8<---------------cut here---------------start------------->8---
> > ‘:preview’
>
> >   Function to run to generate an in-buffer preview for the link.  It
> >   must accept three arguments...
>
> >   THIS FUNCTION MUST RETURN A NON-NIL VALUE TO INDICATE SUCCESS.
> >   A return value of nil implies that the preview failed, and the
> >   overlay placed on the link will be removed.
> > --8<---------------cut here---------------end--------------->8---
>
> Karthik
>

Reply via email to