GNU bug report logs - #9516
imagemagick-register-types and image-file-name-extensions

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Juri Linkov <juri@HIDDEN>; dated Thu, 15 Sep 2011 18:56:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 9516 <at> debbugs.gnu.org:


Received: (at 9516) by debbugs.gnu.org; 25 Sep 2011 14:15:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 25 10:15:20 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1R7pUF-0003yU-Ot
	for submit <at> debbugs.gnu.org; Sun, 25 Sep 2011 10:15:20 -0400
Received: from smarty.dreamhost.com ([208.113.175.8])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <juri@HIDDEN>) id 1R7pUD-0003tT-5d
	for 9516 <at> debbugs.gnu.org; Sun, 25 Sep 2011 10:15:18 -0400
Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105])
	by smarty.dreamhost.com (Postfix) with ESMTP id 516496E804D;
	Sun, 25 Sep 2011 07:14:38 -0700 (PDT)
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 62AB7451C330;
	Sun, 25 Sep 2011 07:14:35 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Chong Yidong <cyd@HIDDEN>
Subject: Re: bug#9516: imagemagick-register-types and
	image-file-name-extensions
Organization: JURTA
References: <87wrda6k5p.fsf@HIDDEN>
	<jwvsjnwtxwg.fsf-monnier+emacs@HIDDEN>
	<874o0cd1ea.fsf@HIDDEN> <87k48zeyeo.fsf@HIDDEN>
	<87fwjney3e.fsf@HIDDEN>
Date: Sun, 25 Sep 2011 17:03:21 +0300
In-Reply-To: <87fwjney3e.fsf@HIDDEN> (Chong Yidong's message of
	"Fri, 23 Sep 2011 17:40:53 -0400")
Message-ID: <874o00d8de.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 9516
Cc: 9516 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

>> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#9516; Package emacs. Full text available.

Message received at 9516 <at> debbugs.gnu.org:


Received: (at 9516) by debbugs.gnu.org; 23 Sep 2011 21:41:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 23 17:41:25 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1R7DUq-00015v-Lr
	for submit <at> debbugs.gnu.org; Fri, 23 Sep 2011 17:41:25 -0400
Received: from vm-emlprdomr-06.its.yale.edu ([130.132.50.147])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <cyd@HIDDEN>) id 1R7DUo-00015o-JE
	for 9516 <at> debbugs.gnu.org; Fri, 23 Sep 2011 17:41:23 -0400
Received: from furball (dhcp-128-36-14-81.central.yale.edu [128.36.14.81])
	(authenticated bits=0)
	by vm-emlprdomr-06.its.yale.edu (8.14.4/8.14.4) with ESMTP id
	p8NLerjp012523
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);
	Fri, 23 Sep 2011 17:40:53 -0400
From: Chong Yidong <cyd@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#9516: imagemagick-register-types and
	image-file-name-extensions
References: <87wrda6k5p.fsf@HIDDEN>
	<jwvsjnwtxwg.fsf-monnier+emacs@HIDDEN>
	<874o0cd1ea.fsf@HIDDEN> <87k48zeyeo.fsf@HIDDEN>
Date: Fri, 23 Sep 2011 17:40:53 -0400
In-Reply-To: <87k48zeyeo.fsf@HIDDEN> (Chong Yidong's message of
	"Fri, 23 Sep 2011 17:34:07 -0400")
Message-ID: <87fwjney3e.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Scanned-By: MIMEDefang 2.71 on 130.132.50.147
X-Spam-Score: -2.7 (--)
X-Debbugs-Envelope-To: 9516
Cc: 9516 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.7 (--)

Chong Yidong <cyd@HIDDEN> writes:

> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#9516; Package emacs. Full text available.

Message received at 9516 <at> debbugs.gnu.org:


Received: (at 9516) by debbugs.gnu.org; 23 Sep 2011 21:34:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 23 17:34:40 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1R7DOK-0000we-1v
	for submit <at> debbugs.gnu.org; Fri, 23 Sep 2011 17:34:40 -0400
Received: from vm-emlprdomr-06.its.yale.edu ([130.132.50.147])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <cyd@HIDDEN>) id 1R7DOG-0000wW-S6
	for 9516 <at> debbugs.gnu.org; Fri, 23 Sep 2011 17:34:37 -0400
Received: from furball (dhcp-128-36-14-81.central.yale.edu [128.36.14.81])
	(authenticated bits=0)
	by vm-emlprdomr-06.its.yale.edu (8.14.4/8.14.4) with ESMTP id
	p8NLY78H009582
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);
	Fri, 23 Sep 2011 17:34:07 -0400
From: Chong Yidong <cyd@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#9516: imagemagick-register-types and
	image-file-name-extensions
References: <87wrda6k5p.fsf@HIDDEN>
	<jwvsjnwtxwg.fsf-monnier+emacs@HIDDEN>
	<874o0cd1ea.fsf@HIDDEN>
Date: Fri, 23 Sep 2011 17:34:07 -0400
In-Reply-To: <874o0cd1ea.fsf@HIDDEN> (Juri Linkov's message of "Fri,
	16 Sep 2011 17:09:49 +0300")
Message-ID: <87k48zeyeo.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Scanned-By: MIMEDefang 2.71 on 130.132.50.147
X-Spam-Score: -2.7 (--)
X-Debbugs-Envelope-To: 9516
Cc: 9516 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.7 (--)

Juri Linkov <juri@HIDDEN> writes:

> It seems image-file.el is semi-obsoleted by image-mode.el,
> so it should use more general settings from image-type-file-name-regexps.
> And other packages should be fixed to use more general settings
> from image.el instead of relying on definitions from image-file.el.

Sounds right, though I think that can wait till post-release.

Please go ahead and commit your patch (with the regexp-quote).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#9516; Package emacs. Full text available.

Message received at 9516 <at> debbugs.gnu.org:


Received: (at 9516) by debbugs.gnu.org; 16 Sep 2011 20:14:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 16 16:14:01 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1R4enQ-0000KJ-UG
	for submit <at> debbugs.gnu.org; Fri, 16 Sep 2011 16:14:01 -0400
Received: from smarty.dreamhost.com ([208.113.175.8])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <juri@HIDDEN>) id 1R4enL-0000K8-83
	for 9516 <at> debbugs.gnu.org; Fri, 16 Sep 2011 16:13:55 -0400
Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105])
	by smarty.dreamhost.com (Postfix) with ESMTP id 73A53498205;
	Fri, 16 Sep 2011 07:14:55 -0700 (PDT)
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 07235451C40B;
	Fri, 16 Sep 2011 07:11:23 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#9516: imagemagick-register-types and
	image-file-name-extensions
Organization: JURTA
References: <87wrda6k5p.fsf@HIDDEN>
	<jwvsjnwtxwg.fsf-monnier+emacs@HIDDEN>
Date: Fri, 16 Sep 2011 17:09:49 +0300
In-Reply-To: <jwvsjnwtxwg.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
	of "Fri, 16 Sep 2011 09:34:17 -0400")
Message-ID: <874o0cd1ea.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 9516
Cc: 9516 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

>> I propose a fix that adds them to `image-file-name-extensions'
>> in `imagemagick-register-types':
>
> There's something I don't understand:
> - why do we have both image-file-name-extensions and image-file-name-regexps?

I guess for historical reasons.

> - why doesn't image-file.el use image-type-file-name-regexps?

It seems image-file.el is semi-obsoleted by image-mode.el,
so it should use more general settings from image-type-file-name-regexps.
And other packages should be fixed to use more general settings
from image.el instead of relying on definitions from image-file.el.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#9516; Package emacs. Full text available.

Message received at 9516 <at> debbugs.gnu.org:


Received: (at 9516) by debbugs.gnu.org; 16 Sep 2011 13:39:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 16 09:39:04 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1R4YdE-0004OU-6a
	for submit <at> debbugs.gnu.org; Fri, 16 Sep 2011 09:39:04 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.183]
	helo=ironport2-out.pppoe.ca)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier@HIDDEN>) id 1R4YdC-0004OC-Gs
	for 9516 <at> debbugs.gnu.org; Fri, 16 Sep 2011 09:39:02 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av0EAC5Pc05FpYYd/2dsb2JhbABCp1p4gVMBAQQBViMFCws0EhQYDSSICrQBhngEoE6ERA
X-IronPort-AV: E=Sophos;i="4.68,393,1312171200"; d="scan'208";a="136700052"
Received: from 69-165-134-29.dsl.teksavvy.com (HELO pastel.home)
	([69.165.134.29])
	by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA;
	16 Sep 2011 09:34:17 -0400
Received: by pastel.home (Postfix, from userid 20848)
	id 779F158F87; Fri, 16 Sep 2011 09:34:17 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#9516: imagemagick-register-types and
	image-file-name-extensions
Message-ID: <jwvsjnwtxwg.fsf-monnier+emacs@HIDDEN>
References: <87wrda6k5p.fsf@HIDDEN>
Date: Fri, 16 Sep 2011 09:34:17 -0400
In-Reply-To: <87wrda6k5p.fsf@HIDDEN> (Juri Linkov's message of "Thu,
	15 Sep 2011 21:34:10 +0300")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 9516
Cc: 9516 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.1 (--)

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

There's something I don't understand:
- why do we have both image-file-name-extensions and image-file-name-regexps?
- why doesn't image-file.el use image-type-file-name-regexps?


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#9516; Package emacs. Full text available.

Message received at 9516 <at> debbugs.gnu.org:


Received: (at 9516) by debbugs.gnu.org; 16 Sep 2011 02:28:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 15 22:28:15 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1R4OA3-0004FY-5w
	for submit <at> debbugs.gnu.org; Thu, 15 Sep 2011 22:28:15 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.181]
	helo=ironport2-out.pppoe.ca)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier@HIDDEN>) id 1R4OA1-0004FR-GT
	for 9516 <at> debbugs.gnu.org; Thu, 15 Sep 2011 22:28:14 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AkwJAC6yck5FpYYd/2dsb2JhbABBmEyPDHmBUwEBBVYjEAs0EhQYDSS9KoZ0BKBJhEQ
X-IronPort-AV: E=Sophos;i="4.68,391,1312171200"; d="scan'208";a="136659020"
Received: from 69-165-134-29.dsl.teksavvy.com (HELO ceviche.home)
	([69.165.134.29])
	by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA;
	15 Sep 2011 22:23:30 -0400
Received: by ceviche.home (Postfix, from userid 20848)
	id B9A7D660B6; Thu, 15 Sep 2011 22:23:29 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#9516: imagemagick-register-types and
	image-file-name-extensions
Message-ID: <jwvfwjxjkeu.fsf-monnier+emacs@HIDDEN>
References: <87wrda6k5p.fsf@HIDDEN>
Date: Thu, 15 Sep 2011 22:23:29 -0400
In-Reply-To: <87wrda6k5p.fsf@HIDDEN> (Juri Linkov's message of "Thu,
	15 Sep 2011 21:34:10 +0300")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 9516
Cc: 9516 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.1 (--)

> +	       (extension-regexp (concat "\\." extension "\\'")))

You forgot a regexp-quote.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#9516; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 Sep 2011 18:55:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 15 14:55:35 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1R4H5y-00041U-Ne
	for submit <at> debbugs.gnu.org; Thu, 15 Sep 2011 14:55:35 -0400
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <juri@HIDDEN>) id 1R4H5q-000411-3o
	for submit <at> debbugs.gnu.org; Thu, 15 Sep 2011 14:55:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <juri@HIDDEN>) id 1R4H1I-00085M-UJ
	for submit <at> debbugs.gnu.org; Thu, 15 Sep 2011 14:50:46 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE
	autolearn=unavailable version=3.3.1
Received: from lists.gnu.org ([140.186.70.17]:56707)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <juri@HIDDEN>) id 1R4H1I-00085H-St
	for submit <at> debbugs.gnu.org; Thu, 15 Sep 2011 14:50:44 -0400
Received: from eggs.gnu.org ([140.186.70.92]:51221)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <juri@HIDDEN>) id 1R4H1H-0007XK-Pi
	for bug-gnu-emacs@HIDDEN; Thu, 15 Sep 2011 14:50:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <juri@HIDDEN>) id 1R4H1F-00081n-AO
	for bug-gnu-emacs@HIDDEN; Thu, 15 Sep 2011 14:50:43 -0400
Received: from smarty.dreamhost.com ([208.113.175.8]:54900)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <juri@HIDDEN>) id 1R4H1F-000817-6I
	for bug-gnu-emacs@HIDDEN; Thu, 15 Sep 2011 14:50:41 -0400
Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105])
	by smarty.dreamhost.com (Postfix) with ESMTP id BF6826E804F
	for <bug-gnu-emacs@HIDDEN>; Thu, 15 Sep 2011 11:50:40 -0700 (PDT)
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 1C8EE451C3FB
	for <bug-gnu-emacs@HIDDEN>; Thu, 15 Sep 2011 11:50:39 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: imagemagick-register-types and image-file-name-extensions
Organization: JURTA
Date: Thu, 15 Sep 2011 21:34:10 +0300
Message-ID: <87wrda6k5p.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
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-Received-From: 140.186.70.17
X-Spam-Score: -4.6 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.6 (----)

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.




Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#9516; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.