mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-04 06:31:13 -08:00
* lisp/image.el (image-type-from-file-name): Trivial simplification.
This commit is contained in:
parent
3a6851d9b4
commit
11fef14abb
2 changed files with 9 additions and 10 deletions
|
|
@ -1,5 +1,7 @@
|
|||
2012-11-02 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* image.el (image-type-from-file-name): Trivial simplification.
|
||||
|
||||
* emacs-lisp/bytecomp.el (byte-compile-eval):
|
||||
Decouple "noruntime" and "cl-functions" warnings.
|
||||
|
||||
|
|
|
|||
|
|
@ -309,16 +309,13 @@ be determined."
|
|||
Value is a symbol specifying the image type, or nil if type cannot
|
||||
be determined."
|
||||
(let (type first)
|
||||
(or
|
||||
(catch 'found
|
||||
(dolist (elem image-type-file-name-regexps)
|
||||
(when (string-match-p (car elem) file)
|
||||
(setq type (cdr elem))
|
||||
(or first (setq first type))
|
||||
(if (image-type-available-p type)
|
||||
(throw 'found type)))))
|
||||
;; If nothing seems to be supported, return the first type that matched.
|
||||
first)))
|
||||
(catch 'found
|
||||
(dolist (elem image-type-file-name-regexps first)
|
||||
(when (string-match-p (car elem) file)
|
||||
(if (image-type-available-p (setq type (cdr elem)))
|
||||
(throw 'found type)
|
||||
;; If nothing seems to be supported, return first type that matched.
|
||||
(or first (setq first type))))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun image-type (source &optional type data-p)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue