From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/5908 Path: main.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.gnus.general Subject: Re: Strange nntp port number? Date: 12 Apr 1996 05:16:02 +0200 Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035146443 1750 80.91.224.250 (20 Oct 2002 20:40:43 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:40:43 +0000 (UTC) Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by deanna.miranova.com (8.7.5/8.6.9) with SMTP id UAA27870 for ; Thu, 11 Apr 1996 20:47:14 -0700 Original-Received: from hler.ifi.uio.no (4867@hler.ifi.uio.no [129.240.94.23]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Fri, 12 Apr 1996 05:16:04 +0200 Original-Received: (from larsi@localhost) by hler.ifi.uio.no ; Fri, 12 Apr 1996 05:16:03 +0200 Original-To: ding@ifi.uio.no Original-Lines: 55 Xref: main.gmane.org gmane.emacs.gnus.general:5908 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:5908 Kai Grossjohann writes: > I have learned from inspecting nndir.el that I should write a function > nndb-execute-nntp-command which calls the nntp-functions, then use > this to redirect all nntp-* functions. > > Right now, this is what nndb-execute-nntp-command looks like: > > (defun nndb-execute-nntp-command (command) > (let ((nntp-port-number nndb-port-number) > (nntp-address nndb-address)) > (eval command))) I think something like the following might do the trick: (defun nndb-execute-nntp-command (command) (unless (nntp-server-opened nndb-current-server) (nntp-open-server nndb-current-server `((nntp-port-number ,nndb-port-number) (nntp-address ,nndb-address)))) (eval command)) The backend thing feels kinda kludgy. Perhaps I should think more OO-y thoughts and implement some kind of inheretance scheme. It's just loose thoughts at the moment, but perhaps one should be able to say something like: (nnheader-inherit 'nntp 'nndb) This would define all nndb interface functions as the nntp functions, but with a wrapper like the one above around each function call. That means that one should have a: (nnheader-define-server 'nndb `((nntp-port-number ,nndb-port-number) (nntp-address ,nndb-address))) That defines the mapping from nndb variables to nntp variables. Hm. But one should be able to inherit functions from several backends. (nndir uses both nnml and nnmh functions, for instance.) (defun nndb-request-article (&rest args) (nnheader-call-function 'nntp 'nndb args)) Hm. Then one neeps several mappings like the define-server call above... These are all rather easy to implement. Perhaps we should think some more and come up with a totally new backend interface scheme. Any ideas? -- "Yes. The journey through the human heart would have to wait until some other time."