unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Brennan Vincent <brennan@umanwizard.com>, notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs: Introduce notmuch-draftify-buffer command.
Date: Wed, 25 Sep 2024 19:09:31 -0300	[thread overview]
Message-ID: <87msjvl71g.fsf@tethera.net> (raw)
In-Reply-To: <87r09qtbn6.fsf@taipei.mail-host-address-is-not-set>

Brennan Vincent <brennan@umanwizard.com> writes:

> This command inserts the current buffer as a draft. It optionally
> begins editing the draft.

[nice commit message snipped]

Here again, if possible we would like a test. For emacs tests it is a
bit more laborious, but there are several options outlined in
test/

>  will appear in a buffer named \"*Notmuch errors*\" and an error
> -will be signaled."
> +will be signaled.
> +
> +Otherwise, returns the output from the process as a string."
>    (with-temp-buffer
> -    (let ((status (notmuch-call-notmuch--helper t args)))
> -      (notmuch-check-exit-status status (cons notmuch-command args)
> -				 (buffer-string)))))
> +    (let ((status (notmuch-call-notmuch--helper t args))
> +	  (output (buffer-string)))
> +      (and (notmuch-check-exit-status status (cons notmuch-command args)
> +				      output)
> +	   output))))

Is it clear / documented what the return value of
notmuch-check-exit-status is? If all you mean is that it completes
without error, I think "progn" is clearer than "and"

> +Returns the message ID of the inserted message."
> +  (let ((output (apply 'notmuch-call-notmuch-process
> +		       :stdin-string (buffer-string) "insert"
> +		       (append (and create (list "--create-folder"))
> +			       (list (concat "--folder=" folder)
> +				     "--emit-message-id")
> +			       tags))))
> +    (string-trim output)))

One problem we have is that people merrily upgrade the emacs front end
without updating the CLI. Recently (see devel/schemata) we have started
bumping the output version for new command arguments, so at least the
error reporting is clear.

  reply	other threads:[~2024-09-25 22:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10 20:33 [PATCH] Add --emit-message-id flag to notmuch-insert Brennan Vincent
2024-09-11 15:00 ` [PATCH v2] " Brennan Vincent
2024-09-25 21:51   ` David Bremner
2024-10-03 17:35     ` When exactly is the post-insert hook called? Ralph Seichter
2024-10-03 17:59       ` Ralph Seichter
2024-09-11 16:09 ` [PATCH] emacs: Introduce notmuch-draftify-buffer command Brennan Vincent
2024-09-25 22:09   ` David Bremner [this message]
2024-09-29  0:36     ` Brennan Vincent
2024-09-26 20:25 ` [PATCH v3] Add --emit-message-id flag to notmuch-insert Brennan Vincent

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=87msjvl71g.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=brennan@umanwizard.com \
    --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).