unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: Re: [Patch v5 4/4] emacs: resume messages
Date: Sat, 12 Nov 2016 09:10:15 -0400	[thread overview]
Message-ID: <87mvh4u9mw.fsf@tethera.net> (raw)
In-Reply-To: <20161107125211.23405-5-david@tethera.net>


David Bremner <david@tethera.net> 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.

  reply	other threads:[~2016-11-12 13:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07 12:52 v5 emacs postpone/resume patches David Bremner
2016-11-07 12:52 ` [Patch v5 1/4] emacs: tree: remove binding for pressing button in message pane David Bremner
2016-11-07 12:52 ` [Patch v5 2/4] emacs: postpone a message David Bremner
2016-11-12 12:30   ` David Bremner
2016-11-13  9:36     ` Mark Walters
2016-11-07 12:52 ` [Patch v5 3/4] emacs: check drafts for encryption tags before saving David Bremner
2016-11-07 19:47   ` Mark Walters
2016-11-12 12:48     ` David Bremner
2016-11-07 12:52 ` [Patch v5 4/4] emacs: resume messages David Bremner
2016-11-12 13:10   ` David Bremner [this message]
2016-11-13  9:41     ` Mark Walters
2016-11-13 13:13       ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mvh4u9mw.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).