all messages for Emacs-related lists mirrored at yhetil.org
 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

* Re: displaying thumbnails in heading or subheadings
  2017-04-25 14:56 displaying thumbnails in heading or subheadings cédric ody
@ 2017-04-26  6:49 ` numbchild
  0 siblings, 0 replies; 2+ messages in thread
From: numbchild @ 2017-04-26  6:49 UTC (permalink / raw)
  To: cédric ody; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]

Does this `insert-image` function insert image with overlay which is not
literately inserting?

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Apr 25, 2017 at 10:56 PM, cédric ody <cedric.listes@gmail.com>
wrote:

> 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
>
>

[-- Attachment #2: Type: text/html, Size: 2293 bytes --]

^ 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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.