all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: James Thomas <jimjoe@gmx.net>
To: Fabio Natali <me@fabionatali.com>
Cc: emacs-devel@gnu.org
Subject: Re: 'No applicable method' error when calling 'gnus-icalendar-save-part'
Date: Mon, 14 Oct 2024 04:20:45 +0530	[thread overview]
Message-ID: <8634kzr516.fsf@gmx.net> (raw)
In-Reply-To: <87msj7yg1e.fsf@fabionatali.com> (Fabio Natali's message of "Sun,  13 Oct 2024 20:11:09 +0100")

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	other threads:[~2024-10-13 22:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08 16:31 'No applicable method' error when calling 'gnus-icalendar-save-part' Fabio Natali
2024-10-09 19:54 ` Emanuel Berg
2024-10-13  0:11 ` James Thomas via Emacs development discussions.
2024-10-13 19:11   ` Fabio Natali
2024-10-13 22:50     ` James Thomas [this message]

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=8634kzr516.fsf@gmx.net \
    --to=jimjoe@gmx.net \
    --cc=emacs-devel@gnu.org \
    --cc=me@fabionatali.com \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.