Re: [PATCH] contrib: pick: bugfix when trying to show a non-message

Subject: Re: [PATCH] contrib: pick: bugfix when trying to show a non-message

Date: Fri, 9 Nov 2012 12:53:53 -0500

To: Mark Walters

Cc: notmuch@notmuchmail.org

From: Austin Clements


Quoth Mark Walters on Nov 01 at  7:26 pm:
> If the user pressed return on the end result status line it gave a
> blank message. Modify the function notmuch-pick-get-message-id to
> return nil rather than an empty message-id in this case to fix this.
> ---
>  contrib/notmuch-pick/notmuch-pick.el |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el
> index 15ac5e8..1886469 100644
> --- a/contrib/notmuch-pick/notmuch-pick.el
> +++ b/contrib/notmuch-pick/notmuch-pick.el
> @@ -241,7 +241,9 @@ Some useful entries are:
>  
>  (defun notmuch-pick-get-message-id ()
>    "Return the message id of the current message."
> -  (concat "id:\"" (notmuch-pick-get-prop :id) "\""))
> +  (let ((id (notmuch-pick-get-prop :id)))
> +    (when id
> +      (concat "id:\"" id "\""))))

There's another bug here.  The ID query should be constructed with
notmuch-id-to-query so it gets properly escaped.

>  
>  (defun notmuch-pick-get-match ()
>    "Return whether the current message is a match."

Thread: