From mboxrd@z Thu Jan 1 00:00:00 1970 From: "numbchild@gmail.com" Subject: ask for an advice for org-display-inline-images Date: Mon, 16 May 2016 17:15:34 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11416d2add9d4b0532f21269 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2EdC-00020a-AQ for emacs-orgmode@gnu.org; Mon, 16 May 2016 05:16:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2EdA-0005LA-28 for emacs-orgmode@gnu.org; Mon, 16 May 2016 05:16:05 -0400 Received: from mail-yw0-x231.google.com ([2607:f8b0:4002:c05::231]:35117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2Ed9-0005L6-Tb for emacs-orgmode@gnu.org; Mon, 16 May 2016 05:16:04 -0400 Received: by mail-yw0-x231.google.com with SMTP id g133so155966958ywb.2 for ; Mon, 16 May 2016 02:16:03 -0700 (PDT) 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: Org-mode --001a11416d2add9d4b0532f21269 Content-Type: text/plain; charset=UTF-8 I hope somebody can provide an advice for `org-display-inline-images` to set image background color. Here is an link on StackExchange.Emacs: http://emacs.stackexchange.com/questions/20574/default-inline-image-background-in-org-mode/20598?noredirect=1#comment32482_20598 I don't know how to write this advice. I try the following code, but not work. (I'm not good at elisp) ```lisp (defun create-image-with-background (file width background-color) (create-image file (and width 'imagemagick) nil :width width :background background-color)) (advice-add 'org-display-inline-images :filter-return (lambda (r) (create-image-with-background r))) ``` [stardiviner] 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/ --001a11416d2add9d4b0532f21269 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I hope somebody can provide an advice for `org-d= isplay-inline-images` to set image background color.

Here is an link on StackExchange.Emacs:


I do= n't know how to write this advice.

I try the following= code, but not work. (I'm not good at elisp)

```lisp
(defun create-image-with-background (file= width background-color)
=C2=A0 (create-i= mage file
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (and width 'imagemagick)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nil
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 :width width
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :background background-color))

(adv= ice-add 'org-display-inline-images :filter-return
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (r)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = (create-image-with-background r)))
```

[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): stardiviner =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
Key finge= rprint =3D 9BAA 92BC CDDD B9EF 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2433
Blog:= http://stardiv= iner.github.io/
--001a11416d2add9d4b0532f21269--