Patchworkβ Look for text/html content types ignoring case

login
register
about
Submitter David Edmondson
Date 2010-02-19 08:32:42
Message ID <87r5ohwrpx.fsf@aw.hh.sledj.net>
Download mbox | patch
Permalink /patch/379/
State New
Headers show

Comments

David Edmondson - 2010-02-19 08:32:42
On Thu, 18 Feb 2010 17:29:15 +0000, James Westby <jw+debian@jameswestby.net> wrote:
> On Tue, 16 Feb 2010 19:11:24 +0000, David Edmondson <dme@dme.org> wrote:
> > On Tue, 16 Feb 2010 18:51:00 +0000, James Westby <jw+debian@jameswestby.net> wrote:
> > > Some people send html parts as text/HTML or similar, so do a
> > > case-sensitive comparison when checking for html parts.
> > 
> > There are various other places where `equal' is used to compare MIME
> > types with strings. Shouldn't they all be fixed? (I see TEXT/PLAIN
> > frequently.)
> 
> I don't see any others in notmuch.el, but I'm not experienced in elisp,
> so I may be missing some, care to help me out?

How about this:
dme.
James Westby - 2010-02-19 15:06:43
On Fri, 19 Feb 2010 08:32:42 +0000, David Edmondson <dme@dme.org> wrote:
> How about this:

Looks reasonable to me, thanks.


James

Patch

From e5ae18036ccb1dcaa19d0125976b309c25331892 Mon Sep 17 00:00:00 2001
From: David Edmondson <dme@dme.org>
Date: Fri, 19 Feb 2010 08:32:05 +0000
Subject: [PATCH] notmuch.el: Always compare lower-case MIME types.

---
 notmuch.el |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 6fad91e..7731a93 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -757,8 +757,9 @@  is what to put on the button."
         (let (mime-message mime-type)
           (save-excursion
             (re-search-forward notmuch-show-contentype-regexp end t)
-            (setq mime-type (car (split-string (buffer-substring 
-                                                (match-beginning 1) (match-end 1))))))
+            (setq mime-type (downcase (car (split-string
+					    (buffer-substring 
+					     (match-beginning 1) (match-end 1)))))))
 
 
           (forward-line)
-- 
1.6.6.1