From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: Documentation of nnoo.el Date: Mon, 13 Jul 2015 10:56:28 +0800 Message-ID: <87pp3w4vfn.fsf@ericabrahamsen.net> References: <87615q88kh.fsf@ericabrahamsen.net> <87k2u66nvx.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436756240 21800 80.91.229.3 (13 Jul 2015 02:57:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 Jul 2015 02:57:20 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 13 04:57:08 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZETvV-0005p8-U6 for ged-emacs-devel@m.gmane.org; Mon, 13 Jul 2015 04:57:06 +0200 Original-Received: from localhost ([::1]:52608 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZETvV-0005kT-7f for ged-emacs-devel@m.gmane.org; Sun, 12 Jul 2015 22:57:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZETvF-0005kH-Js for emacs-devel@gnu.org; Sun, 12 Jul 2015 22:56:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZETvB-0004NC-Fu for emacs-devel@gnu.org; Sun, 12 Jul 2015 22:56:49 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:55047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZETvB-0004N3-8U for emacs-devel@gnu.org; Sun, 12 Jul 2015 22:56:45 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZETv7-0005g8-SH for emacs-devel@gnu.org; Mon, 13 Jul 2015 04:56:43 +0200 Original-Received: from 222.128.167.57 ([222.128.167.57]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Jul 2015 04:56:41 +0200 Original-Received: from eric by 222.128.167.57 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Jul 2015 04:56:41 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 48 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 222.128.167.57 User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:D5u1Pg0Xv0jnPuO3KmxVwRr/7PI= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187845 Archived-At: Lars Magne Ingebrigtsen writes: > Eric Abrahamsen 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