From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/68909 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Add `nnregistry', for use in `gnus-refer-article-method' Date: Mon, 17 Aug 2009 17:16:23 +0200 Message-ID: <87iqgmqxmg.fsf@gnu.org> References: <8763d8opn4.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1250522287 2774 80.91.229.12 (17 Aug 2009 15:18:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Aug 2009 15:18:07 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M17329@lists.math.uh.edu Mon Aug 17 17:17:56 2009 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1Md3y6-0003oz-Nk for ding-account@gmane.org; Mon, 17 Aug 2009 17:17:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Md3xM-00067F-OH; Mon, 17 Aug 2009 10:17:08 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Md3xL-00066y-0d for ding@lists.math.uh.edu; Mon, 17 Aug 2009 10:17:07 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1Md3xJ-0004Sz-EZ for ding@lists.math.uh.edu; Mon, 17 Aug 2009 10:17:06 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1Md3xt-0002y4-00 for ; Mon, 17 Aug 2009 17:17:41 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1Md3x6-00039P-3r for ding@gnus.org; Mon, 17 Aug 2009 17:16:52 +0200 Original-Received: from laptop-147-210-128-170.labri.fr ([147.210.128.170]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Aug 2009 17:16:52 +0200 Original-Received: from ludo by laptop-147-210-128-170.labri.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Aug 2009 17:16:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 112 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: laptop-147-210-128-170.labri.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 30 Thermidor an 217 de la =?iso-8859-1?Q?R=E9volutio?= =?iso-8859-1?Q?n?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:oYgmQMt6+s0cbmEi642eLXhPuM8= X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:68909 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Hello! As a follow-up to this thread, attached is `nnregistry', a dumb back-end whose sole purpose is to allow `gnus-summary-refer-parent-article' and similar functions to work across back-ends. It can be used like this: --8<---------------cut here---------------start------------->8--- (setq gnus-refer-article-method '(current (nnregistry) (nnweb "gmane" (nnweb-type gmane)))) --8<---------------cut here---------------end--------------->8--- What do you think of the approach and code? It's my first time hacking Gnus so I'd appreciate reviews. Thanks, Ludo'. PS: I don't (yet) have a copyright assignment on file for Emacs. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=nnregistry.el Content-Transfer-Encoding: quoted-printable Content-Description: nnregistry ;;; nnregistry.el --- access to articles via Gnus' message-id registry ;; Copyright (C) 2009 Free Software Foundation, Inc. ;; Authors: Ludovic Court=C3=A8s ;; Keywords: news, mail ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . ;;; Commentary: ;; This file provides the `nnregistry' Gnus back-end. It can be used ;; in `gnus-refer-article-method' to quickly search for a message by ;; id, regardless of the back-end that stores it. ;;; Code: (require 'nnoo) (require 'gnus-registry) (require 'gnus-int) (nnoo-declare nnregistry) (deffoo nnregistry-server-opened (server) (eq gnus-registry-install t)) (deffoo nnregistry-close-server (server) t) (deffoo nnregistry-status-message (server) nil) (deffoo nnregistry-open-server (server &optional defs) (eq gnus-registry-install t)) (defvar nnregistry-within-nnregistry nil) (deffoo nnregistry-request-article (id &optional group server buffer) (and (not nnregistry-within-nnregistry) (let* ((nnregistry-within-nnregistry t) (group (gnus-registry-fetch-group id)) (gnus-override-method nil)) (message "nnregistry: requesting article `%s' in group `%s'" id group) (and group (gnus-check-group group) (gnus-request-article id group buffer))))) (provide 'nnregistry) ;;; nnregistry.el ends here --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) iEYEARECAAYFAkqJdE8ACgkQd92V4upS7PRynQCeMHFBMmIe5u39F9mK2KbibJzy yXEAoJWgXr1qX3Ep0I501oLYeuro9kTl =QNIz -----END PGP SIGNATURE----- --==-=-=--