[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Display inline images for shortcuts links
From: |
Nicolas Goaziou |
Subject: |
Re: [O] Display inline images for shortcuts links |
Date: |
Thu, 17 Aug 2017 15:59:26 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Hello,
Fabrice Popineau <address@hidden> writes:
> Would it be possible to enable inline images for shortcuts links ?
> Currently, the function `org-display-inline-images' checks for a hard coded
> file: link.
> In the case of :
>
> #+LINK: temp file:c:/temp/%h
>
> [[file:cover.jpg]]
>
> [[temp:cover.jpg]]
>
> The first link will be matched, but not the second one.
> (Unless I missed something?)
Fixed, in master.
> A small patch like the one attached enables to display inline images for
> all links.
> But maybe relying on the org-element API is not the smarter move here.
org-element API is already used in the function (e.g.,
`org-element-property' ...). However `org-element-parse-buffer' is a bit
heavy for the task, in particular in the supposedly common case where
inline image are not the most common link type throughout the buffer.
I simply extended the link search to all link abbrevs, discarding those
that do not ultimately match a file.
Does it solve your issue?
Regards,
--
Nicolas Goaziou