emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* displaying thumbnails in heading or subheadings
@ 2017-04-25 14:56 cédric ody
  2017-04-26  6:49 ` numbchild
  0 siblings, 1 reply; 2+ messages in thread
From: cédric ody @ 2017-04-25 14:56 UTC (permalink / raw)
  To: emacs-orgmode

Hi everyone,

I'd like to be able to display thumbnails of images in headlines.

Assume I define a ICON property with the path to a thumbnail. For instance

* Emacs heading
  :PROPERTIES:
  :ICON:  /tmp/emacs.png
  :END:

I have been able to get some results with the following code

#+BEGIN_SRC elisp
(defun my-function ()
  "comment"
  (interactive)
  (save-excursion
    (org-with-limited-levels (org-map-tree 'my_subfunction)))
  (org-fix-position-after-promote))
(defun my_subfunction ()
"comment"
  (org-with-wide-buffer
   (org-back-to-heading t)
   (let ((e (org-element-at-point)))
   (looking-at org-outline-regexp) (goto-char (1- (match-end 0)))
(insert-image (create-image (org-element-property :ICON e))))))
#+END_SRC

There are two issues I'd like to solve:

- when the document is saved and re-opened, a blank space has
substituted the thumbnail.
- is it possible to control the appearance or not of thel thumbnails
of all headlinesin one command?

Thanks,

cedric

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-26  6:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25 14:56 displaying thumbnails in heading or subheadings cédric ody
2017-04-26  6:49 ` numbchild

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).