Gnus development mailing list
 help / color / mirror / Atom feed
* mailcap - caching "nil" failed test
@ 2006-01-27 22:15 Kevin Ryde
  2006-01-31  1:12 ` Katsumi Yamaoka
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Ryde @ 2006-01-27 22:15 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 810 bytes --]

If there's a mailcap-mime-data entry with no 'test clause, then I
think mailcap-viewer-test-cache is getting an entry "(nil t)" which
means that "nil" for failure comes back as "t" for success.

I struck this with a silly mozilla entry in the debian /etc/mailcap,
"text/html; false; x-mozilla-flags=internal" when viewing some html.
It then makes failed tests like my pdf on a dumb tty example end up
getting run.

2006-01-28  Kevin Ryde  <user42@zip.com.au>

	* mailcap.el (mailcap-viewer-passes-test): Don't put "(nil t)" into
	mailcap-viewer-test-cache when there's no 'test clause, since that
	will invert the meaning of a "nil" test previously determined by
	mailcap-mailcap-entry-passes-test.

In the diff below I didn't reindent the second half of the func, so as
to best show the actual bits changed.


[-- Attachment #2: mailcap.el.no-cache.diff --]
[-- Type: text/plain, Size: 981 bytes --]

--- mailcap.el.~7.8.~	2006-01-26 09:44:03.000000000 +1100
+++ mailcap.el	2006-01-28 09:01:39.000000000 +1100
@@ -644,12 +644,13 @@
 	 (viewer (cdr (assoc 'viewer viewer-info)))
 	 (default-directory (expand-file-name "~/"))
 	 status parsed-test cache result)
-    (if (setq cache (assoc test mailcap-viewer-test-cache))
-	(cadr cache)
+    (cond ((setq cache (assoc test mailcap-viewer-test-cache))
+	   (cadr cache))
+          ((not test-info) t)		; No test clause
+          (t
       (setq
        result
        (cond
-	((not test-info) t)		; No test clause
 	((not test) nil)		; Already failed test
 	((eq test t) t)			; Already passed test
 	((functionp test)		; Lisp function as test
@@ -667,7 +668,7 @@
 	       status (apply 'call-process test))
 	 (eq 0 status))))
       (push (list otest result) mailcap-viewer-test-cache)
-      result)))
+      result))))
 
 (defun mailcap-add-mailcap-entry (major minor info)
   (let ((old-major (assoc major mailcap-mime-data)))

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

* Re: mailcap - caching "nil" failed test
  2006-01-27 22:15 mailcap - caching "nil" failed test Kevin Ryde
@ 2006-01-31  1:12 ` Katsumi Yamaoka
  2006-02-03 14:54   ` Zlatko Calusic
  0 siblings, 1 reply; 4+ messages in thread
From: Katsumi Yamaoka @ 2006-01-31  1:12 UTC (permalink / raw)
  Cc: ding

>>>>> In <87mzhhjp1e.fsf@zip.com.au> Kevin Ryde wrote:

> If there's a mailcap-mime-data entry with no 'test clause, then I
> think mailcap-viewer-test-cache is getting an entry "(nil t)" which
> means that "nil" for failure comes back as "t" for success.

> I struck this with a silly mozilla entry in the debian /etc/mailcap,
> "text/html; false; x-mozilla-flags=internal" when viewing some html.
> It then makes failed tests like my pdf on a dumb tty example end up
> getting run.

> 2006-01-28  Kevin Ryde  <user42@zip.com.au>

> 	* mailcap.el (mailcap-viewer-passes-test): Don't put "(nil t)" into
> 	mailcap-viewer-test-cache when there's no 'test clause, since that
> 	will invert the meaning of a "nil" test previously determined by
> 	mailcap-mailcap-entry-passes-test.

> In the diff below I didn't reindent the second half of the func, so as
> to best show the actual bits changed.

I've applied your patch to the trunk and the v5-10 branch.
Thank you.



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

* Re: mailcap - caching "nil" failed test
  2006-01-31  1:12 ` Katsumi Yamaoka
@ 2006-02-03 14:54   ` Zlatko Calusic
  2006-02-03 21:09     ` Kevin Ryde
  0 siblings, 1 reply; 4+ messages in thread
From: Zlatko Calusic @ 2006-02-03 14:54 UTC (permalink / raw)
  Cc: Kevin Ryde, ding

Katsumi Yamaoka <yamaoka@jpl.org> writes:

>>>>>> In <87mzhhjp1e.fsf@zip.com.au> Kevin Ryde wrote:
>
>> If there's a mailcap-mime-data entry with no 'test clause, then I
>> think mailcap-viewer-test-cache is getting an entry "(nil t)" which
>> means that "nil" for failure comes back as "t" for success.
>
>> I struck this with a silly mozilla entry in the debian /etc/mailcap,
>> "text/html; false; x-mozilla-flags=internal" when viewing some html.
>> It then makes failed tests like my pdf on a dumb tty example end up
>> getting run.
>
>> 2006-01-28  Kevin Ryde  <user42@zip.com.au>
>
>> 	* mailcap.el (mailcap-viewer-passes-test): Don't put "(nil t)" into
>> 	mailcap-viewer-test-cache when there's no 'test clause, since that
>> 	will invert the meaning of a "nil" test previously determined by
>> 	mailcap-mailcap-entry-passes-test.
>
>> In the diff below I didn't reindent the second half of the func, so as
>> to best show the actual bits changed.
>
> I've applied your patch to the trunk and the v5-10 branch.
> Thank you.
>

Hm, I don't know if its connected to this (and the second one) change
to the mailcap.el, but recently I have started having problems when
clicking on attachments with spaces in the name. It was working nice
for the last year or so, and now it once again stopped working. The
system is Debian Linux unstable with gnus 5.10.6-1.NO.20051213-1
(watch out, version number is misleading!).

Is this a recession in the trunk or should I report this as a debian
bug?
-- 
Zlatko



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

* Re: mailcap - caching "nil" failed test
  2006-02-03 14:54   ` Zlatko Calusic
@ 2006-02-03 21:09     ` Kevin Ryde
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Ryde @ 2006-02-03 21:09 UTC (permalink / raw)


Zlatko Calusic <zlatko.calusic@iskon.hr> writes:
>
> Hm, I don't know if its connected to this (and the second one) change
> to the mailcap.el, but recently I have started having problems when
> clicking on attachments with spaces in the name. It was working nice
> for the last year or so, and now it once again stopped working. The
> system is Debian Linux unstable with gnus 5.10.6-1.NO.20051213-1
> (watch out, version number is misleading!).

The only thing my change should have done (hopefully) is fix which
entries get used.  Unless you've got some dodgy entries now being
picked up then it oughtn't have hurt anything.



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

end of thread, other threads:[~2006-02-03 21:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-27 22:15 mailcap - caching "nil" failed test Kevin Ryde
2006-01-31  1:12 ` Katsumi Yamaoka
2006-02-03 14:54   ` Zlatko Calusic
2006-02-03 21:09     ` Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).