I had to patch together some various emacs from around the web to get inline images with iimage.el working in emacs exactly the way I wanted. Here’s some info:
Here’s the code, you can add it anywhere in your .emacs
;; -- Display images in org mode
;; enable image mode first
(iimage-mode)
;; add the org file link format to the iimage mode regex
(add-to-list & 'iimage-mode-image-regex-alist
(cons (concat "\\[\\[file:\\(~?" iimage-mode-image-filename-regex "\\)\\]") ))
;; add a hook so we can display images on load
(add-hook & 'org-mode-hook & '(lambda () (org-turn-on-iimage-in-org)))
;; function to setup images for display on load
(defun org-turn-on-iimage-in-org ()
"display images in your org file"
(interactive)
(turn-on-iimage-mode)
(set-face-underline-p & 'org-link nil))
;; function to toggle images in a org bugger
(defun org-toggle-iimage-in-org ()
"display images in your org file"
(interactive)
(if (face-underline-p & 'org-link)
(set-face-underline-p & 'org-link nil)
(set-face-underline-p & 'org-link t))
(call-interactively & 'iimage-mode))
I have this function bound to C-l with a call like this:
(define-key org-mode-map (kbd "C-S-a") & 'org-archive-subtree)