From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Goldman Subject: inline images in org-mode Date: Wed, 15 Sep 2010 19:33:36 -0500 Message-ID: <4C9165E0.4050401@sift.info> Reply-To: rpgoldman@sift.info Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=50794 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ow2Q0-00071O-IM for emacs-orgmode@gnu.org; Wed, 15 Sep 2010 20:33:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ow2Pz-0001WY-8u for emacs-orgmode@gnu.org; Wed, 15 Sep 2010 20:33:40 -0400 Received: from mpls.sift.info ([75.146.46.193]:55470) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ow2Pz-0001WI-3S for emacs-orgmode@gnu.org; Wed, 15 Sep 2010 20:33:39 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode I was looking for a way to put illustrations in my org-mode files so that I could actually look at them while editing the org stuff. I found a post a while ago suggesting using iimage mode (which is included with the Aquamacs that I use, and is readily available if you don't have it with your emacs). I found I needed to do a little customization to make iimage work for me, so I thought I would post the details in case they were useful to anyone else. Here's the bit I added to my org configuration to make this work: (add-hook 'org-mode-hook '(lambda () ;; unnecessary ;; (make-variable-buffer-local 'iimage-mode-image-filename-regex) (let ((file-extension-regex (regexp-opt (nconc (mapcar #'upcase image-file-name-extensions) image-file-name-extensions) t))) (setq iimage-mode-image-regex-alist (list (cons (concat "\\[\\[" (regexp-quote "file:") "\\([^]]+\." file-extension-regex "\\)" "\\]" "\\(\\[" "\\([^]]+\\)" "\\]\\)?" "\\]") 1)))))) Note that this /only/ displays inline local (file) links, not http images. It wouldn't be hard to add that --- I built the above by copying and modifying the org-bracket-link-analytic-regexp variable initialization. If one wanted to put this more generally into org-mode, it would probably be right to make the iimage-mode-image-regex-alist be under control of some org customization (to handle local versus all images, etc.). I don't generally want iimage mode on in all of my org-mode buffers, so I use the file variables block to engage iimage mode where I want it. If you'd like it always to be on, then you can just add iimage-mode (it's a minor mode) to your org-mode-hook. Hope that's of interest to someone... Cheers, r