Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* question about org-link gnus message and gnus registry
@ 2021-12-01 20:12 physiculus
  2021-12-01 23:47 ` Bob Newell
  2021-12-03  3:18 ` Eric Abrahamsen
  0 siblings, 2 replies; 14+ messages in thread
From: physiculus @ 2021-12-01 20:12 UTC (permalink / raw)
  To: info-gnus-english

hello,
i'm just struggeling about the consistency of an org-link to a gnus message
after moving this message into another folder on same server or a
different one.

scenario:
i create a org link with org and insert the link into an org file.
works.

now i move the message inside gnus to another folder.

open the link inside the org file is not valid anymore.

i thought, that the registry is responsible for saving the position of
any message. therefore it saves the message-id and use this to locate
the message.

and i thought, that org-link "knows" this message-id, though the link to
the message is valid without the position of the folder or better the
position of the message inside the folder.
like a database index.
but now i'm quite sure, that my thoughts were completely wrong??
or is it possible to locate a message through org-link?

any ideas?

Regards

-- 
Jens Reimer


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

* Re: question about org-link gnus message and gnus registry
  2021-12-01 20:12 question about org-link gnus message and gnus registry physiculus
@ 2021-12-01 23:47 ` Bob Newell
  2021-12-02 19:07   ` physiculus
  2021-12-03  3:18 ` Eric Abrahamsen
  1 sibling, 1 reply; 14+ messages in thread
From: Bob Newell @ 2021-12-01 23:47 UTC (permalink / raw)
  To: info-gnus-english


physiculus <physiculus@gmail.com> writes:

>
> scenario:
> i create a org link with org and insert the link into an org file.
> works.
>
> now i move the message inside gnus to another folder.
>
> open the link inside the org file is not valid anymore.

Without getting into unknown territory about why this is, I
have encountered the same problem.

I have a solution that applies only to gmail, so it may not
help. I have some elisp that runs as a hook after a gnus
org-mode link is created, and changes (for instance) "Inbox"
to "All Mail". This takes advantage of the fact that
everything in gmail is always in "All Mail" so the org link is
always valid.

Something similar for non-gmail probably could be cooked up if
you're willing to move the item in question to a common folder
such as an archive.

I don't say that this is a substitute for actually figuring
things out. I have tried Gnorb which tracks via the registry
but never completely got it to be as general as I wished.

-- 
Bob Newell
Honolulu, Hawai`i

- Via GNU/Linux/Emacs/Gnus/BBDB


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

* Re: question about org-link gnus message and gnus registry
  2021-12-01 23:47 ` Bob Newell
@ 2021-12-02 19:07   ` physiculus
  2021-12-02 19:20     ` Eric Abrahamsen
  0 siblings, 1 reply; 14+ messages in thread
From: physiculus @ 2021-12-02 19:07 UTC (permalink / raw)
  To: Bob Newell; +Cc: info-gnus-english

Am Mi, 2021-12-01, 13:47 -1000, Bob Newell <bobnewell@bobnewell.net> schrieb:

hello,
thanks for the reply.
i gave gnorb a try, but if i move a message,  that is linked with gnorb,
i got the following error:
gnorb-org-setup-message: Symbol’s function definition is void: second

do you know what it means?

Regards
Jens
---

> physiculus <physiculus@gmail.com> writes:
>
>>
>> scenario:
>> i create a org link with org and insert the link into an org file.
>> works.
>>
>> now i move the message inside gnus to another folder.
>>
>> open the link inside the org file is not valid anymore.
>
> Without getting into unknown territory about why this is, I
> have encountered the same problem.
>
> I have a solution that applies only to gmail, so it may not
> help. I have some elisp that runs as a hook after a gnus
> org-mode link is created, and changes (for instance) "Inbox"
> to "All Mail". This takes advantage of the fact that
> everything in gmail is always in "All Mail" so the org link is
> always valid.
>
> Something similar for non-gmail probably could be cooked up if
> you're willing to move the item in question to a common folder
> such as an archive.
>
> I don't say that this is a substitute for actually figuring
> things out. I have tried Gnorb which tracks via the registry
> but never completely got it to be as general as I wished.


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

* Re: question about org-link gnus message and gnus registry
  2021-12-02 19:07   ` physiculus
@ 2021-12-02 19:20     ` Eric Abrahamsen
  2021-12-02 19:35       ` physiculus
  0 siblings, 1 reply; 14+ messages in thread
From: Eric Abrahamsen @ 2021-12-02 19:20 UTC (permalink / raw)
  To: info-gnus-english

physiculus <physiculus@gmail.com> writes:

> Am Mi, 2021-12-01, 13:47 -1000, Bob Newell <bobnewell@bobnewell.net> schrieb:
>
> hello,
> thanks for the reply.
> i gave gnorb a try, but if i move a message,  that is linked with gnorb,
> i got the following error:
> gnorb-org-setup-message: Symbol’s function definition is void: second
>
> do you know what it means?

All calls to `second' in the Gnorb codebase should have been replaced by
`cl-second' years ago (like in 2014). Can you tell me your Gnorb
version, and also run M-x toggle-debug-on-error and trigger the error
again, then send me the backtrace?

Thanks,
Eric



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

* Re: question about org-link gnus message and gnus registry
  2021-12-02 19:20     ` Eric Abrahamsen
@ 2021-12-02 19:35       ` physiculus
  2021-12-02 21:29         ` Eric Abrahamsen
  0 siblings, 1 reply; 14+ messages in thread
From: physiculus @ 2021-12-02 19:35 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: info-gnus-english

Am Do, 2021-12-02, 11:20 -0800, Eric Abrahamsen <eric@ericabrahamsen.net> schrieb:

hello,
the version is 1.6.9 from elpa, installed today.

this is the backtrace:
Debugger entered--Lisp error: (void-function second)
  signal(void-function (second))
  gnorb-org-setup-message(("nnimap+GMail:gnus#87o860krsm.fsf@googlemail.com") nil nil nil nil nil nil "65281282-7850-4f1f-b9e3-e18413932a1a")
  gnorb-org-handle-mail(nil)
  funcall-interactively(gnorb-org-handle-mail nil)
  call-interactively(gnorb-org-handle-mail record nil)
  command-execute(gnorb-org-handle-mail record)
  execute-extended-command(nil "gnorb-org-handle-mail" nil)
  funcall-interactively(execute-extended-command nil "gnorb-org-handle-mail" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

hope it helps

regards
Jens

> physiculus <physiculus@gmail.com> writes:
>
>> Am Mi, 2021-12-01, 13:47 -1000, Bob Newell <bobnewell@bobnewell.net> schrieb:
>>
>> hello,
>> thanks for the reply.
>> i gave gnorb a try, but if i move a message,  that is linked with gnorb,
>> i got the following error:
>> gnorb-org-setup-message: Symbol’s function definition is void: second
>>
>> do you know what it means?
>
> All calls to `second' in the Gnorb codebase should have been replaced by
> `cl-second' years ago (like in 2014). Can you tell me your Gnorb
> version, and also run M-x toggle-debug-on-error and trigger the error
> again, then send me the backtrace?
>
> Thanks,
> Eric
>
>

-- 
Jens Reimer

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

* Re: question about org-link gnus message and gnus registry
  2021-12-02 19:35       ` physiculus
@ 2021-12-02 21:29         ` Eric Abrahamsen
  2021-12-02 21:42           ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Eric Abrahamsen @ 2021-12-02 21:29 UTC (permalink / raw)
  To: info-gnus-english

physiculus <physiculus@gmail.com> writes:

> Am Do, 2021-12-02, 11:20 -0800, Eric Abrahamsen <eric@ericabrahamsen.net> schrieb:
>
> hello,
> the version is 1.6.9 from elpa, installed today.
>
> this is the backtrace:
> Debugger entered--Lisp error: (void-function second)
>   signal(void-function (second))
>   gnorb-org-setup-message(("nnimap+GMail:gnus#87o860krsm.fsf@googlemail.com") nil nil nil nil nil nil "65281282-7850-4f1f-b9e3-e18413932a1a")
>   gnorb-org-handle-mail(nil)
>   funcall-interactively(gnorb-org-handle-mail nil)
>   call-interactively(gnorb-org-handle-mail record nil)
>   command-execute(gnorb-org-handle-mail record)
>   execute-extended-command(nil "gnorb-org-handle-mail" nil)
>   funcall-interactively(execute-extended-command nil "gnorb-org-handle-mail" nil)
>   call-interactively(execute-extended-command nil nil)
>   command-execute(execute-extended-command)

I honestly don't know what's going on here. There's no call to `second'
in `gnorb-org-setup-message', not even a call to `cl-second'. Are you
comfortable with stepping through functions using edebug? That might be
the best way of getting to the bottom of it.



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

* Re: question about org-link gnus message and gnus registry
  2021-12-02 21:29         ` Eric Abrahamsen
@ 2021-12-02 21:42           ` Michael Heerdegen
  2021-12-02 21:44             ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2021-12-02 21:42 UTC (permalink / raw)
  To: info-gnus-english

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I honestly don't know what's going on here. There's no call to
> `second' in `gnorb-org-setup-message', not even a call to
> `cl-second'. Are you comfortable with stepping through functions using
> edebug?

Wait - the backtrace looks like it's an re-thrown error from the
condition-case near the beginning.  And indeed - look at
`gnorb-reply-to-gnus-link'.

Michael.



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

* Re: question about org-link gnus message and gnus registry
  2021-12-02 21:42           ` Michael Heerdegen
@ 2021-12-02 21:44             ` Michael Heerdegen
  2021-12-02 22:42               ` Eric Abrahamsen
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2021-12-02 21:44 UTC (permalink / raw)
  To: info-gnus-english

Michael Heerdegen <michael_heerdegen@web.de> writes:

>  And indeed - look at `gnorb-reply-to-gnus-link'.

OTOH you can also simply look at the compiler warnings...

Michael.



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

* Re: question about org-link gnus message and gnus registry
  2021-12-02 21:44             ` Michael Heerdegen
@ 2021-12-02 22:42               ` Eric Abrahamsen
  2021-12-02 22:46                 ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Eric Abrahamsen @ 2021-12-02 22:42 UTC (permalink / raw)
  To: info-gnus-english

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
>>  And indeed - look at `gnorb-reply-to-gnus-link'.
>
> OTOH you can also simply look at the compiler warnings...

I'm still just seeing a call to `cl-second', which is required at
compile time. And my, there are a lot of compiler warnings! But nothing
about second or cl-second...



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

* Re: question about org-link gnus message and gnus registry
  2021-12-02 22:42               ` Eric Abrahamsen
@ 2021-12-02 22:46                 ` Michael Heerdegen
  2021-12-03  0:30                   ` Eric Abrahamsen
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2021-12-02 22:46 UTC (permalink / raw)
  To: info-gnus-english

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I'm still just seeing a call to `cl-second', which is required at
> compile time. And my, there are a lot of compiler warnings! But nothing
> about second or cl-second...

This is where I found it:

#+begin_src emacs-lisp
(defun gnorb-reply-to-gnus-link (link)
  "Start a reply to the linked message."
  (let* ((link (org-link-unescape link))
	 (group (car (org-split-string link "#")))
	 (id (gnorb-bracket-message-id
	      (second (org-split-string link "#"))))
	 (backend
	  (car (gnus-find-method-for-group group))))
    (gnorb-follow-gnus-link group id)
    (call-interactively
     (if (eq backend 'nntp)
	 'gnus-summary-followup-with-original
       'gnus-summary-wide-reply-with-original))))
#+end_src


Michael.



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

* Re: question about org-link gnus message and gnus registry
  2021-12-02 22:46                 ` Michael Heerdegen
@ 2021-12-03  0:30                   ` Eric Abrahamsen
  2021-12-03  1:50                     ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Eric Abrahamsen @ 2021-12-03  0:30 UTC (permalink / raw)
  To: info-gnus-english

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> I'm still just seeing a call to `cl-second', which is required at
>> compile time. And my, there are a lot of compiler warnings! But nothing
>> about second or cl-second...
>
> This is where I found it:
>
> #+begin_src emacs-lisp
> (defun gnorb-reply-to-gnus-link (link)
>   "Start a reply to the linked message."
>   (let* ((link (org-link-unescape link))
> 	 (group (car (org-split-string link "#")))
> 	 (id (gnorb-bracket-message-id
> 	      (second (org-split-string link "#"))))
> 	 (backend
> 	  (car (gnus-find-method-for-group group))))
>     (gnorb-follow-gnus-link group id)
>     (call-interactively
>      (if (eq backend 'nntp)
> 	 'gnus-summary-followup-with-original
>        'gnus-summary-wide-reply-with-original))))
> #+end_src

Crap, it's in a commit I've had locally since... late 2020, but never
released. Sorry about that, I'll do another version release in a moment.

Thanks for finding this!

Eric



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

* Re: question about org-link gnus message and gnus registry
  2021-12-03  0:30                   ` Eric Abrahamsen
@ 2021-12-03  1:50                     ` Michael Heerdegen
  2021-12-03  1:57                       ` Eric Abrahamsen
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2021-12-03  1:50 UTC (permalink / raw)
  To: info-gnus-english

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Crap, it's in a commit I've had locally since... late 2020, but never
> released.

Then now it's one of the best tested commits ever ;-)

I have a lot of these myself...

Michael.



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

* Re: question about org-link gnus message and gnus registry
  2021-12-03  1:50                     ` Michael Heerdegen
@ 2021-12-03  1:57                       ` Eric Abrahamsen
  0 siblings, 0 replies; 14+ messages in thread
From: Eric Abrahamsen @ 2021-12-03  1:57 UTC (permalink / raw)
  To: info-gnus-english

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Crap, it's in a commit I've had locally since... late 2020, but never
>> released.
>
> Then now it's one of the best tested commits ever ;-)
>
> I have a lot of these myself...

When we say battle-tested...



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

* Re: question about org-link gnus message and gnus registry
  2021-12-01 20:12 question about org-link gnus message and gnus registry physiculus
  2021-12-01 23:47 ` Bob Newell
@ 2021-12-03  3:18 ` Eric Abrahamsen
  1 sibling, 0 replies; 14+ messages in thread
From: Eric Abrahamsen @ 2021-12-03  3:18 UTC (permalink / raw)
  To: info-gnus-english

physiculus <physiculus@gmail.com> writes:

> hello,
> i'm just struggeling about the consistency of an org-link to a gnus message
> after moving this message into another folder on same server or a
> different one.
>
> scenario:
> i create a org link with org and insert the link into an org file.
> works.
>
> now i move the message inside gnus to another folder.
>
> open the link inside the org file is not valid anymore.
>
> i thought, that the registry is responsible for saving the position of
> any message. therefore it saves the message-id and use this to locate
> the message.
>
> and i thought, that org-link "knows" this message-id, though the link to
> the message is valid without the position of the folder or better the
> position of the message inside the folder.
> like a database index.
> but now i'm quite sure, that my thoughts were completely wrong??
> or is it possible to locate a message through org-link?

To your original question! Yes, theoretically `org-gnus-follow-link'
could try to locate the message the regular way, and if that doesn't
work, could check `gnus-registry-enabled' and then try
`gnus-registry-get-id-key' to get the new group.

Someone would have to write that code, though!

Eric



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

end of thread, other threads:[~2021-12-03  3:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01 20:12 question about org-link gnus message and gnus registry physiculus
2021-12-01 23:47 ` Bob Newell
2021-12-02 19:07   ` physiculus
2021-12-02 19:20     ` Eric Abrahamsen
2021-12-02 19:35       ` physiculus
2021-12-02 21:29         ` Eric Abrahamsen
2021-12-02 21:42           ` Michael Heerdegen
2021-12-02 21:44             ` Michael Heerdegen
2021-12-02 22:42               ` Eric Abrahamsen
2021-12-02 22:46                 ` Michael Heerdegen
2021-12-03  0:30                   ` Eric Abrahamsen
2021-12-03  1:50                     ` Michael Heerdegen
2021-12-03  1:57                       ` Eric Abrahamsen
2021-12-03  3:18 ` Eric Abrahamsen

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