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 32F98431FCB for ; Sun, 1 Sep 2013 00:02:01 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.098 X-Spam-Level: X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 RtHckUTqDuci for ; Sun, 1 Sep 2013 00:01:55 -0700 (PDT) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 382D640BC3E for ; Fri, 30 Aug 2013 09:49:46 -0700 (PDT) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1VFRt9-0002MK-Vi; Fri, 30 Aug 2013 17:49:38 +0100 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) (envelope-from ) id 1VFRt9-0006Wt-KL; Fri, 30 Aug 2013 17:49:35 +0100 From: Mark Walters To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH v2] emacs: insert quotable parts in reply as they are displayed in show view In-Reply-To: <1377791611-29506-1-git-send-email-jani@nikula.org> References: <1377633044-22044-1-git-send-email-jani@nikula.org> <1377791611-29506-1-git-send-email-jani@nikula.org> User-Agent: Notmuch/0.15.2+269~g01f5508 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Fri, 30 Aug 2013 17:49:34 +0100 Message-ID: <87ppsvp1i9.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 93.97.24.31 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: bfa65e51f0c806a7c9e4d46826c4f6a0 (of first 20000 bytes) X-SpamAssassin-Score: 0.0 X-SpamAssassin-SpamBar: / X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored 0.0 points. Summary of the scoring: * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * 0.0 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean Cc: Tomi Ollila 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: Sun, 01 Sep 2013 07:02:01 -0000 > In reply, insert quotable parts using notmuch-show-insert-bodypart > instead of calling notmuch-mm-display-part-inline directly to render > the quoted parts as they are rendered in show view. > > The notable change is that replies to text/calendar parts quote the > pretty printed output of icalendar-import-buffer rather than the ugly > raw vcalendar. I slightly worry that some text-properties or similar from notmuch-show could make their way into the reply buffer: in particular it would be very bad if any invisible character made it into the buffer. I don't think this is actually a problem currently but just in case (and to avoid future problems) how about the following on top of the parent patch? Best wishes Mark --- emacs/notmuch-mua.el | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index e7cc94e..9e4a232 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -134,9 +134,11 @@ list." (narrow-to-region (point-min) (point)) ;; We don't want hooks, such as notmuch-wash-*, to be run on the ;; quotable part. - (let ((notmuch-show-insert-text/plain-hook nil)) - ;; Show the part but do not add buttons. - (notmuch-show-insert-bodypart message part 0 'no-buttons)) + (insert (with-temp-buffer + (let ((notmuch-show-insert-text/plain-hook nil)) + ;; Show the part but do not add buttons. + (notmuch-show-insert-bodypart message part 0 'no-buttons)) + (buffer-substring-no-properties (point-min) (point-max)))) (goto-char (point-max)))) ;; There is a bug in emacs 23's message.el that results in a newline -- 1.7.9.1