Re: show a single message in a huge thread

2021-06-12 Thread Tomi Ollila
On Fri, Jun 11 2021, Jonathan Wilner wrote:

> I definitely also have this problem with large threads - big time hangs
> using Notmuch in Emacs. My simple tests indicate that it happens in Emacs,
> not using Notmuch at the command line, though that can also take quite a
> long time to return.
>
> I'm suspicious that there's something with HTML parsing - does that seem
> possible? It might also make sense if Delta Chat is giving you HTML versus
> plaintext.

one thing you could also try is to press '<' in that notmuch show buffer
adn observe how long it takes to drop indentation of the whole buffer (i
don't remember how it does that) and then repres '<' and see whether
re-indenting takes much more time dropping indentation.

in notmuch show there is
(defvar-local notmuch-show-indent-content t)

I tried just to M-: (setq notmuch-show-indent-content nil) -- that did not
have any effect... 

IIRC the (indent-rigidly ...) executions take quite a lot of time but is
that significant or not here...


Tomi

>
>
>
> On Thu, Jun 3, 2021 at 12:55 AM Alan Schmitt 
> wrote:
>
>> Hello,
>>
>> On 2021-06-02 09:18, David Bremner  writes:
>>
>> > The code I posted worked fine for me for one message from a thread of
>> > 323 messages.
>>
>> The thread that used to crash (before your patch) was from DeltaChat,
>> which is an email-based chat app. The thread it produces are like lists
>> more than trees. So I guess the depth of the tree is what matters.
>>
>> Best,
>>
>> Alan
>> ___
>> notmuch mailing list -- notmuch@notmuchmail.org
>> To unsubscribe send an email to notmuch-le...@notmuchmail.org
>>
> ___
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-le...@notmuchmail.org
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: show a single message in a huge thread

2021-06-11 Thread Jonathan Wilner
I definitely also have this problem with large threads - big time hangs
using Notmuch in Emacs. My simple tests indicate that it happens in Emacs,
not using Notmuch at the command line, though that can also take quite a
long time to return.

I'm suspicious that there's something with HTML parsing - does that seem
possible? It might also make sense if Delta Chat is giving you HTML versus
plaintext.



On Thu, Jun 3, 2021 at 12:55 AM Alan Schmitt 
wrote:

> Hello,
>
> On 2021-06-02 09:18, David Bremner  writes:
>
> > The code I posted worked fine for me for one message from a thread of
> > 323 messages.
>
> The thread that used to crash (before your patch) was from DeltaChat,
> which is an email-based chat app. The thread it produces are like lists
> more than trees. So I guess the depth of the tree is what matters.
>
> Best,
>
> Alan
> ___
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-le...@notmuchmail.org
>
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: show a single message in a huge thread

2021-06-03 Thread Alan Schmitt
Hello,

On 2021-06-02 09:18, David Bremner  writes:

> The code I posted worked fine for me for one message from a thread of
> 323 messages.

The thread that used to crash (before your patch) was from DeltaChat,
which is an email-based chat app. The thread it produces are like lists
more than trees. So I guess the depth of the tree is what matters.

Best,

Alan


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: show a single message in a huge thread

2021-06-02 Thread Tomi Ollila
On Wed, Jun 02 2021, David Bremner wrote:

> David Bremner  writes:
>
>> Alan Schmitt  writes:
>>
>>> Hello,
>>>
>>> On 2021-06-01 15:33, David Bremner  writes:
>>>
> Is this a bug of notmuch-emacs? Is there a way to display a single
> message independently of its context?
>

 I'm not sure what the best UI is, but here is a start:

 (defun notmuch-show-single-message (query)
   (interactive "sQuery: ")
   (message query)
   (let ((notmuch-show-indent-messages-width 0)
 (notmuch-show-only-matching-messages t))
 (notmuch-show query)))
>>>
>>> Thank you for the suggestion, unfortunately I get a very similar error.
>>> I found the id of the message I want, and when I run this function, I
>>> get this backtrace.
>>>
>>
>> The code I posted worked fine for me for one message from a thread of
>> 323 messages. It could be a I need a really giant thread to test, or
>> perhaps the structure of the individual messages matters also. The long
>> threads I have are from Debian mailing lists, so the message structure
>> tests to be be mainly one part of plain text.
>
> I played with this some more, and I think I understand what the issue
> is, although I still cannot duplicate the crash.  By unless given the

max-lisp-eval-depth is a variable defined in ‘C source code’.
Its value is 800

Started second emacs, tried to set max-lisp-eval-depth to 10 
(changed to 100, cannot go lower) then run notmuch 
(ya! you can do that -- no go w/ vm or gnus!) .
I have too short threads to get that crashing :/ but perhaps
someone else(tm) is luckier... ;/

Tomi


> "--part" option the CLI returns the whole thread structure, even if it
> does not populate it. So there is a big tree of empty lists, and
> recursively traversing this tree is what is crashing.  In principle
> passing "--part=0" to the CLI should turn off this behaviour, but I
> don't know how much needs to be changed on the emacs side to display the
> result properly.
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: show a single message in a huge thread

2021-06-02 Thread David Bremner
David Bremner  writes:

> Alan Schmitt  writes:
>
>> Hello,
>>
>> On 2021-06-01 15:33, David Bremner  writes:
>>
 Is this a bug of notmuch-emacs? Is there a way to display a single
 message independently of its context?

>>>
>>> I'm not sure what the best UI is, but here is a start:
>>>
>>> (defun notmuch-show-single-message (query)
>>>   (interactive "sQuery: ")
>>>   (message query)
>>>   (let ((notmuch-show-indent-messages-width 0)
>>> (notmuch-show-only-matching-messages t))
>>> (notmuch-show query)))
>>
>> Thank you for the suggestion, unfortunately I get a very similar error.
>> I found the id of the message I want, and when I run this function, I
>> get this backtrace.
>>
>
> The code I posted worked fine for me for one message from a thread of
> 323 messages. It could be a I need a really giant thread to test, or
> perhaps the structure of the individual messages matters also. The long
> threads I have are from Debian mailing lists, so the message structure
> tests to be be mainly one part of plain text.

I played with this some more, and I think I understand what the issue
is, although I still cannot duplicate the crash.  By unless given the
"--part" option the CLI returns the whole thread structure, even if it
does not populate it. So there is a big tree of empty lists, and
recursively traversing this tree is what is crashing.  In principle
passing "--part=0" to the CLI should turn off this behaviour, but I
don't know how much needs to be changed on the emacs side to display the
result properly.
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: show a single message in a huge thread

2021-06-02 Thread David Bremner
Alan Schmitt  writes:

> Hello,
>
> On 2021-06-01 15:33, David Bremner  writes:
>
>>> Is this a bug of notmuch-emacs? Is there a way to display a single
>>> message independently of its context?
>>>
>>
>> I'm not sure what the best UI is, but here is a start:
>>
>> (defun notmuch-show-single-message (query)
>>   (interactive "sQuery: ")
>>   (message query)
>>   (let ((notmuch-show-indent-messages-width 0)
>> (notmuch-show-only-matching-messages t))
>> (notmuch-show query)))
>
> Thank you for the suggestion, unfortunately I get a very similar error.
> I found the id of the message I want, and when I run this function, I
> get this backtrace.
>

The code I posted worked fine for me for one message from a thread of
323 messages. It could be a I need a really giant thread to test, or
perhaps the structure of the individual messages matters also. The long
threads I have are from Debian mailing lists, so the message structure
tests to be be mainly one part of plain text.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: show a single message in a huge thread

2021-06-02 Thread Alan Schmitt
Hello,

On 2021-06-01 15:33, David Bremner  writes:

>> Is this a bug of notmuch-emacs? Is there a way to display a single
>> message independently of its context?
>>
>
> I'm not sure what the best UI is, but here is a start:
>
> (defun notmuch-show-single-message (query)
>   (interactive "sQuery: ")
>   (message query)
>   (let ((notmuch-show-indent-messages-width 0)
> (notmuch-show-only-matching-messages t))
> (notmuch-show query)))

Thank you for the suggestion, unfortunately I get a very similar error.
I found the id of the message I want, and when I run this function, I
get this backtrace.

Debugger entered--Lisp error: (error "Lisp nesting exceeds 
‘max-lisp-eval-depth’")
  #f(compiled-function (tree) #)((nil ((nil ((nil 
((nil ...))) (nil ((nil ...
  mapc(#f(compiled-function (tree) #) ((nil ((nil 
((nil (...)) (nil (...
  notmuch-show-insert-thread(((nil ((nil ((nil (...)) (nil (...))) 195)
  notmuch-show-insert-tree((nil ((nil ((nil ((nil ...) (nil ...))) 194)
  #f(compiled-function (tree) #)((nil ((nil ((nil 
((nil ...) (nil ...
  mapc(#f(compiled-function (tree) #) ((nil ((nil 
((nil (... ...
  notmuch-show-insert-thread(((nil ((nil ((nil (... ...))) 194)
  notmuch-show-insert-tree((nil ((nil ((nil ((nil ...))) 193)
  #f(compiled-function (tree) #)((nil ((nil ((nil 
((nil ...
  mapc(#f(compiled-function (tree) #) ((nil ((nil 
((nil (...
  notmuch-show-insert-thread(((nil ((nil ((nil (...))) 193)

  …many line elided…

  notmuch-show-insert-tree((nil ((nil ((nil nil) (nil ((nil ...) (nil 
nil))) 1)
  #f(compiled-function (tree) #)((nil ((nil ((nil nil) 
(nil ((nil ...) (nil nil
  mapc(#f(compiled-function (tree) #) ((nil ((nil 
((nil nil) (nil (... ...
  notmuch-show-insert-thread(((nil ((nil ((nil nil) (nil (... ...))) 1)
  notmuch-show-insert-tree((nil ((nil ((nil ((nil nil) (nil ...))) 0)
  #f(compiled-function (tree) #)((nil ((nil ((nil 
((nil nil) (nil ...
  mapc(#f(compiled-function (tree) #) ((nil ((nil 
((nil (... ...
  notmuch-show-insert-thread(((nil ((nil ((nil (... ...))) 0)
  #f(compiled-function (thread) #)(((nil ((nil ((nil 
(... ...
  mapc(#f(compiled-function (thread) #) (((nil ((nil 
((nil ...
  notmuch-show-insert-forestnil ((nil ((nil ...
  notmuch-show--build-buffer()
  notmuch-show("id:mr.mcs31ym4nf_.pqmximnh...@petitepomme.net")
  (let ((notmuch-show-indent-messages-width 0) 
(notmuch-show-only-matching-messages t)) (notmuch-show query))
  notmuch-show-single-message("id:mr.mcs31ym4nf_.pqmximnh...@petitepomme.net")
  funcall-interactively(notmuch-show-single-message 
"id:mr.mcs31ym4nf_.pqmximnh...@petitepomme.net")
  call-interactively(notmuch-show-single-message record nil)
  command-execute(notmuch-show-single-message record)

This seems to be the same problem as when hitting RET on a tree-view
buffer. Some huge forest is built, instead of showing the single
message. (Or maybe the forest is built before deciding to show only the
message, but there is a stack overflow before that.)

Best,

Alan


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: show a single message in a huge thread

2021-06-01 Thread Jameson Graef Rollins
On Tue, Jun 01 2021, David Bremner  wrote:
> Alan Schmitt  writes:
>
>> Hello,
>>
>> On 2021-05-28 16:16, Alan Schmitt  writes:
>>
>>> Thank you for the suggestion. Here is what I did:
>>> - run the search
>>> - execute notmuch-tree-from-search-current-query
>>> - hit RET on a message deep in the thread
>>> - I get this error
>>>
>>> Debugger entered--Lisp error: (error "Lisp nesting exceeds 
>>> ‘max-lisp-eval-depth’")
>>
>> Is this a bug of notmuch-emacs? Is there a way to display a single
>> message independently of its context?
>>
>
> I'm not sure what the best UI is, but here is a start:
>
> (defun notmuch-show-single-message (query)
>   (interactive "sQuery: ")
>   (message query)
>   (let ((notmuch-show-indent-messages-width 0)
> (notmuch-show-only-matching-messages t))
> (notmuch-show query)))

It used to be that if a search returned only a single message that
message would just be displayed directly, by passing the thread view.
I'm not sure when/why that changed.

jamie.
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: show a single message in a huge thread

2021-06-01 Thread David Bremner
Alan Schmitt  writes:

> Hello,
>
> On 2021-05-28 16:16, Alan Schmitt  writes:
>
>> Thank you for the suggestion. Here is what I did:
>> - run the search
>> - execute notmuch-tree-from-search-current-query
>> - hit RET on a message deep in the thread
>> - I get this error
>>
>> Debugger entered--Lisp error: (error "Lisp nesting exceeds 
>> ‘max-lisp-eval-depth’")
>
> Is this a bug of notmuch-emacs? Is there a way to display a single
> message independently of its context?
>

I'm not sure what the best UI is, but here is a start:

(defun notmuch-show-single-message (query)
  (interactive "sQuery: ")
  (message query)
  (let ((notmuch-show-indent-messages-width 0)
(notmuch-show-only-matching-messages t))
(notmuch-show query)))
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: show a single message in a huge thread

2021-06-01 Thread Alan Schmitt
Hello,

On 2021-05-28 16:16, Alan Schmitt  writes:

> Thank you for the suggestion. Here is what I did:
> - run the search
> - execute notmuch-tree-from-search-current-query
> - hit RET on a message deep in the thread
> - I get this error
>
> Debugger entered--Lisp error: (error "Lisp nesting exceeds 
> ‘max-lisp-eval-depth’")

Is this a bug of notmuch-emacs? Is there a way to display a single
message independently of its context?

Thanks,

Alan


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: show a single message in a huge thread

2021-05-28 Thread Jameson Graef Rollins
On Fri, May 28 2021, alan.schm...@polytechnique.org wrote:
> Hello,
>
> I want to see a message in a huge thread (too big for notmuch to
> display). To find it, I switch to unthreaded mode, I select the message
> (I hit RET), but then notmuch tries to show all the other messages as
> well (which makes it hang as the thread is too big, and one of the
> message results in an error "symbolp: Lisp nesting exceeds
> ‘max-lisp-eval-depth’", which prevents later messages from being
> displayed).
>
> I tried doing C-u RET, but I immediately get a similar error:
> "notmuch-show-insert-thread: Lisp nesting exceeds
> ‘max-lisp-eval-depth’".

I will concur that notmuch-emacs has very poor performance with really
long threads.
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: show a single message in a huge thread

2021-05-28 Thread Alan Schmitt
Hello,

On 2021-05-28 09:37, David Bremner  writes:

> Did you try M-x notuch-tree ?
>
> It displays messages one at a time.
>
> Starting from notmuch-search-mode, you could
>
> - use Z to switch to tree mode, then select the message you
>   want.
>
> - If that is too tedious, use 'z' to search for something more precise,
>   and report the results in tree-mode.

Thank you for the suggestion. Here is what I did:
- run the search
- execute notmuch-tree-from-search-current-query
- hit RET on a message deep in the thread
- I get this error

Debugger entered--Lisp error: (error "Lisp nesting exceeds 
‘max-lisp-eval-depth’")
  mapc(#f(compiled-function (tree) #) ((nil nil)))
  notmuch-show-insert-thread(((nil nil)) 247)
  notmuch-show-insert-tree((nil ((nil nil))) 246)
  #f(compiled-function (tree) #)((nil ((nil nil
  mapc(#f(compiled-function (tree) #) ((nil ((nil 
nil))) (nil ((nil ((nil nil) (nil (... ...
  notmuch-show-insert-thread(((nil ((nil nil))) (nil ((nil ((nil nil) (nil (... 
...))) 246)
  notmuch-show-insert-tree((nil ((nil ((nil nil))) (nil ((nil ((nil nil) (nil 
...))) 245)
  #f(compiled-function (tree) #)((nil ((nil ((nil 
nil))) (nil ((nil ((nil nil) (nil ...
  mapc(#f(compiled-function (tree) #) ((nil nil) (nil 
((nil ((nil nil))) (nil ((nil (... ...
  notmuch-show-insert-thread(((nil nil) (nil ((nil ((nil nil))) (nil ((nil (... 
...))) 245)
  ...many lines elided...
  notmuch-show-insert-tree((nil ((nil nil) (nil ((nil ((nil ...))) (nil 
nil) 2)
  #f(compiled-function (tree) #)((nil ((nil nil) (nil 
((nil ((nil ...))) (nil nil))
  mapc(#f(compiled-function (tree) #) ((nil ((nil nil) 
(nil ((nil (...)) (nil nil)))
  notmuch-show-insert-thread(((nil ((nil nil) (nil ((nil (...)) (nil nil)) 
2)
  notmuch-show-insert-tree((nil ((nil ((nil nil) (nil ((nil ...) (nil 
nil))) 1)
  #f(compiled-function (tree) #)((nil ((nil ((nil nil) 
(nil ((nil ...) (nil nil
  mapc(#f(compiled-function (tree) #) ((nil ((nil 
((nil nil) (nil (... ...
  notmuch-show-insert-thread(((nil ((nil ((nil nil) (nil (... ...))) 1)
  notmuch-show-insert-tree((nil ((nil ((nil ((nil nil) (nil ...))) 0)
  #f(compiled-function (tree) #)((nil ((nil ((nil 
((nil nil) (nil ...
  mapc(#f(compiled-function (tree) #) ((nil ((nil 
((nil (... ...
  notmuch-show-insert-thread(((nil ((nil ((nil (... ...))) 0)
  #f(compiled-function (thread) #)(((nil ((nil ((nil 
(... ...
  mapc(#f(compiled-function (thread) #) (((nil ((nil 
((nil ...
  notmuch-show-insert-forestnil ((nil ((nil ...
  notmuch-show--build-buffer()
  notmuch-show("id:mr.mcs31ym4nf_.pqmximnh...@petitepomme.net")
  notmuch-tree-show-message-in()
  notmuch-tree-show-message(nil)
  funcall-interactively(notmuch-tree-show-message nil)
  call-interactively(notmuch-tree-show-message nil nil)
  command-execute(notmuch-tree-show-message)

I’m afraid I may have an option asking for the context (as a big forest
is built), but I don’t know which one or how to disable it.

Best,

Alan


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


show a single message in a huge thread

2021-05-28 Thread alan . schmitt
Hello,

I want to see a message in a huge thread (too big for notmuch to
display). To find it, I switch to unthreaded mode, I select the message
(I hit RET), but then notmuch tries to show all the other messages as
well (which makes it hang as the thread is too big, and one of the
message results in an error "symbolp: Lisp nesting exceeds
‘max-lisp-eval-depth’", which prevents later messages from being
displayed).

I tried doing C-u RET, but I immediately get a similar error:
"notmuch-show-insert-thread: Lisp nesting exceeds
‘max-lisp-eval-depth’".

Is there a way to view a single message from a thread?

Thanks,

Alan


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org