Re: [PATCH v2 1/8] emacs/tree: return true if a thread was found in next-thread

2019-12-04 Thread William Casarin
David Edmondson  writes:

> On Thursday, 2019-11-28 at 08:13:54 -08, William Casarin wrote:
>
>> This will allow us to pop back to parent buffers when there are no
>> more threads to jump to.
>>
>> Signed-off-by: William Casarin 
>> ---
>>  emacs/notmuch-tree.el | 8 ++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
>> index c00315e8..4bc05160 100644
>> --- a/emacs/notmuch-tree.el
>> +++ b/emacs/notmuch-tree.el
>> @@ -620,10 +620,14 @@ message will be \"unarchived\", i.e. the tag changes in
>>(notmuch-tree-thread-top))
>>  
>>  (defun notmuch-tree-next-thread ()
>> +  "Get the next thread in the current tree. Returns t if a thread was
>> +found or nil if not."
>>(interactive)
>>(forward-line 1)
>> -  (while (not (or (notmuch-tree-get-prop :first) (eobp)))
>> -(forward-line 1)))
>> +  (let (end)
>> +(while (not (or (notmuch-tree-get-prop :first) (setq end (eobp
>> +  (forward-line 1))
>> +(not end)))
>
> Does using the variable add much value here? It makes the code look more
> strange and removing it would add the cost of just one more call to
> `eobp'.

agreed, will update this in the next version

>
>>  
>>  (defun notmuch-tree-thread-mapcar (function)
>>"Iterate through all messages in the current thread
>> -- 
>> 2.23.0
>>
>> ___
>> notmuch mailing list
>> notmuch@notmuchmail.org
>> https://notmuchmail.org/mailman/listinfo/notmuch
>
> dme.
> -- 
> But uh oh, I love her because, she moves in her own way.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH v2 1/8] emacs/tree: return true if a thread was found in next-thread

2019-11-28 Thread David Edmondson
On Thursday, 2019-11-28 at 08:13:54 -08, William Casarin wrote:

> This will allow us to pop back to parent buffers when there are no
> more threads to jump to.
>
> Signed-off-by: William Casarin 
> ---
>  emacs/notmuch-tree.el | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
> index c00315e8..4bc05160 100644
> --- a/emacs/notmuch-tree.el
> +++ b/emacs/notmuch-tree.el
> @@ -620,10 +620,14 @@ message will be \"unarchived\", i.e. the tag changes in
>(notmuch-tree-thread-top))
>  
>  (defun notmuch-tree-next-thread ()
> +  "Get the next thread in the current tree. Returns t if a thread was
> +found or nil if not."
>(interactive)
>(forward-line 1)
> -  (while (not (or (notmuch-tree-get-prop :first) (eobp)))
> -(forward-line 1)))
> +  (let (end)
> +(while (not (or (notmuch-tree-get-prop :first) (setq end (eobp
> +  (forward-line 1))
> +(not end)))

Does using the variable add much value here? It makes the code look more
strange and removing it would add the cost of just one more call to
`eobp'.

>  
>  (defun notmuch-tree-thread-mapcar (function)
>"Iterate through all messages in the current thread
> -- 
> 2.23.0
>
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

dme.
-- 
But uh oh, I love her because, she moves in her own way.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH v2 1/8] emacs/tree: return true if a thread was found in next-thread

2019-11-28 Thread William Casarin
This will allow us to pop back to parent buffers when there are no
more threads to jump to.

Signed-off-by: William Casarin 
---
 emacs/notmuch-tree.el | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index c00315e8..4bc05160 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -620,10 +620,14 @@ message will be \"unarchived\", i.e. the tag changes in
   (notmuch-tree-thread-top))
 
 (defun notmuch-tree-next-thread ()
+  "Get the next thread in the current tree. Returns t if a thread was
+found or nil if not."
   (interactive)
   (forward-line 1)
-  (while (not (or (notmuch-tree-get-prop :first) (eobp)))
-(forward-line 1)))
+  (let (end)
+(while (not (or (notmuch-tree-get-prop :first) (setq end (eobp
+  (forward-line 1))
+(not end)))
 
 (defun notmuch-tree-thread-mapcar (function)
   "Iterate through all messages in the current thread
-- 
2.23.0

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch