emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'No applicable method' error when calling 'gnus-icalendar-save-part'


From: James Thomas
Subject: Re: 'No applicable method' error when calling 'gnus-icalendar-save-part'
Date: Mon, 14 Oct 2024 04:20:45 +0530
User-agent: Gnus/5.13 (Gnus v5.13)

Fabio Natali wrote:

> On 2024-10-13, 05:41 +0530, James Thomas via "Emacs development
> discussions." <emacs-devel@gnu.org> wrote:
>> Have you tried using gnus-icalendar-sync-event-to-org?
>>
>> Something like:
>>
>> (defun notmuch-show-import-icalendar-part ()
>>   "Import the iCalendar part at point to Org Agenda."
>>   (interactive)
>>   (let (gnus-icalendar-reply-status)
>>     (notmuch-show-apply-to-current-part-handle
>>     #'gnus-icalendar-sync-event-to-org)))
>
> This also gives a 'No applicable method' error:
>
> cl-no-applicable-method: No applicable method:
> gnus-icalendar-event:sync-to-org, (#<killed buffer> ("text/calendar")
> nil nil (attachment (filename . "file.ics")) nil nil nil), nil
>
> I think the reason is that 'gnus-icalendar-sync-event-to-org' expects an
> 'event' as input but a 'handle' is instead passed.

OK, that's one thing; another is that it'll be the same REPLY event.

> 'gnus-icalendar-save-part' does expect and does correctly receive a
> 'handle' but it then fails for the reasons explained in my previous
> email. Considering the signature, it'd seem that
> 'gnus-icalendar-save-part' is the appropriate method?

> I'd be tempted to send a patch along the lines of option 2 from my other
> email and then see what reviewers think. Unless you've any other idea
> around 'gnus-icalendar-sync-event-to-org' or if I've
> missed/misinterpreted any of the steps.

I don't recommend your patch because the original reasoning might've
been that a REPLY event isn't significant enough to be 'saved' anywhere.
It might be better to use your _adaptation_ instead.

Otherwise the 'right' way to do this would be another method for the
REPLY event.

(cl-defmethod gnus-icalendar-event:sync-to-org ((event
gnus-icalendar-event-reply) _reply-status) ...)

Regards,
James



reply via email to

[Prev in Thread] Current Thread [Next in Thread]