all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#9516: imagemagick-register-types and image-file-name-extensions
@ 2011-09-15 18:34 Juri Linkov
  2011-09-16  2:23 ` Stefan Monnier
  2011-09-16 13:34 ` Stefan Monnier
  0 siblings, 2 replies; 10+ messages in thread
From: Juri Linkov @ 2011-09-15 18:34 UTC (permalink / raw)
  To: 9516

In Dired typing `C-t C-t' (`image-dired-dired-toggle-marked-thumbs')
doesn't show images supported by ImageMagick.

It gets file extensions of supported image types by calling the function
`image-file-name-regexp' and it gets them from the variable
`image-file-name-extensions' that currently misses file extensions
supported by ImageMagick.

I propose a fix that adds them to `image-file-name-extensions'
in `imagemagick-register-types':

=== modified file 'lisp/image.el'
--- lisp/image.el	2011-07-25 08:23:29 +0000
+++ lisp/image.el	2011-09-15 18:32:51 +0000
@@ -699,11 +699,11 @@ (defun imagemagick-register-types ()
       (dolist (im-inhibit imagemagick-types-inhibit)
 	(setq im-types (delq im-inhibit im-types)))
       (dolist (im-type im-types)
-	(let ((extension
-	       (concat "\\." (downcase (symbol-name im-type))
-		       "\\'")))
-	  (push (cons extension 'image-mode) auto-mode-alist)
-	  (push (cons extension 'imagemagick)
+	(let* ((extension (downcase (symbol-name im-type)))
+	       (extension-regexp (concat "\\." extension "\\'")))
+	  (push extension image-file-name-extensions)
+	  (push (cons extension-regexp 'image-mode) auto-mode-alist)
+	  (push (cons extension-regexp 'imagemagick)
 		image-type-file-name-regexps))))))

There are other packages that rely on image file extensions
defined in image-file.el:

./iimage.el:61:				     image-file-name-extensions)
./iimage.el:62:			     image-file-name-extensions)
./image-dired.el:548:  (unless (string-match (image-file-name-regexp) file)
./image-dired.el:656:     (when (and image-file (string-match-p (image-file-name-regexp) image-file))
./image-dired.el:867:  (dired-mark-files-regexp (image-file-name-regexp))
./org/org.el:19319:  (if (and (not extensions) (fboundp 'image-file-name-regexp))
./org/org.el:19320:      (image-file-name-regexp)
./org/org.el:19321:    (let ((image-file-name-extensions
./org/org.el:19327:					 image-file-name-extensions)
./org/org.el:19328:				 image-file-name-extensions)
./thumbs.el:228:	    (directory-files (thumbs-thumbsdir) t (image-file-name-regexp)))
./thumbs.el:411:   (directory-files dir t (or reg (image-file-name-regexp)))

I suppose all they will benefit from this fix as well.





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-09-26 19:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-15 18:34 bug#9516: imagemagick-register-types and image-file-name-extensions Juri Linkov
2011-09-16  2:23 ` Stefan Monnier
2011-09-16 13:34 ` Stefan Monnier
2011-09-16 14:09   ` Juri Linkov
2011-09-23 21:34     ` Chong Yidong
2011-09-23 21:40       ` Chong Yidong
2011-09-25 14:03         ` Juri Linkov
2019-09-25 12:30           ` Lars Ingebrigtsen
2019-09-25 19:57             ` Juri Linkov
2019-09-26 19:27               ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.