Re: nnir with notmuch gives error; sort: Wrong type argument: number-or-marker-p, nil

2020-03-17 Thread xuqi
physiculus  writes:

> physiculus  writes:
>
> Hello,
> additional note:
> here is my config for Lokales. Exactly spoken its Lokal.
>
>
Hello Poul,

> (nnmaildir "Lokal"
>  (directory "~/Maildirnm")
>  (directory 
> "~/Maildirnm/archive")
>  (directory 
> "~/Maildirnm/attachments")
>  (directory 
> "~/Maildirnm/BugsandFeatures")
>  (directory "~/Maildirnm/bwp")
>  (directory 
> "~/Maildirnm/Campact")
>  (directory 
> "~/Maildirnm/draft")
>  (directory 
> "~/Maildirnm/drafts")
>  (directory 
> "~/Maildirnm/Ebay")
>  (directory 
> "~/Maildirnm/Ebay_noch_suchen")
>  (directory 
> "~/Maildirnm/Emacs")
>  (directory 
> "~/Maildirnm/emms")
>  (directory 
> "~/Maildirnm/Enteignung")
>  (directory 
> "~/Maildirnm/Feedburner")
>  (directory 
> "~/Maildirnm/fritz")
>  (directory 
> "~/Maildirnm/Garten")
>  (directory 
> "~/Maildirnm/gnus")
>  (directory 
> "~/Maildirnm/Held_Wichtig")
>  (directory 
> "~/Maildirnm/inbox")
>  (directory 
> "~/Maildirnm/Informatik")
>  (directory 
> "~/Maildirnm/Instructables")
>  (directory 
> "~/Maildirnm/Lehrerausbildung")
>  (directory 
> "~/Maildirnm/Linzessin")
>  (directory 
> "~/Maildirnm/logins")
>  (directory 
> "~/Maildirnm/mnp-notes")

[...]

As the Gnus manual described, if you have one Maildir server, you only
need to specific its directory once. All its subdirectories would be
treated as groups in Gnus.

More importantly, I don't find 'karlderletzte' as a directory in your
config. The way you set the maildir up may have something to do with the
filenames in the karlderletzte folder. That this directory has even more
subdirectories which look like maildir directories is also peculiar.

>
>  (directory-files 
> nnheader-directory-files-safe)
>  (get-new-mail t)
>  )
>  
>> Eric Abrahamsen  writes:
>>
>> Hello,
>> hmmh i checked these messages and gnus displayed them correctly.
>> BUT what i see is that ONLY meesages inside my directory "Lokales" got
>> errors.
>> This directory contains all messages, which are moved from me (gnus
>> command B m) inside subfolders. All these subfolders are in format
>> nnmaildir and i got no errors if i moved the messages.

Have you actually used B m to move email to 'karlderletzte/INBOX' or
'karlderletzte/Sent' folder? Or do you use it for other purposes than
moving email manually into it? Perhaps splitting? Caching?

It would make things a bit more clear if you could let us know if you
configured this karlderletzte folder for some other use. Please have a
look at your Emacs, gnus, notmuch, imap server if any, offlineimap/isync
if any, and backup script if any, configs, and see whether any of them
mentioned 'karlderletzte'.

If you are using macOS or BSD, you can use grep from within Emacs like
this to help you find those lines:

  C-x d ~/path/to/your/config RET
  M-x grep RET
  grep -nHr --null -e 'karlderletzte' * RET
   this part may have been prefilled for you except
  for the 'r' argument for recursive search, just modify it to your need

If you find anything perhaps it would help us figure out why those file
names become malformed and cause nnir to fail.

>>
>> the directory Maildirnm is my imap folder. Here are all accounts with
>> all folders from my imap accounts. Here searching with G G works.
>>
>> In directory Lokales G G gives the reported error.
>>
>> Perhaps this helps.
>>
>> Regards
>> Poul
>
> ___
> info-gnus-english mailing list
> info-gnus-english@gnu.org
> https://lists.gnu.org/mailman/listinfo/info-gnus-english


___
info-gnus-english mailing 

Re: nnir with notmuch gives error; sort: Wrong type argument: number-or-marker-p, nil

2020-03-15 Thread xuqi
physiculus  writes:

> Eric Abrahamsen  writes:
>
> Ok, here is the list. Hope it helps :-)
>
Unfortunately it doesn't in this case ;-) see my reply below:

> /home/held/Maildirnm/Privat/cur/1584002263.M785296P11519Q0.kubuntu:2,S
> /home/held/Maildirnm/Privat/cur/1584001757.M962421P11519Q0.kubuntu:2,
> /home/held/Maildirnm/Privat/cur/1584001970.M953224P11519Q0.kubuntu:2,
> /home/held/Maildirnm/Privat/cur/1584002264.M177070P11519Q0.kubuntu:2,S
> /home/held/Maildirnm/Privat/cur/1584002264.M570398P11519Q1.kubuntu:2,S
> /home/held/Maildirnm/karlderletzte/INBOX/cur/1554399542.4634_1560.shinri,U=651:2,S
> /home/held/Maildirnm/karlderletzte/Sent/cur/1554294583.6ad7d1c538e8c734.shinri:2,,U=22:2,S!2,S
>
>> physiculus  writes:
>>
>>> Eric Abrahamsen  writes:
>>>
>>> Hmmh, this looks different and with no errors.
>>> But is this in format, which gnus could read?
>>>
>>> the result is displayed in *Message* Buffer. Is this correct?
>>>
>>> Poulpoulsen
>>>
>>> Doing notmuch query Hock...
>>> notmuch args: search --format=text --output=files Hock
>>> Massaging notmuch output...done
>>> (["nnmaildir+Lokal:Privat" 349 0] ["nnmaildir+Lokal:Privat" 446 0]
>>> ["nnmaildir+Lokal:Privat" 506 0] ["nnmaildir+Lokal:Privat" 333 0]
>>> ["nnmaildir+Lokal:ZuErledigen" 399 0] ["nnmaildir+Lokal:ZuErledigen" 131
>>> 0] ["nnmaildir+Lokal:ZuErledigen" 226 0] ["nnmaildir+Lokal:Linzessin" 34
>>> 0] ["nnmaildir+Lokal:ZuErledigen" 318 0] ["nnmaildir+Lokal:ZuErledigen"
>>> 266 0] ["nnmaildir+Lokal:ZuErledigen" 42 0] ["nnmaildir+Lokal:logins"
>>> 156 0] ...)

It would help if we can see the complete list here. Unfortunately,
unless notmuch encounters a problem and value of `gnus-verbose' is > 6,
`nnir-tmp-buffer' would be erased. In your case notmuch runs perfectly
well.

However, after looking at the code of `nnir-retrieve-headers` more
closely, I think I narrowed down the range of possible courses a bit.

The offending line of code `(sort (mapcar 'cdr articleids) '<)` for one
of your searchs would translate into something like this:

   (sort (mapcar 'cdr (cadr 
'("nnmaildir+Lokal:Privat"
  ((1 . 349)
   (2 . 446)
   (3 . 506)
   (4 . 333) '<)

In this case it would run and give you the result:

   '(333 349 446 506)

But down the line, one or more of the articles would have ID(s) that are
nil. Maybe it's a file that's not properly synced. In the search result
it probably looks like this:

   ["nnmaildir+Lokal:SomeFolder" nil 0]

>>
>> That looks correct, but it would be important to see the whole list. Can
>> you still do the (switch-to-buffer nnir-tmp-buffer) and paste the
>> contents here?

As Eric mentioned, it is important to see the whole list. To get the
whole list generated by `nnir-run-notmuch', you can wrap your search
like this:

 (progn
  (setq xbuff (generate-new-buffer "*my output*"))
  (print (nnir-run-notmuch '((query . "hock")) "nnmaildir:Lokal") xbuff)
  (switch-to-buffer xbuff ))

Then you can copy the content of *my output* and paste it here. If
indeed there were some nils in the result, we should be able to find the
corresponding file using `nnmaildir-article-number-to-file-name' and
more elisp.

>>
>>
>> ___
>> info-gnus-english mailing list
>> info-gnus-english@gnu.org
>> https://lists.gnu.org/mailman/listinfo/info-gnus-english
>
> ___
> info-gnus-english mailing list
> info-gnus-english@gnu.org
> https://lists.gnu.org/mailman/listinfo/info-gnus-english


___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english


Re: nnir with notmuch gives error; sort: Wrong type argument: number-or-marker-p, nil

2020-03-14 Thread xuqi
physiculus  writes:

> xuqi  writes:
>
> Hello,
> thank you for your info.
> Unfortunately i'm not a developer, so i don't understand all you wrote.
> As far as i understand, you mean, that the problem is with notmuch?
> But why is it working, if i call the command in terminal directly.
> Perhaps some parameters, that push gnus to notmuch?

While your notmuch runs all right in the terminal, nnir runs notmuch in
Emacs environments and then processes the results so they can be used by
Gnus. I suspect something went wrong there.

I didn't look closely. But for example if you haven't customized the
variable `nnir-notmuch-remove-prefix', it defaults to "$HOME/Mail", if
your Maildir is not ~/Mail (Gnus advices against using ~/Mail for
maildir, iirc), the processed results may point Gnus to a wrong
location.

Perhaps you can paste your nnmaildir config in your .gnus.el to the
list, or point to me where to find it if you have done so. And the value
of your `nnir-notmuch-remove-prefix', you can find that by pressing C-h
v RET nnir-notmuch-remove-prefix RET.

Then you can go to your *scratch* buffer -- sorry if it shows in bold
when you read this, but the buffer name has asterisks -- and input the
following, parentheses included:

(nnir-run-notmuch "Hock" "nnmaildir:Lokal")

and press C-x C-e with your cursor after the closing parenthesis, this
will run the command `nnir-run-notmuch', the results would be in the
messages. Post those as well.

>
> Regards
> Poul
>
>
>> physiculus  writes:
>>
>>> Eric Abrahamsen  writes:
>>>
>>> Hello,
>>>
>>> here is the output from the debugger.
>>> I dont know, what it mean, but i think you do :-)
>>>
>>> Hope it helps!
>>>
>>>
>>> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>>>   <(nil nil)
>>>   sort((nil) <)
>>>   nnir-retrieve-headers((1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
>>> 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
>>> 42 43 44 45 46 47 48 49 50 ...) "nnir-87zhckegiv.fsf" "nnir-ephemeral"
>>> nil)
>>
>> A look at the source code of function `nnir-retrieve-headers' would
>> help. You can find the code by pressing C-h f RET nnir-retrieve-headers
>> and click `nnir.el' in the help buffer.
>>
>> At the front of this function you will see a call to the function
>> `sort':
>>
>>  (let* ((group-articles (pop articles-by-group))
>> (artgroup (car group-articles))
>> (articleids (cadr group-articles))
>> (artlist (sort (mapcar 'cdr articleids) '<))
>>  
>> (server (gnus-group-server artgroup))
>>...
>>
>> The error message tells us that the 1st argument of `sort', (mapcar 'cdr
>> articleids) returns a list of nils. This involves a bunch of variables
>> and list operations, but by the documentation of `nnir-categorize' we
>> can infer that the structure of `group-articles' look like this:
>>
>> '((group1
>> ((nnir-article-ids article11)
>>  (nnir-article-ids article12)
>>  ...))
>>   (group2
>> ((nnir-article-ids article21)
>>  (nnir-article-ids article22)
>>  ...))
>>   (group3
>> ...))
>>
>> So `articleids' are this part: (nnir-article-ids article11)
>>
>> and `artlist' should be a list like this '(article11 article12 article21
>> ...)
>>
>> In this case, the first argument to `nnir-categorize' may be nil, thus
>> article11 ... are all nils, so you get a list of nils.
>>
>> The most likely reason therefore is that notmuch can't produce a list of
>> articles with your search conditions. I haven't used notmuch with gnus
>> so I can only provide a guess.
>>
>>>   gnus-retrieve-headers((1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
>>> 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
>>> 42 43 44 45 46 47 48 49 50 ...) "nnir:nnir-87zhckegiv.fsf" nil)
>>>   gnus-cache-retrieve-headers((1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
>>> 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
>>> 40 41 42 43 44 45 46 47 48 49 50 ...) "nnir:nnir-87zhckegiv.fsf" nil)
>>>   gnus-retrieve-headers((1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
>>> 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
>>> 42 43 44 45 46 47 48 49 50 ...) "nnir:nnir-87zhckegiv.fsf" nil)
>>>   gnus-fetch-headers((

Re: nnir with notmuch gives error; sort: Wrong type argument: number-or-marker-p, nil

2020-03-13 Thread xuqi
physiculus  writes:

> Eric Abrahamsen  writes:
>
> Hello,
>
> here is the output from the debugger.
> I dont know, what it mean, but i think you do :-)
>
> Hope it helps!
>
>
> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>   <(nil nil)
>   sort((nil) <)
>   nnir-retrieve-headers((1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
> 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
> 42 43 44 45 46 47 48 49 50 ...) "nnir-87zhckegiv.fsf" "nnir-ephemeral"
> nil)

A look at the source code of function `nnir-retrieve-headers' would
help. You can find the code by pressing C-h f RET nnir-retrieve-headers
and click `nnir.el' in the help buffer.

At the front of this function you will see a call to the function
`sort':

(let* ((group-articles (pop articles-by-group))
   (artgroup (car group-articles))
   (articleids (cadr group-articles))
   (artlist (sort (mapcar 'cdr articleids) '<))
 
   (server (gnus-group-server artgroup))
   ...

The error message tells us that the 1st argument of `sort', (mapcar 'cdr
articleids) returns a list of nils. This involves a bunch of variables
and list operations, but by the documentation of `nnir-categorize' we
can infer that the structure of `group-articles' look like this:

'((group1
((nnir-article-ids article11)
 (nnir-article-ids article12)
 ...))
  (group2
((nnir-article-ids article21)
 (nnir-article-ids article22)
 ...))
  (group3
...))

So `articleids' are this part: (nnir-article-ids article11)

and `artlist' should be a list like this '(article11 article12 article21
...)

In this case, the first argument to `nnir-categorize' may be nil, thus
article11 ... are all nils, so you get a list of nils.

The most likely reason therefore is that notmuch can't produce a list of
articles with your search conditions. I haven't used notmuch with gnus
so I can only provide a guess.

>   gnus-retrieve-headers((1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
> 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
> 42 43 44 45 46 47 48 49 50 ...) "nnir:nnir-87zhckegiv.fsf" nil)
>   gnus-cache-retrieve-headers((1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
> 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
> 40 41 42 43 44 45 46 47 48 49 50 ...) "nnir:nnir-87zhckegiv.fsf" nil)
>   gnus-retrieve-headers((1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
> 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
> 42 43 44 45 46 47 48 49 50 ...) "nnir:nnir-87zhckegiv.fsf" nil)
>   gnus-fetch-headers((1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 
> 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 
> 48 49 50 ...))
>   gnus-select-newsgroup("nnir:nnir-87zhckegiv.fsf" t nil)
>   gnus-summary-read-group-1("nnir:nnir-87zhckegiv.fsf" t t nil nil nil)
>   gnus-summary-read-group("nnir:nnir-87zhckegiv.fsf" t t nil nil nil nil)
>   gnus-group-read-group(t t "nnir:nnir-87zhckegiv.fsf" nil)
>   gnus-group-read-ephemeral-group("nnir-87zhckegiv.fsf" (nnir "nnir") nil nil 
> nil nil ((nnir-specs (nnir-query-spec (query . "hock")) (nnir-group-spec 
> ("nnmaildir:Lokal")
>   gnus-group-make-nnir-group(nil)
>   funcall-interactively(gnus-group-make-nnir-group nil)
>   call-interactively(gnus-group-make-nnir-group nil nil)
>   command-execute(gnus-group-make-nnir-group)
>
>> physiculus  writes:
>>
>>> Hello,
>>> if i try to use search with notmuch my nnmaildir, i get the error above.
>>> here are the lines from messages:
>>> Opening nnir server on nnir-ephemeral...done
>>> Retrieving newsgroup: nnir:nnir-877dzp783m.fsf...
>>> Doing notmuch query Hock...
>>> notmuch args: search --format=text --output=files Hock
>>> Massaging notmuch output...done
>>> Fetching headers for nnir:nnir-877dzp783m.fsf...
>>> sort: Wrong type argument: number-or-marker-p, nil
>>
>> Can you run M-x toggle-debug-on-error, then trigger this error again,
>> and send the backtrace to the list?
>>
>> Thanks,
>> Eric
>>
>>
>> ___
>> info-gnus-english mailing list
>> info-gnus-english@gnu.org
>> https://lists.gnu.org/mailman/listinfo/info-gnus-english
>
> ___
> info-gnus-english mailing list
> info-gnus-english@gnu.org
> https://lists.gnu.org/mailman/listinfo/info-gnus-english


___
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english