From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#9516: imagemagick-register-types and image-file-name-extensions Date: Thu, 15 Sep 2011 21:34:10 +0300 Organization: JURTA Message-ID: <87wrda6k5p.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1316112694 17584 80.91.229.12 (15 Sep 2011 18:51:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Sep 2011 18:51:34 +0000 (UTC) To: 9516@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 15 20:51:31 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R4H21-0008Sm-CM for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Sep 2011 20:51:29 +0200 Original-Received: from localhost ([::1]:57918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4H20-0007bJ-W9 for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Sep 2011 14:51:28 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4H1x-0007XX-MQ for bug-gnu-emacs@gnu.org; Thu, 15 Sep 2011 14:51:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4H1v-0008HS-MJ for bug-gnu-emacs@gnu.org; Thu, 15 Sep 2011 14:51:25 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53466) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4H1u-0008HH-VK for bug-gnu-emacs@gnu.org; Thu, 15 Sep 2011 14:51:23 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R4H6P-00042Z-VL; Thu, 15 Sep 2011 14:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Sep 2011 18:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 9516 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.131611293515480 (code B ref -1); Thu, 15 Sep 2011 18:56:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Sep 2011 18:55:35 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R4H5y-00041U-Ne for submit@debbugs.gnu.org; Thu, 15 Sep 2011 14:55:35 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R4H5q-000411-3o for submit@debbugs.gnu.org; Thu, 15 Sep 2011 14:55:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4H1I-00085M-UJ for submit@debbugs.gnu.org; Thu, 15 Sep 2011 14:50:46 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:56707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4H1I-00085H-St for submit@debbugs.gnu.org; Thu, 15 Sep 2011 14:50:44 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4H1H-0007XK-Pi for bug-gnu-emacs@gnu.org; Thu, 15 Sep 2011 14:50:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4H1F-00081n-AO for bug-gnu-emacs@gnu.org; Thu, 15 Sep 2011 14:50:43 -0400 Original-Received: from smarty.dreamhost.com ([208.113.175.8]:54900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4H1F-000817-6I for bug-gnu-emacs@gnu.org; Thu, 15 Sep 2011 14:50:41 -0400 Original-Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id BF6826E804F for ; Thu, 15 Sep 2011 11:50:40 -0700 (PDT) Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 1C8EE451C3FB for ; Thu, 15 Sep 2011 11:50:39 -0700 (PDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 15 Sep 2011 14:56:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:51194 Archived-At: 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.