From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: larsi@gnus.org, 38252@debbugs.gnu.org
Subject: bug#38252: 27.0.50; Gnus server definitions and generic function specializers
Date: Mon, 18 Nov 2019 12:43:37 -0800 [thread overview]
Message-ID: <87v9rgncee.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <jwvd0dp95h5.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 17 Nov 2019 23:36:09 -0500")
On 11/17/19 23:36 PM, Stefan Monnier wrote:
>> But just so I don't feel like I wasted my afternoon: how *would* one
>> write the generalizer I'm talking about?
>
> Ah, that part.
> I guess It could look like (guaranteed 100% untested):
>
> (defvar gnus--legacy-server-tag (make-symbol "gnus-legacy-server"))
> (cl-generic-define-generalizer gnus-legacy-server-generalizer
> 90 (lambda (varname &rest _)
> `(and (consp ,varname)
> (symbolp (car ,varname))
> (assq (car ,varname) nnoo-definition-alist)
> (stringp (cadr ,varname))
> gnus--legacy-server-tag))
> (lambda (tag &rest _)
> (when (eq tag gnus--legacy-server-tag) (list tag))))
>
> (cl-defmethod cl-generic-generalizers ((_ (eql gnus-legacy-server)))
> "Dispatch on old-style Gnus server definitions."
> (list gnus-legacy-server-generalizer))
That's perfect, thanks. I don't need tested code, I just needed to
understand the logic of which bit is responsible for what. I wonder if
it would be useful to have an example of this, either in the manual or
cl-generic.el code comments?
There's still a lot of work to do before struct servers and cons servers
can coexist within Gnus, but it's nice to have this piece of the puzzle
solved.
prev parent reply other threads:[~2019-11-18 20:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-17 22:31 bug#38252: 27.0.50; Gnus server definitions and generic function specializers Eric Abrahamsen
2019-11-18 2:03 ` Stefan Monnier
2019-11-18 3:18 ` Eric Abrahamsen
2019-11-18 4:36 ` Stefan Monnier
2019-11-18 20:43 ` Eric Abrahamsen [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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v9rgncee.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=38252@debbugs.gnu.org \
--cc=larsi@gnus.org \
--cc=monnier@iro.umontreal.ca \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).