> 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