unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] Look for text/html content types ignoring case
@ 2010-02-16 18:51 James Westby
  2010-02-16 19:11 ` David Edmondson
  0 siblings, 1 reply; 5+ messages in thread
From: James Westby @ 2010-02-16 18:51 UTC (permalink / raw)
  To: notmuch

Some people send html parts as text/HTML or similar, so do a
case-sensitive comparison when checking for html parts.
---
 notmuch.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 0f4ea10..b69c334 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -736,7 +736,7 @@ is what to put on the button."
             (setq mime-type (car (split-string (buffer-substring 
                                                 (match-beginning 1) (match-end 1))))))
 
-          (if (equal mime-type "text/html")
+          (if (equal (downcase mime-type) "text/html")
               (let ((filename (notmuch-show-get-filename)))
                 (with-temp-buffer
                   (insert-file-contents filename nil nil nil t)
-- 
1.6.6.1

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

* Re: [PATCH] Look for text/html content types ignoring case
  2010-02-16 18:51 [PATCH] Look for text/html content types ignoring case James Westby
@ 2010-02-16 19:11 ` David Edmondson
  2010-02-18 17:29   ` James Westby
  0 siblings, 1 reply; 5+ messages in thread
From: David Edmondson @ 2010-02-16 19:11 UTC (permalink / raw)
  To: James Westby, notmuch

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

dme.
-- 
David Edmondson, http://dme.org

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

* Re: [PATCH] Look for text/html content types ignoring case
  2010-02-16 19:11 ` David Edmondson
@ 2010-02-18 17:29   ` James Westby
  2010-02-19  8:32     ` David Edmondson
  0 siblings, 1 reply; 5+ messages in thread
From: James Westby @ 2010-02-18 17:29 UTC (permalink / raw)
  To: David Edmondson, notmuch

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?

Thanks,

James

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

* Re: [PATCH] Look for text/html content types ignoring case
  2010-02-18 17:29   ` James Westby
@ 2010-02-19  8:32     ` David Edmondson
  2010-02-19 15:06       ` James Westby
  0 siblings, 1 reply; 5+ messages in thread
From: David Edmondson @ 2010-02-19  8:32 UTC (permalink / raw)
  To: James Westby, notmuch

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

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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-notmuch.el-Always-compare-lower-case-MIME-types.patch --]
[-- Type: text/x-diff, Size: 917 bytes --]

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


[-- Attachment #3: Type: text/plain, Size: 42 bytes --]


dme.
-- 
David Edmondson, http://dme.org

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

* Re: [PATCH] Look for text/html content types ignoring case
  2010-02-19  8:32     ` David Edmondson
@ 2010-02-19 15:06       ` James Westby
  0 siblings, 0 replies; 5+ messages in thread
From: James Westby @ 2010-02-19 15:06 UTC (permalink / raw)
  To: David Edmondson, notmuch

On Fri, 19 Feb 2010 08:32:42 +0000, David Edmondson <dme@dme.org> wrote:
> How about this:

Looks reasonable to me, thanks.


James

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

end of thread, other threads:[~2010-02-19 15:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-16 18:51 [PATCH] Look for text/html content types ignoring case James Westby
2010-02-16 19:11 ` David Edmondson
2010-02-18 17:29   ` James Westby
2010-02-19  8:32     ` David Edmondson
2010-02-19 15:06       ` James Westby

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).