Gnus development mailing list
 help / color / mirror / Atom feed
* mailcap-parse-mailcaps does regexp-quote MIME types
@ 2011-08-23 10:43 Katsumi Yamaoka
  2011-08-26  9:02 ` Katsumi Yamaoka
  0 siblings, 1 reply; 2+ messages in thread
From: Katsumi Yamaoka @ 2011-08-23 10:43 UTC (permalink / raw)
  To: ding

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

I have this entry in my ~/.mailcap file:

application/vnd.ms-powerpoint; /cygdrive/c/Program\ Files/Microsoft\ Office/Office12/POWERPNT.EXE "`cygpath --windows %s`"

`mailcap-parse-mailcaps' parses it and makes an entry in
`mailcap-mime-data' as:

(("application"
  ("vnd\\.ms-powerpoint"
   (viewer . "/cygdrive/c/Program\\ Files/Microsoft\\ Office/Office12/POWERPNT.EXE \"`cygpath --windows %s`\"")
   (type . "application/vnd\\.ms-powerpoint"))
  ))

Note that the MIME type is regexp-quote'd.  Because of this POWERPNT
doesn't run automatically when playing such parts.  May I install
the patch attached below?  Otherwise is there any deep reason r-q
is indispensable?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 293 bytes --]

--- mailcap.el~	2011-04-05 05:00:09.725625000 +0000
+++ mailcap.el	2011-08-23 10:41:18.265625000 +0000
@@ -472,3 +472,3 @@
 		 ((= (point) save-pos) ".*")
-		 (t (regexp-quote (buffer-substring save-pos (point)))))))
+		 (t (buffer-substring save-pos (point))))))
 	(skip-chars-forward " \t")

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

* Re: mailcap-parse-mailcaps does regexp-quote MIME types
  2011-08-23 10:43 mailcap-parse-mailcaps does regexp-quote MIME types Katsumi Yamaoka
@ 2011-08-26  9:02 ` Katsumi Yamaoka
  0 siblings, 0 replies; 2+ messages in thread
From: Katsumi Yamaoka @ 2011-08-26  9:02 UTC (permalink / raw)
  To: ding

Katsumi Yamaoka wrote:
> I have this entry in my ~/.mailcap file:

> application/vnd.ms-powerpoint; /cygdrive/c/Program\ Files/Microsoft\ Office/Office12/POWERPNT.EXE "`cygpath --windows %s`"

> `mailcap-parse-mailcaps' parses it and makes an entry in
> `mailcap-mime-data' as:

> (("application"
>   ("vnd\\.ms-powerpoint"
>    (viewer . "/cygdrive/c/Program\\ Files/Microsoft\\ Office/Office12/POWERPNT.EXE \"`cygpath --windows %s`\"")
>    (type . "application/vnd\\.ms-powerpoint"))
>   ))

> Note that the MIME type is regexp-quote'd.  Because of this POWERPNT
> doesn't run automatically when playing such parts.

I was confused for something or half asleep.  Now Gnus plays ppt
attachments automatically with no mailcap.el modification.  Sorry
for the noise.

> May I install
> the patch attached below?  Otherwise is there any deep reason r-q
> is indispensable?

> --- mailcap.el~	2011-04-05 05:00:09.725625000 +0000
> +++ mailcap.el	2011-08-23 10:41:18.265625000 +0000
> @@ -472,3 +472,3 @@
>  		 ((= (point) save-pos) ".*")
> -		 (t (regexp-quote (buffer-substring save-pos (point)))))))
> +		 (t (buffer-substring save-pos (point))))))
>  	(skip-chars-forward " \t")

I realized `regexp-quote' is necessary since
`mailcap-possible-viewers' runs `string-match' to test if it
matches that of an attachment.  Therefore all the MIME subtypes
listed in the initial value of `mailcap-mime-data' should also
be regexp-quote'd.  I've fixed it.



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

end of thread, other threads:[~2011-08-26  9:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-23 10:43 mailcap-parse-mailcaps does regexp-quote MIME types Katsumi Yamaoka
2011-08-26  9:02 ` Katsumi Yamaoka

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