Discussion:
[O] [org-contacts] How to show avatar image on org headings?
stardiviner
2018-05-07 02:00:28 UTC
Permalink
I want to show org-contacts avatar image on org-headings.
Use overlay, or there is other better methods?

A sample org-contacts snippet looks like this:

* [] John KK
:PROPERTIES:
:AVATAR: john kk.jpg []
:END:

I want to display the image at [] on heading, or replace "john kk.jpg"
with [] image.

BTW, another question, how to get property's value? and how to iterate
on all heading elements then auto display image when open Contacts.org
file?

--
[ stardiviner ] don't need to convince with trends.
Blog: https://stardiviner.github.io/
IRC(freenode): stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
stardiviner
2018-05-10 01:20:47 UTC
Permalink
Thanks, Kitchin!

I tried code in Emacs minimal config. But the image is
not shown. I tried to toggle Edebug on function
`org-contacts-icon-property-image-overlay`. But it is not triggered.
Don't understand why. Because `(font-lock-add-keywords ..)` not correct?
I tried to change `nil` into `'org-mode`. But still does not work.

Possible reasons:

- In your code, seems don't need KEYWORDS for`font-lock-add-keywords`.
- font-lock can't enabled on org-property because it is already
font-locked? (don't know this neither)

I'm considering might can change a thinking direction (This is an
optional solution). Because Org-mode support inline image display for
file link:

,----
| [[file:image.png]]
`----

So I tried to use this in Org property like this:

,----
| * Name
| :PROPERTY:
| :ICON: [[file:image.png]]
| :END:
`----

But Org inline image can't display on property value. (Because inline
image require a single line, invalid in org property value position?)

WDYT?

--
[ stardiviner ] don't need to convince with trends.
Blog: https://stardiviner.github.io/
IRC(freenode): stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

Continue reading on narkive:
Loading...