From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Documentation of nnoo.el Date: Sun, 12 Jul 2015 20:05:30 +0200 Message-ID: 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 1436724368 32734 80.91.229.3 (12 Jul 2015 18:06:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Jul 2015 18:06:08 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eric Abrahamsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 12 20:06:00 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 1ZELdX-00019D-6U for ged-emacs-devel@m.gmane.org; Sun, 12 Jul 2015 20:05:59 +0200 Original-Received: from localhost ([::1]:51543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZELdW-0002kX-KU for ged-emacs-devel@m.gmane.org; Sun, 12 Jul 2015 14:05:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZELdT-0002kK-GW for emacs-devel@gnu.org; Sun, 12 Jul 2015 14:05:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZELdP-0003FW-Eu for emacs-devel@gnu.org; Sun, 12 Jul 2015 14:05:55 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:34171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZELdP-0003FM-8I for emacs-devel@gnu.org; Sun, 12 Jul 2015 14:05:51 -0400 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1ZELd4-0000zv-VV; Sun, 12 Jul 2015 20:05:30 +0200 In-Reply-To: <87k2u66nvx.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 12 Jul 2015 11:44:18 +0800") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) X-MailScanner-ID: 1ZELd4-0000zv-VV MailScanner-NULL-Check: 1437329131.0752@hayO96/xywS6Kc272mvNxw X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 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:187830 Archived-At: 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. If anybody wants to rewrite all the backends that way -- please go ahead. > 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. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no