emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110774: * lisp/image.el (image-type-


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110774: * lisp/image.el (image-type-from-file-name): Trivial simplification.
Date: Fri, 02 Nov 2012 18:41:35 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110774
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Fri 2012-11-02 18:41:35 -0400
message:
  * lisp/image.el (image-type-from-file-name): Trivial simplification.
modified:
  lisp/ChangeLog
  lisp/image.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-11-02 22:35:01 +0000
+++ b/lisp/ChangeLog    2012-11-02 22:41:35 +0000
@@ -1,5 +1,7 @@
 2012-11-02  Glenn Morris  <address@hidden>
 
+       * image.el (image-type-from-file-name): Trivial simplification.
+
        * emacs-lisp/bytecomp.el (byte-compile-eval):
        Decouple "noruntime" and "cl-functions" warnings.
 

=== modified file 'lisp/image.el'
--- a/lisp/image.el     2012-10-23 00:46:11 +0000
+++ b/lisp/image.el     2012-11-02 22:41:35 +0000
@@ -309,16 +309,13 @@
 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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]