diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/image.el | 45 |
2 files changed, 31 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b82b56dd166..6c21786bce8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-05-29 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * image.el (imagemagick-types-inhibit) | ||
| 4 | (imagemagick-register-types): Doc fix. | ||
| 5 | |||
| 1 | 2011-05-29 Deniz Dogan <deniz@dogan.se> | 6 | 2011-05-29 Deniz Dogan <deniz@dogan.se> |
| 2 | 7 | ||
| 3 | * net/rcirc.el (rcirc): Use the user's stored encryption method by | 8 | * net/rcirc.el (rcirc): Use the user's stored encryption method by |
diff --git a/lisp/image.el b/lisp/image.el index 3b90ac46bd1..3f44be868ce 100644 --- a/lisp/image.el +++ b/lisp/image.el | |||
| @@ -698,31 +698,38 @@ shall be displayed." | |||
| 698 | 698 | ||
| 699 | (defcustom imagemagick-types-inhibit | 699 | (defcustom imagemagick-types-inhibit |
| 700 | '(C HTML HTM TXT PDF) | 700 | '(C HTML HTM TXT PDF) |
| 701 | ;; FIXME what are the possible options? | 701 | "ImageMagick types that Emacs should not use ImageMagick to handle. |
| 702 | ;; Are these actually file-name extensions? | 702 | This should be a list of symbols, each of which has the same |
| 703 | ;; Why are these upper-case when eg image-types is lower-case? | 703 | names as one of the format tags used internally by ImageMagick; |
| 704 | "Types the ImageMagick loader should not try to handle." | 704 | see `imagemagick-types'. Entries in this list are excluded from |
| 705 | :type '(choice (const :tag "Let ImageMagick handle all the types it can" nil) | 705 | being registered by `imagemagick-register-types'. |
| 706 | |||
| 707 | If Emacs is compiled without ImageMagick, this variable has no effect." | ||
| 708 | :type '(choice (const :tag "Let ImageMagick handle all types it can" nil) | ||
| 706 | (repeat symbol)) | 709 | (repeat symbol)) |
| 707 | :version "24.1" | 710 | :version "24.1" |
| 708 | :group 'image) | 711 | :group 'image) |
| 709 | 712 | ||
| 710 | ;;;###autoload | 713 | ;;;###autoload |
| 711 | (defun imagemagick-register-types () | 714 | (defun imagemagick-register-types () |
| 712 | "Register the file types that ImageMagick is able to handle." | 715 | "Register file types that can be handled by ImageMagick. |
| 713 | (if (fboundp 'imagemagick-types) | 716 | This adds the file types returned by `imagemagick-types' |
| 714 | (let ((im-types (imagemagick-types))) | 717 | \(excluding the ones in `imagemagick-types-inhibit') to |
| 715 | (dolist (im-inhibit imagemagick-types-inhibit) | 718 | `auto-mode-alist' and `image-type-file-name-regexps', so that |
| 716 | (setq im-types (remove im-inhibit im-types))) | 719 | Emacs visits them in Image mode. |
| 717 | (dolist (im-type im-types) | 720 | |
| 718 | (let ((extension (downcase (symbol-name im-type)))) | 721 | If Emacs is compiled without ImageMagick support, do nothing." |
| 719 | (push | 722 | (when (fboundp 'imagemagick-types) |
| 720 | (cons (concat "\\." extension "\\'") 'image-mode) | 723 | (let ((im-types (imagemagick-types))) |
| 721 | auto-mode-alist) | 724 | (dolist (im-inhibit imagemagick-types-inhibit) |
| 722 | (push | 725 | (setq im-types (delq im-inhibit im-types))) |
| 723 | (cons (concat "\\." extension "\\'") 'imagemagick) | 726 | (dolist (im-type im-types) |
| 724 | image-type-file-name-regexps)))) | 727 | (let ((extension |
| 725 | (error "Emacs was not built with ImageMagick support"))) | 728 | (concat "\\." (downcase (symbol-name im-type)) |
| 729 | "\\'"))) | ||
| 730 | (push (cons extension 'image-mode) auto-mode-alist) | ||
| 731 | (push (cons extension 'imagemagick) | ||
| 732 | image-type-file-name-regexps)))))) | ||
| 726 | 733 | ||
| 727 | (provide 'image) | 734 | (provide 'image) |
| 728 | 735 | ||