bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#9516: imagemagick-register-types and image-file-name-extensions


From: Juri Linkov
Subject: bug#9516: imagemagick-register-types and image-file-name-extensions
Date: Sun, 25 Sep 2011 17:03:21 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)

>> Please go ahead and commit your patch (with the regexp-quote).
>
> On second thought, there is a problem---image-file-name-extensions is a
> defcustom, so your patch would trigger a "changed outside customize"
> warning if the user tries customizing it after calling
> imagemagick-register-types.

Then we could change the function `image-file-name-regexp'
that dynamically constructs a composite regexp from
`image-file-name-extensions' and `image-file-name-regexps'.
What we could do is to add to its return value a regexp added
in `imagemagick-register-types' to `image-type-file-name-regexps'
with the assoc value `imagemagick':

=== modified file 'lisp/image-file.el'
--- lisp/image-file.el  2011-01-25 04:08:28 +0000
+++ lisp/image-file.el  2011-09-25 14:01:31 +0000
@@ -85,13 +85,12 @@ (defun image-file-name-regexp ()
                                         image-file-name-extensions)
                                  t)
                      "\\'"))))
-    (if image-file-name-regexps
-       (mapconcat 'identity
-                  (if exts-regexp
-                      (cons exts-regexp image-file-name-regexps)
-                    image-file-name-regexps)
-                  "\\|")
-      exts-regexp)))
+    (mapconcat
+     'identity
+     (delq nil (list exts-regexp
+                    image-file-name-regexps
+                    (car (rassq 'imagemagick image-type-file-name-regexps))))
+     "\\|")))

This is a temporary solution for the next release of 24.1 that
will allow image-dired.el to display Imagemagick supported images.

I think in 24.2, defcustoms in image-file.el should be deprecated
and packages should use `image-type-file-name-regexps' instead.





reply via email to

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