emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: inline images in org-mode


From: Dan Davison
Subject: [Orgmode] Re: inline images in org-mode
Date: Thu, 16 Sep 2010 13:11:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Robert Goldman <address@hidden> writes:

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

Hi Robert,

There's already org-display-inline-images, which iIrc uses overlays
rather than the text properties used by iimage. Does your route offer
advantages over this?

Dan

>
> 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
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]