diff options
| author | Eli Zaretskii | 2004-07-03 09:54:20 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2004-07-03 09:54:20 +0000 |
| commit | 610101de3efe3a59e7fcc8664d6a3756b9981a49 (patch) | |
| tree | 537312aa0f8e30d5bcae2ef9228cf42f3c840545 | |
| parent | 7731023b5024f97e73317a60f99b6124916eae60 (diff) | |
| download | emacs-610101de3efe3a59e7fcc8664d6a3756b9981a49.tar.gz emacs-610101de3efe3a59e7fcc8664d6a3756b9981a49.zip | |
(turn-on-iimage-mode, iimage-mode): Add autoload cookies.
(iimage-mode-image-search-path): New user option to search the
image file.
(iimage-locate-file): New funcion. Emacs21.3 or earlier does not
have locate-file.
(iimage-mode-buffer): Use it.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/iimage.el | 25 |
2 files changed, 29 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b6ab8ca604c..19ecb15cf2d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2004-07-03 KOSEKI Yoshinori <kose@meadowy.org> | ||
| 2 | |||
| 3 | * iimage.el (turn-on-iimage-mode, iimage-mode): Add autoload | ||
| 4 | cookies. | ||
| 5 | (iimage-mode-image-search-path): New user option to search the | ||
| 6 | image file. | ||
| 7 | (iimage-locate-file): New funcion. Emacs21.3 or earlier does not | ||
| 8 | have locate-file. | ||
| 9 | (iimage-mode-buffer): Use it. | ||
| 10 | |||
| 1 | 2004-07-03 Nick Roberts <nickrob@gnu.org> | 11 | 2004-07-03 Nick Roberts <nickrob@gnu.org> |
| 2 | 12 | ||
| 3 | * progmodes/gdb-ui.el (gdb-goto-breakpoint): String match more | 13 | * progmodes/gdb-ui.el (gdb-goto-breakpoint): String match more |
diff --git a/lisp/iimage.el b/lisp/iimage.el index d138498ca3a..9b183ebb01d 100644 --- a/lisp/iimage.el +++ b/lisp/iimage.el | |||
| @@ -25,12 +25,13 @@ | |||
| 25 | 25 | ||
| 26 | ;;; Commentary: | 26 | ;;; Commentary: |
| 27 | 27 | ||
| 28 | ;; Iimage is a minor mode that display a images, when image-filename | 28 | ;; Iimage is a minor mode that displays images, when image-filename |
| 29 | ;; exists in buffer. | 29 | ;; exists in the buffer. |
| 30 | ;; http://www.netlaputa.ne.jp/~kose/Emacs/iimage.html | 30 | ;; http://www.netlaputa.ne.jp/~kose/Emacs/iimage.html |
| 31 | ;; | 31 | ;; |
| 32 | ;; Add to your `~/.emacs': | 32 | ;; Add to your `~/.emacs': |
| 33 | ;; (autoload 'iimage-mode "iimage" "SUpport Inline image minor mode." t) | 33 | ;; (autoload 'iimage-mode "iimage" "Support Inline image minor mode." t) |
| 34 | ;; (autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t) | ||
| 34 | ;; | 35 | ;; |
| 35 | ;; ** Display images in *Info* buffer. | 36 | ;; ** Display images in *Info* buffer. |
| 36 | ;; | 37 | ;; |
| @@ -50,7 +51,7 @@ | |||
| 50 | (eval-when-compile | 51 | (eval-when-compile |
| 51 | (require 'image-file)) | 52 | (require 'image-file)) |
| 52 | 53 | ||
| 53 | (defconst iimage-version "1.0") | 54 | (defconst iimage-version "1.1") |
| 54 | (defvar iimage-mode nil) | 55 | (defvar iimage-mode nil) |
| 55 | (defvar iimage-mode-map nil) | 56 | (defvar iimage-mode-map nil) |
| 56 | 57 | ||
| @@ -89,6 +90,10 @@ image filename regex exsamples: | |||
| 89 | foo.JPG | 90 | foo.JPG |
| 90 | ") | 91 | ") |
| 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 | ||
| 92 | (defun turn-on-iimage-mode () | 97 | (defun turn-on-iimage-mode () |
| 93 | "Unconditionally turn on iimage mode." | 98 | "Unconditionally turn on iimage mode." |
| 94 | (interactive) | 99 | (interactive) |
| @@ -99,6 +104,12 @@ image filename regex exsamples: | |||
| 99 | (interactive) | 104 | (interactive) |
| 100 | (iimage-mode 0)) | 105 | (iimage-mode 0)) |
| 101 | 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 | |||
| 102 | (defun iimage-mode-buffer (arg) | 113 | (defun iimage-mode-buffer (arg) |
| 103 | "Display/Undisplay Images. | 114 | "Display/Undisplay Images. |
| 104 | With numeric ARG, display the images if and only if ARG is positive." | 115 | With numeric ARG, display the images if and only if ARG is positive." |
| @@ -113,8 +124,9 @@ With numeric ARG, display the images if and only if ARG is positive." | |||
| 113 | (dolist (pair iimage-mode-image-regex-alist) | 124 | (dolist (pair iimage-mode-image-regex-alist) |
| 114 | (while (re-search-forward (car pair) nil t) | 125 | (while (re-search-forward (car pair) nil t) |
| 115 | (if (and (setq file (match-string (cdr pair))) | 126 | (if (and (setq file (match-string (cdr pair))) |
| 116 | (setq file (expand-file-name file default-directory)) | 127 | (setq file (iimage-locate-file file |
| 117 | (file-exists-p file)) | 128 | (cons default-directory |
| 129 | iimage-mode-image-search-path)))) | ||
| 118 | (if ing | 130 | (if ing |
| 119 | (add-text-properties (match-beginning 0) (match-end 0) | 131 | (add-text-properties (match-beginning 0) (match-end 0) |
| 120 | (list 'display (create-image file))) | 132 | (list 'display (create-image file))) |
| @@ -122,6 +134,7 @@ With numeric ARG, display the images if and only if ARG is positive." | |||
| 122 | '(display))))))) | 134 | '(display))))))) |
| 123 | (set-buffer-modified-p modp))) | 135 | (set-buffer-modified-p modp))) |
| 124 | 136 | ||
| 137 | ;;;###autoload | ||
| 125 | (define-minor-mode iimage-mode | 138 | (define-minor-mode iimage-mode |
| 126 | "Toggle inline image minor mode." | 139 | "Toggle inline image minor mode." |
| 127 | nil " iImg" iimage-mode-map | 140 | nil " iImg" iimage-mode-map |