Commit 11fef14a authored by Glenn Morris's avatar Glenn Morris

* lisp/image.el (image-type-from-file-name): Trivial simplification.

parent 3a6851d9
2012-11-02 Glenn Morris <rgm@gnu.org> 2012-11-02 Glenn Morris <rgm@gnu.org>
* image.el (image-type-from-file-name): Trivial simplification.
* emacs-lisp/bytecomp.el (byte-compile-eval): * emacs-lisp/bytecomp.el (byte-compile-eval):
Decouple "noruntime" and "cl-functions" warnings. Decouple "noruntime" and "cl-functions" warnings.
......
...@@ -309,16 +309,13 @@ be determined." ...@@ -309,16 +309,13 @@ be determined."
Value is a symbol specifying the image type, or nil if type cannot Value is a symbol specifying the image type, or nil if type cannot
be determined." be determined."
(let (type first) (let (type first)
(or (catch 'found
(catch 'found (dolist (elem image-type-file-name-regexps first)
(dolist (elem image-type-file-name-regexps) (when (string-match-p (car elem) file)
(when (string-match-p (car elem) file) (if (image-type-available-p (setq type (cdr elem)))
(setq type (cdr elem)) (throw 'found type)
(or first (setq first type)) ;; If nothing seems to be supported, return first type that matched.
(if (image-type-available-p type) (or first (setq first type))))))))
(throw 'found type)))))
;; If nothing seems to be supported, return the first type that matched.
first)))
;;;###autoload ;;;###autoload
(defun image-type (source &optional type data-p) (defun image-type (source &optional type data-p)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment