Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: hobbes@poukram.net (Rémi Letot)
Cc: ding@gnus.org
Subject: Re: saving registry is fixed, but gnorb still can't gnorb-org-view
Date: Wed, 01 Apr 2020 16:16:09 -0700	[thread overview]
Message-ID: <87zhbug5l2.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87bloahlmo.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Wed, 01 Apr 2020 15:44:15 -0700")

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> hobbes@poukram.net (Rémi Letot) writes:
>
>> hobbes@poukram.net writes:
>>
>>> Hello,
>>>
>>> this is what happens when I push s while in the group buffer:
>>
>> I quit gnus without saving newsrc, then restarted, and that problem is
>> gone. I probably lost some registry entries, some recent links between
>> org headings and gnus messages, but that's not a big problem.
>>
>> However this one is still there:
>>
>>> Also, might be related, gnorb-org-view (C-c v) on most (if not all) org
>>> entries linked to mails produces the following:
>>>
>>> Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
>>>   replace-regexp-in-string("\\(\\\\+\\)\\(?:\\'\\|[][]\\)" (closure
>>> ((link) org-ts-regexp org-time-stamp-formats org-src-source-file-name
>>> org-outline-regexp-bol org-inhibit-startup org-id-link-to-org-use-id
>>> org-highlight-links org-comment-string org-agenda-buffer-name
>>> clean-buffer-list-kill-buffer-names t) (_) (concat (make-string (/ (-
>>> (match-end 1) (match-beginning 1)) 2) 92))) nil nil t 1)
>>>   org-link-unescape(nil)
>>>   nnir-run-gnorb(((query .
>>> "id+6d3a4ef0-2748-409f-8607-a26112ea4353")) "nngnorb:Org tracking"
>
> What should be happening in this situation is that the code visits
> whatever subtree has ID "6d3a4ef0-2748-409f-8607-a26112ea4353", then
> collects all links of type "gnus:". Those links should look like:
>
> gnus:gmane.emacs.gnus.general#87y2rec48a.fsf@sphax
>
> Then each link is split on "#", and the second section (a message ID) is
> run through `org-link-unescape'.
>
> In your case, there's a link that has no message ID part. You could take
> a look at the Org tree in question and see which it is, and if you know
> how that link might have been created (or mangled).

Ooh, I might be wrong -- I got bitten by Org's changing link-related
regular expressions, and fixed some code for the new regexps, and
apparently wasn't careful enough with the fix. I'm assuming in your
subtree there's a "plain" link to a Gnus message, ie one that isn't
wrapped in brackets. Would you eval the function below and see if it
fixes the problem?

(defun gnorb-scan-links (bound &rest types)
  (unless (= (point) bound)
    (let ((alist (mapcar #'list (copy-sequence types))))
      (while (re-search-forward org-link-any-re bound t)
	(pcase-let* ((`(,type ,link) (split-string
				      (or
				       (match-string-no-properties 2)
				       (match-string-no-properties 0))
				      ":"))
		     (sym (intern-soft type)))
	  (when (and sym (memq sym types))
	    (push link (alist-get sym alist)))))
      alist)))


  reply	other threads:[~2020-04-01 23:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01 13:32 can't save gnus registry anymore, and gnorb " hobbes
2020-04-01 20:59 ` saving registry is fixed, but gnorb still " Rémi Letot
2020-04-01 22:44   ` Eric Abrahamsen
2020-04-01 23:16     ` Eric Abrahamsen [this message]
2020-04-02 13:05       ` hobbes
2020-04-02 14:55         ` Eric Abrahamsen
2020-04-02 15:03           ` hobbes
2020-04-02 16:28             ` Eric Abrahamsen
2020-04-02 18:15             ` Eric Abrahamsen
2020-04-05 19:18               ` hobbes
2020-04-05 21:32                 ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zhbug5l2.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=ding@gnus.org \
    --cc=hobbes@poukram.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).