From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id AEB076DE0962 for ; Sat, 12 Nov 2016 05:10:19 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.006 X-Spam-Level: X-Spam-Status: No, score=-0.006 tagged_above=-999 required=5 tests=[AWL=0.005, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hmOVzYxzcO0e for ; Sat, 12 Nov 2016 05:10:18 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 75C6B6DE012F for ; Sat, 12 Nov 2016 05:10:18 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1c5Y4E-0005VO-4i; Sat, 12 Nov 2016 08:09:58 -0500 Received: (nullmailer pid 15497 invoked by uid 1000); Sat, 12 Nov 2016 13:10:15 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: Re: [Patch v5 4/4] emacs: resume messages In-Reply-To: <20161107125211.23405-5-david@tethera.net> References: <20161107125211.23405-1-david@tethera.net> <20161107125211.23405-5-david@tethera.net> Date: Sat, 12 Nov 2016 09:10:15 -0400 Message-ID: <87mvh4u9mw.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Sat, 12 Nov 2016 13:10:19 -0000 David Bremner writes: > Provide functionality to resume editing a mesage previously saved with > notmuch-draft-save, including decoding the X-Notmuch-Emacs-Secure > header. s/mesage/message/ > +(defun notmuch-draft-unquote-some-mml () > + "Unquote the mml tags in `notmuch-draft-quoted-tags`." > + (save-excursion > + (when notmuch-draft-quoted-tags > + (let ((re (concat "<#!+/?\\(" > + (mapconcat 'identity notmuch-draft-quoted-tags "\\|") > + Same issue here with regex quoting, I think. > + (let (secure-tag) > + (save-restriction > + (message-narrow-to-headers) > + (setq secure-tag (message-fetch-field "X-Notmuch-Emacs-Secure" 't)) > + (message-remove-header "X-Notmuch-Emacs-Secure")) > + (message-goto-body) > + (when secure-tag > + (insert secure-tag "\n"))))) Can the setq inside the let be replaced with (let ((secure-tag (message-fetch-field "X-Notmuch-Emacs-Secure" 't))) ... Perhaps by pushing the let inside the save-restriction? > (require 'notmuch-mua) > (require 'notmuch-crypto) > (require 'notmuch-print) > +(require 'notmuch-draft) This line I added. > +(defun notmuch-show-resume-message () > + "Resume EDITING the current draft message." > + (interactive) > + (let ((id (notmuch-show-get-message-id))) > + (when id > + (notmuch-draft-resume id)))) > + The error handling is not very clear to me here. notmuch-show-get-message-id is not documented to return nil on error. Should some docstring be changed here? > +<#secure method=pgpmime mode=sign> > +EOF > +test_expect_equal_file EXPECTED OUTPUT.clean > test_done The quoting of the secure tag here is not present in the original test, but sure confused me for a few minutes.