[PATCH] emacs: show: possible w3m/invisibility workaround
authorMark Walters <markwalters1009@gmail.com>
Thu, 10 Jan 2013 21:10:15 +0000 (21:10 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:53:04 +0000 (09:53 -0800)
18/dbf042c9a2b2031fcdf1bed0feacbe0442f534 [new file with mode: 0644]

diff --git a/18/dbf042c9a2b2031fcdf1bed0feacbe0442f534 b/18/dbf042c9a2b2031fcdf1bed0feacbe0442f534
new file mode 100644 (file)
index 0000000..2f0d8a4
--- /dev/null
@@ -0,0 +1,103 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 32073431FB6\r
+       for <notmuch@notmuchmail.org>; Thu, 10 Jan 2013 13:10:23 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id uveKeECzGsg6 for <notmuch@notmuchmail.org>;\r
+       Thu, 10 Jan 2013 13:10:22 -0800 (PST)\r
+Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com\r
+       [209.85.212.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 79F47431FAF\r
+       for <notmuch@notmuchmail.org>; Thu, 10 Jan 2013 13:10:22 -0800 (PST)\r
+Received: by mail-wi0-f169.google.com with SMTP id hq12so1572480wib.4\r
+       for <notmuch@notmuchmail.org>; Thu, 10 Jan 2013 13:10:19 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=x-received:from:to:cc:subject:date:message-id:x-mailer;\r
+       bh=w52uUFOfQZIPpsHhcJwWXKletYvkjutLcbnxoBV671w=;\r
+       b=u+SvOKjHjgIWH99lpEwhMzuQV0FFT3uYKl4BHkiX0yjobGZZefvJqkR+7CngKJjy7r\r
+       T73YCynwilTZVk63Cea9vJnxLs80Nl3G4LYAnztP9HpQLhzV+2cCG7TkcNYJgOnOGISB\r
+       hwTSwIi7WTV7km6BxkbHZ/qBSvYZaAkukziTJoReitznMDSYWGySJWUKvakOY/CR0bYD\r
+       XeTfA/NIsLj50JjBTG7m5PlxE0qu1H2M6baut/h3zjfrmPl4Y4Axypf3qZZycLn6FoV7\r
+       +TdsIMfMHxT5WTksE8zOb2E02TMn0FkZlaPaSDBuL9eXxfbx1xzy6RKDTpQ+6iYkCWWO\r
+       Um8A==\r
+X-Received: by 10.180.77.68 with SMTP id q4mr11664240wiw.10.1357852219830;\r
+       Thu, 10 Jan 2013 13:10:19 -0800 (PST)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPS id bz12sm4157890wib.5.2013.01.10.13.10.18\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Thu, 10 Jan 2013 13:10:19 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: show: possible w3m/invisibility workaround\r
+Date: Thu, 10 Jan 2013 21:10:15 +0000\r
+Message-Id: <1357852215-16788-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 10 Jan 2013 21:10:23 -0000\r
+\r
+There is a bug in the current notmuch code with w3m and invisible\r
+parts. w3m sets a keymap, and if we have a hiddent [text/html] point\r
+at the start of the following line still gets this w3m keymap which\r
+causes some strange effects. For example, RET gives an error "No URL\r
+at Point" rather than hiding the message, <down> goes to the next link\r
+rather than just down a line.\r
+\r
+This is only likely to be a problem for emacs 23 as shr is preferred\r
+as html renderer on emacs 24. I do not know the correct solution but\r
+this might be a safe work around for 0.15.\r
+\r
+This bug was reported on irc by awg.  \r
+---\r
+ emacs/notmuch-show.el |   13 +++++++++++++\r
+ 1 files changed, 13 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 5751d98..f526fbf 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -818,6 +818,19 @@ message at DEPTH in the current thread."\r
+ (defun notmuch-show-insert-part-inline-patch-fake-part (msg part content-type nth depth declared-type)\r
+   (notmuch-show-insert-part-*/* msg part "text/x-diff" nth depth "inline patch"))\r
\r
++(defun notmuch-show-insert-part-text/html (msg part content-type nth depth declared-type)\r
++  ;; text/html to work around bugs in renderers and our invisibile\r
++  ;; parts code. In particular w3m sets up a keymap which "leaks"\r
++  ;; outside the invisible region and causes strange effects in\r
++  ;; notmuch. Thus we override w3m and replace it as w3m-standalone.\r
++  (let ((mm-text-html-renderer\r
++       (if (eq mm-text-html-renderer 'w3m)\r
++           'w3m-standalone\r
++         mm-text-html-renderer)))\r
++    (notmuch-show-insert-part-header nth content-type declared-type (plist-get part :filename))\r
++    (notmuch-mm-display-part-inline msg part nth content-type notmuch-show-process-crypto))\r
++  t)\r
++\r
+ (defun notmuch-show-insert-part-*/* (msg part content-type nth depth declared-type)\r
+   ;; This handler _must_ succeed - it is the handler of last resort.\r
+   (notmuch-show-insert-part-header nth content-type declared-type (plist-get part :filename))\r
+-- \r
+1.7.9.1\r
+\r