Re: question about org-link gnus message and gnus registry

2021-12-02 Thread Eric Abrahamsen
physiculus  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




Re: question about org-link gnus message and gnus registry

2021-12-02 Thread Eric Abrahamsen
Michael Heerdegen  writes:

> Eric Abrahamsen  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...




Re: question about org-link gnus message and gnus registry

2021-12-02 Thread Michael Heerdegen
Eric Abrahamsen  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.




Re: question about org-link gnus message and gnus registry

2021-12-02 Thread Eric Abrahamsen
Michael Heerdegen  writes:

> Eric Abrahamsen  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




Re: question about org-link gnus message and gnus registry

2021-12-02 Thread Michael Heerdegen
Eric Abrahamsen  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.




Re: question about org-link gnus message and gnus registry

2021-12-02 Thread Eric Abrahamsen
Michael Heerdegen  writes:

> Michael Heerdegen  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...




Re: question about org-link gnus message and gnus registry

2021-12-02 Thread Michael Heerdegen
Michael Heerdegen  writes:

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

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

Michael.




Re: question about org-link gnus message and gnus registry

2021-12-02 Thread Michael Heerdegen
Eric Abrahamsen  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.




Re: question about org-link gnus message and gnus registry

2021-12-02 Thread Eric Abrahamsen
physiculus  writes:

> Am Do, 2021-12-02, 11:20 -0800, Eric Abrahamsen  
> 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@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.




Re: question about org-link gnus message and gnus registry

2021-12-02 Thread physiculus
Am Do, 2021-12-02, 11:20 -0800, Eric Abrahamsen  
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@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  writes:
>
>> Am Mi, 2021-12-01, 13:47 -1000, Bob Newell  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


Re: question about org-link gnus message and gnus registry

2021-12-02 Thread Eric Abrahamsen
physiculus  writes:

> Am Mi, 2021-12-01, 13:47 -1000, Bob Newell  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




Re: question about org-link gnus message and gnus registry

2021-12-02 Thread physiculus
Am Mi, 2021-12-01, 13:47 -1000, Bob Newell  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  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.