From mboxrd@z Thu Jan 1 00:00:00 1970 From: "numbchild@gmail.com" Subject: Re: displaying thumbnails in heading or subheadings Date: Wed, 26 Apr 2017 14:49:33 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1141d06002f264054e0c406e Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3GmA-0003Xl-Ua for emacs-orgmode@gnu.org; Wed, 26 Apr 2017 02:50:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3Gm5-0003Wp-4j for emacs-orgmode@gnu.org; Wed, 26 Apr 2017 02:50:10 -0400 Received: from mail-io0-x22a.google.com ([2607:f8b0:4001:c06::22a]:34946) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d3Gm4-0003Wg-Vm for emacs-orgmode@gnu.org; Wed, 26 Apr 2017 02:50:05 -0400 Received: by mail-io0-x22a.google.com with SMTP id r16so224328678ioi.2 for ; Tue, 25 Apr 2017 23:50:04 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: =?UTF-8?Q?c=C3=A9dric_ody?= Cc: emacs-orgmode --001a1141d06002f264054e0c406e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Does this `insert-image` function insert image with overlay which is not literately inserting? [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint =3D 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=C3=A9dric ody 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 instanc= e > > * 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 > > --001a1141d06002f264054e0c406e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Does this `insert-image` function insert image with overla= y which is not literately inserting?
=
[stardiviner]=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Hack this world!>= ;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 GPG key ID: 47C32433
IRC(freeenode): sta= rdiviner =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Twitter:=C2=A0 @numbchild<= br>Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2= 433
Blog: ht= tp://stardiviner.github.io/

On Tue, Apr 25, 2017 at 10:56 PM, c=C3=A9dri= c 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<= br>
* Emacs heading
=C2=A0 :PROPERTIES:
=C2=A0 :ICON:=C2=A0 /tmp/emacs.png
=C2=A0 :END:

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

#+BEGIN_SRC elisp
(defun my-function ()
=C2=A0 "comment"
=C2=A0 (interactive)
=C2=A0 (save-excursion
=C2=A0 =C2=A0 (org-with-limited-levels (org-map-tree 'my_subfunction)))=
=C2=A0 (org-fix-position-after-promote))
(defun my_subfunction ()
"comment"
=C2=A0 (org-with-wide-buffer
=C2=A0 =C2=A0(org-back-to-heading t)
=C2=A0 =C2=A0(let ((e (org-element-at-point)))
=C2=A0 =C2=A0(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


--001a1141d06002f264054e0c406e--