unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: emacs-devel@gnu.org
Subject: Re: Documentation of nnoo.el
Date: Mon, 13 Jul 2015 10:56:28 +0800	[thread overview]
Message-ID: <87pp3w4vfn.fsf@ericabrahamsen.net> (raw)
In-Reply-To: m34ml9nted.fsf@gnus.org

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> nnoo.el is basically just an object-oriented system replicated with pure
>> functions. deffoo creates methods, defvoo creates slots. `nnoo-declare'
>> is kind of the equivalent of `defclass'. `nnoo-change-server' is the
>> main function for switching servers: it copies the defvoo slot values
>> for a single server into the respective global variables.
>
> Yup.  It was written that way (back in...  what?  94?) because there was
> some resistance to altering the "interface" defined by previous Gnus
> backends.  (See nnnil.el for a basic summary of what that is.)  By
> having Gnus switch around variables behind the backends' backs, the
> "interface" was preserved while Gnus could go on having multiple servers
> of the same type, etc.
>
> I don't know whether that was a good trade-off (keeping the interface
> vs. introducing lots of magic), but if I were to write that stuff now, I
> wouldn't do it that way.  :-)  I'd pass in explicit object describing
> the server state to each backend function, and I wouldn't have any
> "global" voo variables at all.

That's a lot earlier than I thought!

Does this mean you'd rather not go all the way with EIEIO? Maybe just
vectors or something?

> If anybody wants to rewrite all the backends that way -- please go ahead.

Well that's the real crux, isn't it :) I'm happy to try banging together
a preliminary example of how it might look. I don't think rewriting the
backends would be as much work as adjusting pretty much everything else
to use the new code.

>> 1. First, only make backends into classes. This would give us the chance
>>    to do away with the select-method/secondary-select-method
>>    distinction, and just have a list of defined servers.
>
> I think that's a totally orthogonal issue.  We could do that now, but
> it'd break the current naming scheme for the groups in Gnus.

It is orthogonal, but on the other hand it would take extra effort to
preserve. Do you mean the "nnml+ServerName:GroupName" scheme? I don't
quite see how doing away with the primary/secondary distinction would
affect that...

Eric




  reply	other threads:[~2015-07-13  2:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 15:01 Documentation of nnoo.el Stefan Monnier
2015-07-12  1:32 ` Eric Abrahamsen
2015-07-12  2:25   ` Stefan Monnier
2015-07-12  3:44     ` Eric Abrahamsen
2015-07-12 11:17       ` Rasmus
2015-07-12 12:15         ` Eric Abrahamsen
2015-07-12 18:05       ` Lars Magne Ingebrigtsen
2015-07-13  2:56         ` Eric Abrahamsen [this message]
2015-12-24 16:59           ` Lars Ingebrigtsen
2015-12-25  3:44             ` Eric Abrahamsen
2015-12-26 22:11               ` Lars Ingebrigtsen
2015-12-27  1:03                 ` Eric Abrahamsen
2015-12-27  6:03                   ` Lars Ingebrigtsen
2015-07-12 17:55 ` Lars Magne Ingebrigtsen
2015-07-12 18:22   ` Nikolaus Rath

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=87pp3w4vfn.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=emacs-devel@gnu.org \
    /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).