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