/[emacs]/emacs/lisp/iimage.el
ViewVC logotype

Diff of /emacs/lisp/iimage.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2.2.1 by miles, Mon Jun 28 07:28:23 2004 UTC revision 1.2.2.2 by miles, Tue Jul 6 02:56:03 2004 UTC
# Line 25  Line 25 
25    
26  ;;; Commentary:  ;;; Commentary:
27    
28  ;; Iimage is a minor mode that display a images, when image-filename  ;; Iimage is a minor mode that displays images, when image-filename
29  ;; exists in buffer.  ;; exists in the buffer.
30  ;; http://www.netlaputa.ne.jp/~kose/Emacs/iimage.html  ;; http://www.netlaputa.ne.jp/~kose/Emacs/iimage.html
31  ;;  ;;
32  ;; Add to your `~/.emacs':  ;; Add to your `~/.emacs':
33  ;; (autoload 'iimage-mode "iimage" "SUpport Inline image minor mode." t)  ;; (autoload 'iimage-mode "iimage" "Support Inline image minor mode." t)
34    ;; (autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t)
35  ;;  ;;
36  ;; ** Display images in *Info* buffer.  ;; ** Display images in *Info* buffer.
37  ;;  ;;
# Line 50  Line 51 
51  (eval-when-compile  (eval-when-compile
52    (require 'image-file))    (require 'image-file))
53    
54  (defconst iimage-version "1.0")  (defconst iimage-version "1.1")
55  (defvar iimage-mode nil)  (defvar iimage-mode nil)
56  (defvar iimage-mode-map nil)  (defvar iimage-mode-map nil)
57    
# Line 89  image filename regex exsamples: Line 90  image filename regex exsamples:
90       foo.JPG       foo.JPG
91  ")  ")
92    
93    (defvar iimage-mode-image-search-path nil
94    "*List of directories to search for image files for iimage-mode.")
95    
96    ;;;###autoload
97  (defun turn-on-iimage-mode ()  (defun turn-on-iimage-mode ()
98  "Unconditionally turn on iimage mode."  "Unconditionally turn on iimage mode."
99    (interactive)    (interactive)
# Line 99  image filename regex exsamples: Line 104  image filename regex exsamples:
104    (interactive)    (interactive)
105    (iimage-mode 0))    (iimage-mode 0))
106    
107    ;; Emacs21.3 or earlier does not heve locate-file.
108    (if (fboundp 'locate-file)
109        (defalias 'iimage-locate-file 'locate-file)
110      (defun iimage-locate-file (filename path)
111        (locate-library filename t path)))
112    
113  (defun iimage-mode-buffer (arg)  (defun iimage-mode-buffer (arg)
114  "Display/Undisplay Images.  "Display/Undisplay Images.
115  With numeric ARG, display the images if and only if ARG is positive."  With numeric ARG, display the images if and only if ARG is positive."
# Line 113  With numeric ARG, display the images if Line 124  With numeric ARG, display the images if
124        (dolist (pair iimage-mode-image-regex-alist)        (dolist (pair iimage-mode-image-regex-alist)
125          (while (re-search-forward (car pair) nil t)          (while (re-search-forward (car pair) nil t)
126            (if (and (setq file (match-string (cdr pair)))            (if (and (setq file (match-string (cdr pair)))
127                     (setq file (expand-file-name file default-directory))                     (setq file (iimage-locate-file file
128                     (file-exists-p file))                                     (cons default-directory
129                                             iimage-mode-image-search-path))))
130                (if ing                (if ing
131                    (add-text-properties (match-beginning 0) (match-end 0)                    (add-text-properties (match-beginning 0) (match-end 0)
132                                         (list 'display (create-image file)))                                         (list 'display (create-image file)))
# Line 122  With numeric ARG, display the images if Line 134  With numeric ARG, display the images if
134                                          '(display)))))))                                          '(display)))))))
135      (set-buffer-modified-p modp)))      (set-buffer-modified-p modp)))
136    
137    ;;;###autoload
138  (define-minor-mode iimage-mode  (define-minor-mode iimage-mode
139    "Toggle inline image minor mode."    "Toggle inline image minor mode."
140    nil " iImg" iimage-mode-map    nil " iImg" iimage-mode-map

Legend:
Removed from v.1.2.2.1  
changed lines
  Added in v.1.2.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26