Antonio Romano <n...@pm.me> writes:

> I'm aware of this new enhancement and am eager to see this released, 
> however i think this does not fit well my use case as it requires 
> defining a new link type whereas link types' semantic is - in my view - 
> that of defining a type of URI, not the type of identified element. An 
> .rnote file is a file and thus it deserves to be treated as a file (or 
> attachment, which is a file in the context of an headline) just for the 
> same reason there is no png: or svg: link type.

You do not need a new link type.
Just

  (add-function :before-until (org-link-get-parameter "file" :preview) 
#'preview-function-for-rnote)

For non-.rnote files, it can simply return nil.

> One thing that I discovered late is the existence of 
> image-converter.el. I don't know if it feasible to wire up the Rnote 
> file export logic as an image-converter handler, but I wonder if it 
> would be possible to retain caching capabilities equal to org-persist 
> and to still have async computation.

100% possible, but you may need to modify image-converter.el to become
more flexible (e.g. make `image-converter--converters' customizeable and
maybe allow custom function as a converter). You can ask on emacs-devel.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to