diff options
| author | Glenn Morris | 2012-11-02 18:41:35 -0400 |
|---|---|---|
| committer | Glenn Morris | 2012-11-02 18:41:35 -0400 |
| commit | 11fef14abb1fdd7424295c3c50d59bf18bb6c4e7 (patch) | |
| tree | b409ef1a086c3810192adbf51211fd46da103295 | |
| parent | 3a6851d9b459836e1a72af13f44a17d02d9fccc9 (diff) | |
| download | emacs-11fef14abb1fdd7424295c3c50d59bf18bb6c4e7.tar.gz emacs-11fef14abb1fdd7424295c3c50d59bf18bb6c4e7.zip | |
* lisp/image.el (image-type-from-file-name): Trivial simplification.
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/image.el | 17 |
2 files changed, 9 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 747bbba97c4..a6c9482c5aa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2012-11-02 Glenn Morris <rgm@gnu.org> | 1 | 2012-11-02 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * image.el (image-type-from-file-name): Trivial simplification. | ||
| 4 | |||
| 3 | * emacs-lisp/bytecomp.el (byte-compile-eval): | 5 | * emacs-lisp/bytecomp.el (byte-compile-eval): |
| 4 | Decouple "noruntime" and "cl-functions" warnings. | 6 | Decouple "noruntime" and "cl-functions" warnings. |
| 5 | 7 | ||
diff --git a/lisp/image.el b/lisp/image.el index aef44fc3701..bd2f5c3a3ca 100644 --- a/lisp/image.el +++ b/lisp/image.el | |||
| @@ -309,16 +309,13 @@ be determined." | |||
| 309 | Value is a symbol specifying the image type, or nil if type cannot | 309 | Value is a symbol specifying the image type, or nil if type cannot |
| 310 | be determined." | 310 | be determined." |
| 311 | (let (type first) | 311 | (let (type first) |
| 312 | (or | 312 | (catch 'found |
| 313 | (catch 'found | 313 | (dolist (elem image-type-file-name-regexps first) |
| 314 | (dolist (elem image-type-file-name-regexps) | 314 | (when (string-match-p (car elem) file) |
| 315 | (when (string-match-p (car elem) file) | 315 | (if (image-type-available-p (setq type (cdr elem))) |
| 316 | (setq type (cdr elem)) | 316 | (throw 'found type) |
| 317 | (or first (setq first type)) | 317 | ;; If nothing seems to be supported, return first type that matched. |
| 318 | (if (image-type-available-p type) | 318 | (or first (setq first type)))))))) |
| 319 | (throw 'found type))))) | ||
| 320 | ;; If nothing seems to be supported, return the first type that matched. | ||
| 321 | first))) | ||
| 322 | 319 | ||
| 323 | ;;;###autoload | 320 | ;;;###autoload |
| 324 | (defun image-type (source &optional type data-p) | 321 | (defun image-type (source &optional type data-p) |