2011/08/30 16:24
[활용/emacs]
그냥 org-mode 에서는 편집중에 이미지를 바로 볼 수 없는데, iimage 를 이용하면 바로 볼 수 있다.
다음 코드를 emacs 에 바로 넣으면 된다.
단, 이 코드를 넣으면 link 에 붙어 있었던 underline 이 사라진다.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; -- Display images in org mode
;; enable image mode first
;; 출처 : http://floatsolutions.com/blog/2010/10/displaying-inline-images-in-emacs-org-mode/
(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 "\\)\\]") 1))
;; 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))



