unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: jump: sort-order bugfix
@ 2014-09-02 12:30 Mark Walters
  2014-09-02 18:56 ` [PATCH v2] " Mark Walters
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Walters @ 2014-09-02 12:30 UTC (permalink / raw)
  To: notmuch

default-value needs its argument to be quoted.
---

Slightly strangely default-value of 't or nil is 't or nil
respectively so the code didn't give an error but just did the wrong
thing.

Thanks to Jani for finding the bug.

Best wishes

Mark

 emacs/notmuch-jump.el |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index 5eb0949..0193f8c 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -51,7 +51,7 @@ (defun notmuch-jump-search ()
 		 (case (plist-get saved-search :sort-order)
 		   (newest-first nil)
 		   (oldest-first t)
-		   (otherwise (default-value notmuch-search-oldest-first)))))
+		   (otherwise (default-value 'notmuch-search-oldest-first)))))
 	    (push (list key name
 			`(lambda () (notmuch-search ',query ',oldest-first)))
 		  action-map)))))
-- 
1.7.10.4

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

* [PATCH v2] emacs: jump: sort-order bugfix
  2014-09-02 12:30 [PATCH] emacs: jump: sort-order bugfix Mark Walters
@ 2014-09-02 18:56 ` Mark Walters
  2014-09-02 19:27   ` Austin Clements
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mark Walters @ 2014-09-02 18:56 UTC (permalink / raw)
  To: notmuch

default-value needs its argument to be quoted.

Slightly strangely default-value of 't or nil is 't or nil
respectively so the code

(default-value notmuch-search-oldest-first)

just gives the current value of notmuch-search-oldest-first rather
than intended default-value of this variable.

The symptom is that if you are in a search buffer and use notmuch jump
to run a saved search which does not have an explicitly set sort order
then the sort order of the saved-search is inherited from the current
search buffer rather than being the default search order.

Thanks to Jani for finding the bug.
---

This time with a fuller commit message.

(Part of the reason I did not send more before is I had not checked
what the exact outcome of the buggy code was: it was obvious what the
code was intended to do, and that with the extra quote it
would do what it was intended to do.)

Best wishes

Mark







 emacs/notmuch-jump.el |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index 5eb0949..0193f8c 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -51,7 +51,7 @@ (defun notmuch-jump-search ()
 		 (case (plist-get saved-search :sort-order)
 		   (newest-first nil)
 		   (oldest-first t)
-		   (otherwise (default-value notmuch-search-oldest-first)))))
+		   (otherwise (default-value 'notmuch-search-oldest-first)))))
 	    (push (list key name
 			`(lambda () (notmuch-search ',query ',oldest-first)))
 		  action-map)))))
-- 
1.7.10.4

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

* Re: [PATCH v2] emacs: jump: sort-order bugfix
  2014-09-02 18:56 ` [PATCH v2] " Mark Walters
@ 2014-09-02 19:27   ` Austin Clements
  2014-09-02 20:22   ` Jani Nikula
  2014-09-07 18:05   ` David Bremner
  2 siblings, 0 replies; 5+ messages in thread
From: Austin Clements @ 2014-09-02 19:27 UTC (permalink / raw)
  To: Mark Walters; +Cc: notmuch

LGTM.

Quoth Mark Walters on Sep 02 at  7:56 pm:
> default-value needs its argument to be quoted.
> 
> Slightly strangely default-value of 't or nil is 't or nil
> respectively so the code
> 
> (default-value notmuch-search-oldest-first)
> 
> just gives the current value of notmuch-search-oldest-first rather
> than intended default-value of this variable.
> 
> The symptom is that if you are in a search buffer and use notmuch jump
> to run a saved search which does not have an explicitly set sort order
> then the sort order of the saved-search is inherited from the current
> search buffer rather than being the default search order.
> 
> Thanks to Jani for finding the bug.
> ---
> 
> This time with a fuller commit message.
> 
> (Part of the reason I did not send more before is I had not checked
> what the exact outcome of the buggy code was: it was obvious what the
> code was intended to do, and that with the extra quote it
> would do what it was intended to do.)
> 
> Best wishes
> 
> Mark
> 
> 
> 
> 
> 
> 
> 
>  emacs/notmuch-jump.el |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
> index 5eb0949..0193f8c 100644
> --- a/emacs/notmuch-jump.el
> +++ b/emacs/notmuch-jump.el
> @@ -51,7 +51,7 @@ (defun notmuch-jump-search ()
>  		 (case (plist-get saved-search :sort-order)
>  		   (newest-first nil)
>  		   (oldest-first t)
> -		   (otherwise (default-value notmuch-search-oldest-first)))))
> +		   (otherwise (default-value 'notmuch-search-oldest-first)))))
>  	    (push (list key name
>  			`(lambda () (notmuch-search ',query ',oldest-first)))
>  		  action-map)))))

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

* Re: [PATCH v2] emacs: jump: sort-order bugfix
  2014-09-02 18:56 ` [PATCH v2] " Mark Walters
  2014-09-02 19:27   ` Austin Clements
@ 2014-09-02 20:22   ` Jani Nikula
  2014-09-07 18:05   ` David Bremner
  2 siblings, 0 replies; 5+ messages in thread
From: Jani Nikula @ 2014-09-02 20:22 UTC (permalink / raw)
  To: Mark Walters, notmuch

On Tue, 02 Sep 2014, Mark Walters <markwalters1009@gmail.com> wrote:
> default-value needs its argument to be quoted.
>
> Slightly strangely default-value of 't or nil is 't or nil
> respectively so the code
>
> (default-value notmuch-search-oldest-first)
>
> just gives the current value of notmuch-search-oldest-first rather
> than intended default-value of this variable.
>
> The symptom is that if you are in a search buffer and use notmuch jump
> to run a saved search which does not have an explicitly set sort order
> then the sort order of the saved-search is inherited from the current
> search buffer rather than being the default search order.
>
> Thanks to Jani for finding the bug.

This fixes the issue, thanks for the patch.

Jani.



> ---
>
> This time with a fuller commit message.
>
> (Part of the reason I did not send more before is I had not checked
> what the exact outcome of the buggy code was: it was obvious what the
> code was intended to do, and that with the extra quote it
> would do what it was intended to do.)
>
> Best wishes
>
> Mark
>
>
>
>
>
>
>
>  emacs/notmuch-jump.el |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
> index 5eb0949..0193f8c 100644
> --- a/emacs/notmuch-jump.el
> +++ b/emacs/notmuch-jump.el
> @@ -51,7 +51,7 @@ (defun notmuch-jump-search ()
>  		 (case (plist-get saved-search :sort-order)
>  		   (newest-first nil)
>  		   (oldest-first t)
> -		   (otherwise (default-value notmuch-search-oldest-first)))))
> +		   (otherwise (default-value 'notmuch-search-oldest-first)))))
>  	    (push (list key name
>  			`(lambda () (notmuch-search ',query ',oldest-first)))
>  		  action-map)))))
> -- 
> 1.7.10.4
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH v2] emacs: jump: sort-order bugfix
  2014-09-02 18:56 ` [PATCH v2] " Mark Walters
  2014-09-02 19:27   ` Austin Clements
  2014-09-02 20:22   ` Jani Nikula
@ 2014-09-07 18:05   ` David Bremner
  2 siblings, 0 replies; 5+ messages in thread
From: David Bremner @ 2014-09-07 18:05 UTC (permalink / raw)
  To: Mark Walters, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

> default-value needs its argument to be quoted.
>
> Slightly strangely default-value of 't or nil is 't or nil
> respectively so the code

pushed

d

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

end of thread, other threads:[~2014-09-07 18:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-02 12:30 [PATCH] emacs: jump: sort-order bugfix Mark Walters
2014-09-02 18:56 ` [PATCH v2] " Mark Walters
2014-09-02 19:27   ` Austin Clements
2014-09-02 20:22   ` Jani Nikula
2014-09-07 18:05   ` David Bremner

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