unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH v2] contrib: pick: bugfix when trying to show a non-message
@ 2012-11-10 15:45 Mark Walters
  2012-11-10 16:23 ` Tomi Ollila
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mark Walters @ 2012-11-10 15:45 UTC (permalink / raw)
  To: notmuch

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.

This also fixes a bug in the (lack of) quoting of the id string.
---

Version 1 is at
id:1351797983-19707-1-git-send-email-markwalters1009@gmail.com

This version changes the `when' to and `if' and adds the fix for the
quoting.

Best wishes

Mark

 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..bbfa6fb 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)))
+    (if id
+	(notmuch-id-to-query id))))
 
 (defun notmuch-pick-get-match ()
   "Return whether the current message is a match."
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] contrib: pick: bugfix when trying to show a non-message
  2012-11-10 15:45 [PATCH v2] contrib: pick: bugfix when trying to show a non-message Mark Walters
@ 2012-11-10 16:23 ` Tomi Ollila
  2012-11-10 16:43 ` David Bremner
  2012-11-13  7:46 ` Kim Minh Kaplan
  2 siblings, 0 replies; 4+ messages in thread
From: Tomi Ollila @ 2012-11-10 16:23 UTC (permalink / raw)
  To: Mark Walters, notmuch

On Sat, Nov 10 2012, Mark Walters <markwalters1009@gmail.com> wrote:

> 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.
>
> This also fixes a bug in the (lack of) quoting of the id string.
> ---

LGTM

Tomi

> Version 1 is at
> id:1351797983-19707-1-git-send-email-markwalters1009@gmail.com
>
> This version changes the `when' to and `if' and adds the fix for the
> quoting.
>
> Best wishes
>
> Mark
>
>  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..bbfa6fb 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)))
> +    (if id
> +	(notmuch-id-to-query id))))
>  
>  (defun notmuch-pick-get-match ()
>    "Return whether the current message is a match."
> -- 
> 1.7.9.1
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] contrib: pick: bugfix when trying to show a non-message
  2012-11-10 15:45 [PATCH v2] contrib: pick: bugfix when trying to show a non-message Mark Walters
  2012-11-10 16:23 ` Tomi Ollila
@ 2012-11-10 16:43 ` David Bremner
  2012-11-13  7:46 ` Kim Minh Kaplan
  2 siblings, 0 replies; 4+ messages in thread
From: David Bremner @ 2012-11-10 16:43 UTC (permalink / raw)
  To: Mark Walters, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

> This version changes the `when' to and `if' and adds the fix for the
> quoting.

Sorry to be such a pedant about this. Is it obvious to other people that 
(if nil 'something) evaluates to nil? If so, nevermind. But for me, if's
in an expression context need two branches.

d

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] contrib: pick: bugfix when trying to show a non-message
  2012-11-10 15:45 [PATCH v2] contrib: pick: bugfix when trying to show a non-message Mark Walters
  2012-11-10 16:23 ` Tomi Ollila
  2012-11-10 16:43 ` David Bremner
@ 2012-11-13  7:46 ` Kim Minh Kaplan
  2 siblings, 0 replies; 4+ messages in thread
From: Kim Minh Kaplan @ 2012-11-13  7:46 UTC (permalink / raw)
  To: Mark Walters; +Cc: notmuch

Mark Walters writes:

David Bremner writes:

> Mark Walters <markwalters1009@gmail.com> writes:
>
>> This version changes the `when' to and `if' and adds the fix for the
>> quoting.
>>
>> +    (if id
>> +      (notmuch-id-to-query id))

> Sorry to be such a pedant about this. Is it obvious to other people that 
> (if nil 'something) evaluates to nil?

The obvious would be:

    (and id
         (notmuch-id-to-query id))

Kim Minh.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-13  7:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-10 15:45 [PATCH v2] contrib: pick: bugfix when trying to show a non-message Mark Walters
2012-11-10 16:23 ` Tomi Ollila
2012-11-10 16:43 ` David Bremner
2012-11-13  7:46 ` Kim Minh Kaplan

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).