From unknown Fri Jun 20 07:22:31 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#66188 <66188@debbugs.gnu.org> To: bug#66188 <66188@debbugs.gnu.org> Subject: Status: 29.1; Include Atom feed reader Reply-To: bug#66188 <66188@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:22:31 +0000 retitle 66188 29.1; Include Atom feed reader reassign 66188 emacs,gnus submitter 66188 Daniel Cerqueira severity 66188 wishlist tag 66188 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 25 03:14:31 2023 Received: (at submit) by debbugs.gnu.org; 25 Sep 2023 07:14:31 +0000 Received: from localhost ([127.0.0.1]:44007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkfnX-0004tR-U7 for submit@debbugs.gnu.org; Mon, 25 Sep 2023 03:14:31 -0400 Received: from lists.gnu.org ([2001:470:142::17]:52320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkU2r-0006vK-Bt for submit@debbugs.gnu.org; Sun, 24 Sep 2023 14:41:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qkU2Z-00083P-Pm for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 14:41:11 -0400 Received: from forward100c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:d100]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qkU2V-00035b-9x for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 14:41:11 -0400 Received: from mail-nwsmtp-smtp-production-main-19.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-19.sas.yp-c.yandex.net [IPv6:2a02:6b8:c14:4081:0:640:557:0]) by forward100c.mail.yandex.net (Yandex) with ESMTP id BE256600CA for ; Sun, 24 Sep 2023 21:41:00 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-19.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id xeSlN6XDaCg0-V73sBMrj; Sun, 24 Sep 2023 21:41:00 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brilhante.top; s=mail; t=1695580860; bh=LAx34CHaocfMltJwn5Gffm0Ps4FqJMG6RBlYdxiLkUo=; h=Message-ID:Date:Subject:To:From; b=VOqEWUjjBPTt6/Ai12HPIVxAVap0Yv90EyMNyGuczpuhayqs1rdIgKR+0mZ8zVVnb Zjruy0IM+uodGYXb7Bcg233Jg1sqCIkdL6z0JaSGiEdyhx0qiDp78T+JOQCvUv+JcD UNcWxyGFPCmWcC/VpSzE2aVmIpvRN5+x/cHHe2sM= Authentication-Results: mail-nwsmtp-smtp-production-main-19.sas.yp-c.yandex.net; dkim=pass header.i=@brilhante.top From: Daniel Cerqueira To: bug-gnu-emacs@gnu.org Subject: 29.1; Include Atom feed reader X-Debbugs-Package: emacs,gnus Date: Sun, 24 Sep 2023 19:40:56 +0100 Message-ID: <87fs33s9c7.fsf@brilhante.top> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a02:6b8:c03:500:1:45:d181:d100; envelope-from=dan.list@brilhante.top; helo=forward100c.mail.yandex.net X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.001, FROM_SUSPICIOUS_NTLD_FP=1.999, PDS_OTHER_BAD_TLD=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 3.0 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Gnus has support to read RSS feeds. Can you guys add support to also read Atom feeds in Gnus? May import some code from elfeed.el on this year's Hackoberfest? Thanks :-) Content analysis details: (3.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: brilhante.top (top)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD 2.0 FROM_SUSPICIOUS_NTLD_FP From abused NTLD X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 25 Sep 2023 03:14:26 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Gnus has support to read RSS feeds. Can you guys add support to also read Atom feeds in Gnus? May import some code from elfeed.el on this year's Hackoberfest? Thanks :-) From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 25 05:22:45 2023 Received: (at 66188) by debbugs.gnu.org; 25 Sep 2023 09:22:45 +0000 Received: from localhost ([127.0.0.1]:44199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkhnh-0008L6-FN for submit@debbugs.gnu.org; Mon, 25 Sep 2023 05:22:45 -0400 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:55750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkhne-0008Kl-7h for 66188@debbugs.gnu.org; Mon, 25 Sep 2023 05:22:44 -0400 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-50309daf971so9418924e87.3 for <66188@debbugs.gnu.org>; Mon, 25 Sep 2023 02:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695633744; x=1696238544; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=ti0uRZE9Fec9KvUePR7Is8cwoI0wlpovSW6RUDcvbE0=; b=CGxJFh6UlJgnu2xRrhK79xwNONt8Rg1hi521S4suFdV72hhXpYyUI2D+iNGucrCHHA G6mYzyfJYjIzMKvXTDKLqzIPUfDMp1pvnq33qGFnuExoPF1uPb9/Z0G3ay30LC6YDaV8 RnJdK1zckE7cILD3opScivUQI4B/eD1norfWUgzA/ozRwyjVDoKqM9rLeml58OOD66FK EO+Furk6dShNZB46/YWc8WWoFDBssU+Z8VQ+UiRIb86nQYmthFnuKvvwCBLxA4WLweuv HtCPzDx3sHwBAvNPeUzEZsAhqZr5DiKoKAO0g3McMfEDzwm26WAlGvFQQFWzhxYZ2miH vFKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695633744; x=1696238544; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ti0uRZE9Fec9KvUePR7Is8cwoI0wlpovSW6RUDcvbE0=; b=AEeTTgoKdvzPDaeg79oWlhrj+xgxB11iDHKnqtFFTh75G6IJm4taRfa42KvpEVF1CP 58jg5b6py7qw8XlL9IAuFGDXjXXJKg1R/vt6QLfFisgIjM+tGXDrFWPnC0Dgqdppj27j 1J2aYHQrizhMvxW4FXRjF3zh+No52DonThOYl/PJPbwRKolGLYF23YjvM7liFW2U13Do uy7SZPyvk4qMsUSLAb7h5KVnXpziiCGKtFujdIVqydgziCt2eHpZ5rVZ/ey6OGxsel1S dCnLzKbltcmuSa0nSJ64r8oyodj6XrYdIiuvasE9aWinR9o+c/GMu+ITVSwxH7J8I9lA c3Ng== X-Gm-Message-State: AOJu0YyEc+oOHjZ/LbyZaKe6N9my0Ul4A6oJomwuyqPiP0MlVs4JBCp8 9MwgJ8mMRHzAEw94x+u/EBO9A0XUgYQpW7DipqbgBHem X-Google-Smtp-Source: AGHT+IH8gl5p4Hc60o1+UC2g6/pI8aQauG5zP9+q4F3cjyheMplPi0eZ88eeexyaxCNIILBipQgzIeaxmIKmiYbWKCQ= X-Received: by 2002:a19:f806:0:b0:503:a82:b379 with SMTP id a6-20020a19f806000000b005030a82b379mr4249667lff.12.1695633743712; Mon, 25 Sep 2023 02:22:23 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 25 Sep 2023 02:22:23 -0700 From: Stefan Kangas In-Reply-To: <87fs33s9c7.fsf@brilhante.top> (Daniel Cerqueira's message of "Sun, 24 Sep 2023 19:40:56 +0100") References: <87fs33s9c7.fsf@brilhante.top> MIME-Version: 1.0 Date: Mon, 25 Sep 2023 02:22:23 -0700 Message-ID: Subject: Re: bug#66188: 29.1; Include Atom feed reader To: Daniel Cerqueira Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66188 Cc: 66188@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) forcemerge 64202 66188 thanks Daniel Cerqueira writes: > Gnus has support to read RSS feeds. Can you guys add support to also > read Atom feeds in Gnus? > > May import some code from elfeed.el on this year's Hackoberfest? > > Thanks :-) This is a duplicate of Bug#64202, so I'm merging them. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 25 05:31:08 2023 Received: (at control) by debbugs.gnu.org; 25 Sep 2023 09:31:08 +0000 Received: from localhost ([127.0.0.1]:44226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkhvo-0002oC-Ev for submit@debbugs.gnu.org; Mon, 25 Sep 2023 05:31:08 -0400 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]:55383) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkhvm-0002hk-7p for control@debbugs.gnu.org; Mon, 25 Sep 2023 05:31:07 -0400 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2b9338e4695so97717101fa.2 for ; Mon, 25 Sep 2023 02:30:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695634248; x=1696239048; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=KB4d7U9JInj89zc9rMnRRUcNcmltSX1rBw3w6snx9D0=; b=d3a4ppDs7EsR3DfzSY9obHS24LBqPgFJjJUTlmHVUB+bHvrQF/R51CxlBQlYuJpzMz 3QtPHmUkmRoe7uHjRK2s36/jumdQWrmv/XYXboghX25N+EWi9l9pW7eGN69S+cly/p7R NRqWIPRATPUnt0yTel3Xl+/zxl5UU6t0KjkMfcH68KReFicQDJ5L2zQMPj/pqX7ZTA7m XHWr6IX0euqr5tUAoGHoJ2c95XVtWq86F/p8XWNqX6ivm+KFjJmHS9+GhrzMibJ9vSKI ilVOLpKsrA8DBEmi1uqESuN07Jt85YXqDi/piKeN3b2eUwqNRrLr2uvD0pVIaMpGSd3O b13w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695634248; x=1696239048; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=KB4d7U9JInj89zc9rMnRRUcNcmltSX1rBw3w6snx9D0=; b=chzDYXd/VnIW0SY1LJN0+MPOTVyeQ0Lg8ZExAQ1Vpa7Y915+mhTJtxMFEoVJmMw89Q Ehm5uHxt1n18MN/jIcILKSlPmOGe01j92dFb32VyvkH4y0tc6caLtsmsgv4m4+wuYW1D wl2sX/3ZmEt3wgVRwhT0TNEvtnviGNZkv7wjuznckmdVX2NM0vkC1UXjhdGlgAU6jLtB g+aKhjNJdFFChOFnYNApF+OBHLTKTl2gyLSoQXIi1HkgfKyzdCeXpp8yz+Zxpej7FuP6 MDCjzs7Cjd77g/vF52JspvJ4A1LpVfIk9EqKg1L15tzz3ynuS84EkIfKgz8oR+AtSi7O 6UAg== X-Gm-Message-State: AOJu0Yxn1dRfkUJRf+jE3JMCAh83dKT5ZXlyOLHTMhVummYM3+WM8jsL i+U3b7UVyd1/BEbHhR/UMQ0mMPdhqt+AeihlaoCTqtwD X-Google-Smtp-Source: AGHT+IF+AvKWIwh6nD7BVEUSuS1D7akjhzpcyc1pquj4E5gdaQkxRlH0+MBGqquuKFzzsoWYN6KwwnmGuDN1ms4yV2Q= X-Received: by 2002:a2e:9652:0:b0:2bc:b0ae:a9e5 with SMTP id z18-20020a2e9652000000b002bcb0aea9e5mr5440466ljh.42.1695634247736; Mon, 25 Sep 2023 02:30:47 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 25 Sep 2023 02:30:47 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Mon, 25 Sep 2023 02:30:47 -0700 Message-ID: Subject: control message for bug #64202, #66188 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) reassign 64202 emacs,gnus forcemerge 64202 66188 thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 07 12:57:03 2024 Received: (at 66188) by debbugs.gnu.org; 7 Feb 2024 17:57:03 +0000 Received: from localhost ([127.0.0.1]:57880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXmAR-0004n5-Am for submit@debbugs.gnu.org; Wed, 07 Feb 2024 12:57:03 -0500 Received: from dsemy.com ([46.23.89.208]:37392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXmAO-0004mT-RP; Wed, 07 Feb 2024 12:57:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=dkim; bh=A3GJmAaq/Rm/F 3JW8x/olG/accZhcW3D5Mzdx95UA4s=; h=date:references:in-reply-to: subject:cc:to:from; d=dsemy.com; b=sO7uoTYmrq3kZMIWYfSWySBQCu/AlHdZiB2 Un1HOs/SHexmhZLYuEq3L2nEDM417titsVkPQfLx6Ip6K4BO7w2DmJjkHjbyUfrPWvEdeU ex2wT4/FCdhIOhSWWvAY0nxnXoqFbVR2Y//KnIZJPjzcYdV+/9AwtOnIrqQGlKuxXUIrrl KDMOPFIJxMSv/DUp/p9XKdnBM0Kgtj+V/AO5aaDgU8to0rc1RZbsQVEmW6eziwId6z6xPb DYdsfhAkeqIlh5w1GO0IRReYaUh4qdVfWSLzWk9rxY1SyFPOGLZatwx7qTsbvvs/w1kHtY Czy+cZSlSbY4/FomRC1jhopijvg== Received: from coldharbour.local ( [147.235.218.19]) by dsemy.com (OpenSMTPD) with ESMTPSA id 52c2ee42 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 7 Feb 2024 18:56:39 +0100 (CET) Received: from localhost (coldharbour.local [local]) by coldharbour.local (OpenSMTPD) with ESMTPA id 8cce0e2e; Wed, 7 Feb 2024 17:49:26 +0000 (UTC) From: Daniel Semyonov To: James Thomas Subject: Re: bug#66188: 29.1; Include Atom feed reader In-Reply-To: <87h6io5rr5.fsf@dsemy.com> (Daniel Semyonov's message of "Sun, 04 Feb 2024 14:38:22 +0200") References: <87v8fhmgvw.fsf@dsemy.com> <8734wcfynr.fsf@dsemy.com> <87wmtnbptm.fsf@dsemy.com> <87zfyj8ojz.fsf@dsemy.com> <87ttohxc56.fsf@dsemy.com> <87le83hcm8.fsf@outlook.com> <87h6io5rr5.fsf@dsemy.com> Date: Wed, 07 Feb 2024 19:49:26 +0200 Message-ID: <87r0hof9ll.fsf_-_@dsemy.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 3.5 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: >>>>> Daniel Semyonov writes: > I the issue is that your locale's "preferred clock" is a 12 hour > clock and I didn't realize that I need to also add "%p" to the > format string to show the locale's version of "AM" or "PM" (or > [...] Content analysis details: (3.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [147.235.218.19 listed in zen.spamhaus.org] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 66188 Cc: 66188@debbugs.gnu.org, 64202@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: >>>>> Daniel Semyonov writes: > I the issue is that your locale's "preferred clock" is a 12 hour > clock and I didn't realize that I need to also add "%p" to the > format string to show the locale's version of "AM" or "PM" (or > [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [147.235.218.19 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager >>>>> Daniel Semyonov writes: > I the issue is that your locale's "preferred clock" is a 12 hour > clock and I didn't realize that I need to also add "%p" to the > format string to show the locale's version of "AM" or "PM" (or > nothing). > I'll push a fix soon. I've pushed a commit which turns the displayed date format into a user option (and fixes the default value, and uses a simple date format when it isn't displayed). From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 18 12:59:14 2024 Received: (at 66188) by debbugs.gnu.org; 18 Mar 2024 16:59:14 +0000 Received: from localhost ([127.0.0.1]:33316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rmGKL-0005iL-0a for submit@debbugs.gnu.org; Mon, 18 Mar 2024 12:59:14 -0400 Received: from dsemy.com ([46.23.89.208]:30792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rmGKH-0005hd-Bz; Mon, 18 Mar 2024 12:59:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=dkim; bh=/p7VccguQeLqf dYtBvHGP7IcP1uuKQLj9jnPJKbnlEw=; h=date:references:in-reply-to: subject:cc:to:from; d=dsemy.com; b=JI3oQY2/yfFMkmOI37r0M4Rp5yLd4bwqZhn gVJegk0+t794MnMUZe/iJ5Y70qvEihB9GaBKoI9cWw69ZsmzUp/WZ630F6sGziS8zRfaIL W10myEBuSQ3NL4reTYY3tA6NT8GjDYnCwOjm5R6OEP+Tj+su4RjUZ6R1i2h8o4UO/ilftL rCT/U1HaU2cAgbVchKX4MNhXYf3ITJq4/iHmyD9YqaXVKfbJzHpUAgsjpvOCpQMwKlyj6x K4XPQnWH4+3jt8CStSdV6MayBDu6CqJkXRij2XRvl0CH/yWjX8O9SlMjXSGswj9RjVFwI/ UdEGSRzVchsfYG2lzT3io0AcOkg== Received: from coldharbour.local ( [147.235.219.6]) by dsemy.com (OpenSMTPD) with ESMTPSA id 8fe02efb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 18 Mar 2024 17:58:18 +0100 (CET) Received: from localhost (coldharbour.local [local]) by coldharbour.local (OpenSMTPD) with ESMTPA id 40f45283; Mon, 18 Mar 2024 16:58:06 +0000 (UTC) From: Daniel Semyonov To: James Thomas Subject: Re: bug#66188: 29.1; Include Atom feed reader In-Reply-To: <87sf1eh53p.fsf@dsemy.com> (Daniel Semyonov's message of "Tue, 27 Feb 2024 07:02:34 +0200") References: <87v8fhmgvw.fsf@dsemy.com> <87wmtnbptm.fsf@dsemy.com> <87zfyj8ojz.fsf@dsemy.com> <87ttohxc56.fsf@dsemy.com> <87le83hcm8.fsf@outlook.com> <87h6io5rr5.fsf@dsemy.com> <87r0hof9ll.fsf_-_@dsemy.com> <87jznfpom1.fsf@gmx.net> <874jejb2sg.fsf@dsemy.com> <87fry2pa1n.fsf@gmx.net> <87ttmhwxby.fsf@dsemy.com> <87wmrd9zcy.fsf@outlook.com> <875xyx5ksi.fsf@dsemy.com> <87sf219ntf.fsf@gmx.net> <87msrtkztg.fsf@outlook.com> <87ttm0mnku.fsf@dsemy.com> <87o7c7b0yf.fsf@dsemy.com> <87le79yl11.fsf@gmx.net> <87sf1eh53p.fsf@dsemy.com> Date: Mon, 18 Mar 2024 18:58:06 +0200 Message-ID: <87ttl3wk81.fsf_-_@dsemy.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 3.6 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I pushed a few more commits (an updated patch is attached) which fix some edge cases with ephemeral groups and simplify some functions. Daniel From 43f22a60a33536cfcfdec30457123d455d027159 Mon Sep 17 00:00:00 2001 From: Daniel Semyonov Date: Wed, 21 Jun 2023 10:05:04 +0300 Subject: [PATCH] Gnus: Add back end for Atom feeds [...] Content analysis details: (3.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [147.235.219.6 listed in zen.spamhaus.org] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines -0.0 T_SCC_BODY_TEXT_LINE No description available. 0.0 T_FILL_THIS_FORM_SHORT Fill in a short form with personal information X-Debbugs-Envelope-To: 66188 Cc: Eric Abrahamsen , 66188@debbugs.gnu.org, 64202@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I pushed a few more commits (an updated patch is attached) which fix some edge cases with ephemeral groups and simplify some functions. Daniel From 43f22a60a33536cfcfdec30457123d455d027159 Mon Sep 17 00:00:00 2001 From: Daniel Semyonov Date: Wed, 21 Jun 2023 10:05:04 +0300 Subject: [PATCH] Gnus: Add back end for Atom feeds [...] Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [147.235.219.6 listed in zen.spamhaus.org] 0.0 T_SPF_TEMPERROR SPF: test of record failed (temperror) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain I pushed a few more commits (an updated patch is attached) which fix some edge cases with ephemeral groups and simplify some functions. Daniel --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Gnus-Add-back-end-for-Atom-feeds-nnatom.patch Content-Description: patch >From 43f22a60a33536cfcfdec30457123d455d027159 Mon Sep 17 00:00:00 2001 From: Daniel Semyonov Date: Wed, 21 Jun 2023 10:05:04 +0300 Subject: [PATCH] Gnus: Add back end for Atom feeds (nnatom) * lisp/gnus/gnus.el (gnus-valid-select-methods): Add entry for nnatom. * lisp/gnus/nnfeed.el: New file implementing an abstract web feed back end. * lisp/gnus/nnatom.el: New file implementing a back end for Atom feeds. * doc/misc/gnus.texi (Browsing the Web, Back End Interface): * etc/NEWS (Gnus): Document nnatom and nnfeed. --- doc/misc/gnus.texi | 73 +++++ etc/NEWS | 10 + lisp/gnus/gnus.el | 1 + lisp/gnus/nnatom.el | 276 ++++++++++++++++++ lisp/gnus/nnfeed.el | 683 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 1043 insertions(+) create mode 100644 lisp/gnus/nnatom.el create mode 100644 lisp/gnus/nnfeed.el diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 419a5390374..49a85576a37 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -715,6 +715,7 @@ Top * Web Searches:: Creating groups from articles that match a string. * RSS:: Reading RDF site summary. +* Atom:: Reading Atom Syndication Format feeds. Other Sources @@ -975,6 +976,7 @@ Top * Writing New Back Ends:: Extending old back ends. * Hooking New Back Ends Into Gnus:: What has to be done on the Gnus end. * Mail-like Back Ends:: Some tips on mail back ends. +* Web Feed Back Ends:: Easily defining back ends for web feeds. Various File Formats @@ -17252,6 +17254,7 @@ Browsing the Web @menu * Web Searches:: Creating groups from articles that match a string. * RSS:: Reading RDF site summary. +* Atom:: Reading Atom Syndication Format feeds. @end menu The main caveat with all these web sources is that they probably won't @@ -17496,6 +17499,40 @@ RSS @end lisp +@node Atom +@subsection Atom +@cindex nnatom +@cindex Atom + +Some web sites provide an Atom Syndication Format feed. Atom is a web +feed format similar in function to RDF Site Summary (@pxref{RSS}). + +The @code{nnatom} back end allows you to add HTTP or local Atom feeds +as Gnus servers (with a single group), as you would with any other +method, by supplying the location of the feed as the server address. +Note, however, that the server address shouldn't be prefixed with +@url{http://} or @url{https://}. + +Features of @code{nnatom} include: + +@itemize @bullet + +@item +Server data is saved per-server in the @file{atom} sub-directory of +@file{gnus-directory}. + +@item +An article part is generated for both the summary and the content for +each entry in the feed. Content of all MIME types should be displayed +correctly through Gnus (as long as they are supported and the feed +specifies a MIME type). + +@item +Article modification and publish dates are tracked, and articles are +updated if changed. + +@end itemize + @node Other Sources @section Other Sources @@ -29997,6 +30034,7 @@ Back End Interface * Writing New Back Ends:: Extending old back ends. * Hooking New Back Ends Into Gnus:: What has to be done on the Gnus end. * Mail-like Back Ends:: Some tips on mail back ends. +* Web Feed Back Ends:: Easily defining back ends for web feeds. @end menu @@ -30769,6 +30807,41 @@ Mail-like Back Ends ("some-group" (34 . 39))) @end example +@node Web Feed Back Ends +@subsection Web Feed Back Ends + +If you want to write a back end for a new type of web feed (RSS, +Atom), or some other type of feed, an ``abstract'' back end +(@code{nnfeed}) exists to enable the creation of such back ends with +minimal knowledge of Gnus. + +@code{nnfeed} defines a generic parser, which uses functions stored in +server variables to parse information from a feed (@code{nnfeed} +itself doesn't actually define any such functions though). + +The data parsed from the feed is stored in server variables (and +stored per-feed in a sub-directory of @option{gnus-directory} whose name +corresponds to the name of the back end). + +A Gnus back end interface is also defined, which uses the data parsed +from the feed. + +Therefore, a new back end only needs to inherit from @code{nnfeed}, +define (fairly) generic parsing functions for the feed type and setup +the required server variables. + +@code{nnfeed} was originally created to support Atom Syndication +Format feeds (@pxref{Atom}), but is very generic (as of writing this, +no standard web feed exists which can meaningfully use all the +features supported): it supports multiple groups contained in a single +feed, it allows for situations when the entire feed can't (or +shouldn't) be read ahead of time and it allows for very advanced +customization of the actual printing of articles from parsed data +(while providing a reasonably powerful default method). + +Further implementation details are available in the documentation +strings of the various @code{nnfeed-*} server variables and +the commentary and other comments of @file{nnfeed.el}. @node Score File Syntax @subsection Score File Syntax diff --git a/etc/NEWS b/etc/NEWS index 69e61d91b0e..ecf06015829 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1190,6 +1190,16 @@ This keyword enables the user to install packages using 'package-vc'. ** Gnus ++++ +*** New back end 'nnfeed'. +This allows back end developers to easily create new back ends for web +feeds, as inheriting back ends of 'nnfeed'. + ++++ +*** New back end 'nnatom'. +This allow users to add Atom Syndication Format feeds to Gnus as +servers. + *** The 'nnweb-type' option 'gmane' has been removed. The gmane.org website is, sadly, down since a number of years with no prospect of it coming back. Therefore, it is no longer valid to set diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index dab66b60205..bc8819dc967 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -1360,6 +1360,7 @@ gnus-valid-select-methods ("nnimap" post-mail address prompt-address physical-address respool server-marks cloud) ("nnmaildir" mail respool address server-marks) + ("nnatom" address) ("nnnil" none)) "An alist of valid select methods. The first element of each list lists should be a string with the name diff --git a/lisp/gnus/nnatom.el b/lisp/gnus/nnatom.el new file mode 100644 index 00000000000..e8dfa12aff5 --- /dev/null +++ b/lisp/gnus/nnatom.el @@ -0,0 +1,276 @@ +;;; nnatom.el --- Atom backend for Gnus -*- lexical-binding: t -*- + +;; Copyright (C) 2023 Free Software Foundation, Inc. +;; Author: Daniel Semyonov + +;; This file is part of GNU Emacs. + +;; nnatom 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. + +;; nnatom 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 nnatom. If not, see . + +;;; Commentary: + +;; Gnus backend for HTTP or local feeds following the +;; Atom Syndication Format . + +;;; Code: + +(eval-when-compile + (require 'cl-lib) + (require 'subr-x)) + +(require 'nnfeed) +(require 'mm-url) +(require 'dom) + +(defgroup nnatom nil + "Atom backend for Gnus." + :group 'nnfeed) + +(nnoo-declare nnatom nnfeed) + +(nnfeed-define-basic-backend-interface nnatom) + +;;;; Atom feed parser: + +(defun nnatom--read-feed (feed _) + "Return a list structure representing FEED, or nil." + (if (string-match-p "\\`https?://" feed) + (nnheader-report + nnatom-backend + "Address shouldn't start with \"http://\" or \"https://\"") + (with-temp-buffer + (condition-case e + (if (file-name-absolute-p feed) + (insert-file-contents feed) + (mm-url-insert-file-contents (concat "https://" feed))) + (file-error (nnheader-report nnatom-backend (cdr e))) + (:success (when-let ((data (if (libxml-available-p) + (libxml-parse-xml-region + (point-min) (point-max)) + (car (xml-parse-region + (point-min) (point-max))))) + (authors (list 'authors))) + (when (eq (car data) 'top) + (setq data (assq 'feed data))) + (dom-add-child-before data authors) + (let ((all (dom-children data))) + (while-let ((rest (cdr all)) + (child (car-safe rest)) + (type (car-safe child)) + ((not (eq type 'entry)))) + (and (or (eq type 'author) + (eq type 'contributor)) + (dom-add-child-before authors child)) + (setq all rest)) + ;; Order of entries is reversed as most Atom feeds + ;; list only the "most recent" entries, in reverse + ;; chronological order. + (setcdr all (nreverse (cdr all)))) + data)))))) +(defvoo nnatom-read-feed-function #'nnatom--read-feed + nil nnfeed-read-feed-function) + +(defun nnatom--read-group (data) + "Return the next group and the remaining DATA in a cons cell, or nil." + `(,data)) +(defvoo nnatom-read-group-function #'nnatom--read-group + nil nnfeed-read-group-function) + +(defun nnatom--read-article (data _) + "Return the next article and the remaining DATA in a cons cell, or nil." + (when (eq (car data) 'feed) (setq data (dom-children data))) + ;; Discard any children between/after entries. + (while (and data (not (eq (car-safe (car data)) 'entry))) (pop data)) + (when-let ((article (car data)) + (auths (list 'authors)) (links (list 'links))) + (dom-add-child-before article links) + (dom-add-child-before article auths) + (dolist (child (cddddr article) `(,article . ,(cdr data))) + (pcase (car-safe child) ; Authors and links can appear + ((or 'author 'contributor) ; anywhere in the entry so we + (dom-add-child-before auths child) ; collect them all here to + (dom-add-child-before links child)) ; avoid looping over the + ((or 'link ; entry multiple times later. + (and 'content (guard (assq 'src (dom-attributes child))))) + (dom-add-child-before links child)))))) +(defvoo nnatom-read-article-function #'nnatom--read-article + nil nnfeed-read-article-function) + +(defun nnatom--read-title (group) + "Return the title of GROUP, or nil." + (dom-text (dom-child-by-tag group 'title))) +(defvoo nnatom-read-title-function #'nnatom--read-title + nil nnfeed-read-title-function) + +(defun nnatom--read-description (group) + "Return the description of GROUP, or nil." + (dom-text (dom-child-by-tag group 'subtitle))) +(defvoo nnatom-read-description-function #'nnatom--read-description + nil nnfeed-read-description-function) + +(defun nnatom--read-article-or-group-authors (article-or-group) + "Return the authors of ARTICLE-OR-GROUP, or nil." + (when-let + ((a (mapconcat + (lambda (author) + (let* ((name (dom-text (dom-child-by-tag author 'name))) + (name (unless (string-blank-p name) name)) + (email (dom-text (dom-child-by-tag author 'email))) + (email (unless (string-blank-p email) email))) + (or (and name email (format "%s <%s>" name email)) name email))) + (dom-children (dom-child-by-tag article-or-group 'authors)) + ", ")) + ((not (string-blank-p a)))) + a)) +(defvoo nnatom-read-author-function #'nnatom--read-article-or-group-authors + nil nnfeed-read-author-function) +(defvoo nnatom-read-group-author-function + #'nnatom--read-article-or-group-authors + nil nnfeed-read-group-author-function) + +(defun nnatom--read-subject (article) + "Return the subject of ARTICLE, or nil." + (dom-text (dom-child-by-tag article 'title))) +(defvoo nnatom-read-subject-function #'nnatom--read-subject + nil nnfeed-read-subject-function) + +(defun nnatom--read-id (article) + "Return the ID of ARTICLE. +If the ARTICLE doesn't contain an ID but it does contain a subject, +return the subject. Otherwise, return nil." + (or (dom-text (dom-child-by-tag article 'id)) + (nnatom--read-subject article))) +(defvoo nnatom-read-id-function #'nnatom--read-id + nil nnfeed-read-id-function) + +(defun nnatom--read-publish (article) + "Return the date and time ARTICLE was published, or nil." + (when-let (d (dom-child-by-tag article 'published)) + (date-to-time (dom-text d)))) +(defvoo nnatom-read-publish-date-function #'nnatom--read-publish + nil nnfeed-read-publish-date-function) + +(defun nnatom--read-update (article) + "Return the date and time of the last update to ARTICLE, or nil." + (when-let (d (dom-child-by-tag article 'updated)) + (date-to-time (dom-text d)))) +(defvoo nnatom-read-update-date-function #'nnatom--read-update + nil nnfeed-read-update-date-function) + +(defun nnatom--read-links (article) + "Return all links contained in ARTICLE, or nil." + (let ((alt 0) (rel 0) (sel 0) (enc 0) (via 0) (aut 0)) + (mapcan + (lambda (link) + (when-let ((l (car-safe link))) + (or + (when-let (((eq l 'content)) + (src (dom-attr link 'src)) + (label (concat "Link" + (and (< 1 (cl-incf alt)) + (format " %s" alt))))) + `(((("text/plain") . ,(format "%s: %s\n" label src)) + (("text/html") . ,(format "[%s] " + src label))))) + (when-let (((or (eq l 'author) (eq l 'contributor))) + (name (dom-text (dom-child-by-tag link 'name))) + (name (if (string-blank-p name) + (concat "Author" + (and (< 1 (cl-incf aut)) + (format " %s" aut))) + name)) + (uri (dom-text (dom-child-by-tag link 'uri))) + ((not (string-blank-p uri)))) + `(((("text/plain") . ,(format "%s: %s\n" name uri)) + (("text/html") . ,(format "[%s] " + uri name))))) + (when-let (((eq l 'link)) + (attrs (dom-attributes link)) + (label (or (cdr (assq 'title attrs)) + (pcase (cdr (assq 'rel attrs)) + ("related" + (concat "Related" + (and (< 1 (cl-incf rel)) + (format " %s" rel)))) + ("self" + (concat "More" + (and (< 1 (cl-incf sel)) + (format " %s" sel)))) + ("enclosure" + (concat "Enclosure" + (and (< 1 (cl-incf enc)) + (format " %s" enc)))) + ("via" + (concat "Source" + (and (< 1 (cl-incf via)) + (format " %s" via)))) + (_ (if-let + ((lang (cdr (assq 'hreflang link)))) + (format "Link (%s)" lang) + (concat + "Link" + (and (< 1 (cl-incf alt)) + (format " %s" alt)))))))) + (link (cdr (assq 'href attrs)))) + `(((("text/plain") . ,(format "%s: %s\n" label link)) + (("text/html") . ,(format "[%s] " + link label)))))))) + (dom-children (dom-child-by-tag article 'links))))) +(defvoo nnatom-read-links-function #'nnatom--read-links + nil nnfeed-read-links-function) + +(defun nnatom--read-part (part type) + (let* ((atypes '("html" "plain")) + (mtypes '(("xhtml" . "text/html") ("text" . "text/plain"))) + (xsuff (concat "[+/]xml\\(-\\(dtd\\|external-parsed-entity\\)\\)?\\'" + "\\|^text")) + (part (if (string= type "xhtml") + (with-temp-buffer + (dom-print (dom-child-by-tag part 'div) nil t) + (buffer-substring-no-properties + (point-min) (point-max))) + (dom-text part))) + (type (if (member type atypes) (concat "text/" type) type)) + (type (or (cdr (assoc type mtypes)) type))) + (unless (string-blank-p part) + `(,part (Content-Type . ,(or type (setq type "text/plain"))) + ,(and (not (string-match-p xsuff type)) + '(Content-Transfer-Encoding . "base64")))))) + +(defun nnatom--read-parts (article) + "Return all parts contained in ARTICLE, or an empty HTML part with links." + (let* ((summary (dom-child-by-tag article 'summary)) + (stype (cdr (assq 'type (dom-attributes summary)))) + (summary (nnatom--read-part summary stype)) + (content (dom-child-by-tag article 'content)) + (ctype (cdr (assq 'type (dom-attributes content)))) + (content (nnatom--read-part content ctype)) + (st (string= stype ctype)) + parts) + (cond ((and summary content) + (and st (push summary parts)) + (push (append content '(links)) parts) + (or st (push summary parts))) + ((setq content (or summary content)) + (push (append content '(links)) parts)) + (t (push '((nil (Content-Type . "text/html") links)) parts))) + parts)) +(defvoo nnatom-read-parts-function #'nnatom--read-parts + nil nnfeed-read-parts-function) + +(gnus-declare-backend (symbol-name nnatom-backend) 'address) + +(provide 'nnatom) + +;;; nnatom.el ends here diff --git a/lisp/gnus/nnfeed.el b/lisp/gnus/nnfeed.el new file mode 100644 index 00000000000..3a1b22f2a2f --- /dev/null +++ b/lisp/gnus/nnfeed.el @@ -0,0 +1,683 @@ +;;; nnfeed.el --- Generic feed backend for Gnus -*- lexical-binding: t -*- + +;; Copyright (C) 2023 Free Software Foundation, Inc. +;; Author: Daniel Semyonov + +;; This file is part of GNU Emacs. + +;; nnfeed 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. + +;; nnfeed 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 nnfeed. If not, see . + +;;; Commentary: + +;; Generic Gnus backend (intended) for implementing backends for web +;; feeds (Atom, RSS). +;; +;; This backend is abstract - it doesn't implement a parser for any +;; specific web feed type, and so can't be used independently. +;; +;; Instead, it implements a generic parser, feed data storage and most +;; of the Gnus backend interface; the intended use for this backend is +;; to be a source of inheritance for backends supporting new web feed +;; types. +;; +;; To implement new backends, use `nnfeed-define-basic-backend-interface': +;; +;; ... +;; (require 'nnfeed) +;; +;; (nnoo-declare nnfoo nnfeed) +;; +;; (nnfeed-define-basic-backend-interface nnfoo) +;; ... +;; [ definitions of parsing functions, see the "Feed parser interface" +;; section for more information. ] +;; +;; (defvoo nnfoo-read-feed-function #'nnfoo--read-feed +;; nil nnfeed-read-feed-function) +;; ... +;; (gnus-declare-backend (symbol-name nnfeed-backend) 'address) +;; +;; (provide 'nnfoo) +;; +;;; Code: + +(eval-when-compile + (require 'subr-x)) + +(require 'gnus) +(require 'nnoo) + +(defgroup nnfeed nil + "Generic feed backend for Gnus." + :group 'gnus) + +(defcustom nnfeed-date-format "%F %X%p" + "Format of displayed dates (see function `format-time-string')." + :type 'string) + +(nnoo-declare nnfeed) + +(defvoo nnfeed-backend nil + "Symbol which identifies this backend.") + +(defvoo nnfeed-status-string nil + "Last status message reported by this backend.") + +;; This macro should be used to define inheriting backends. + +(defmacro nnfeed-define-basic-backend-interface (backend) + "Define a basic set of functions and variables for BACKEND." + `(progn + (defvoo ,(nnoo-symbol backend 'backend) ',backend nil nnfeed-backend) + (defvoo ,(nnoo-symbol backend 'status-string) + nil nil nnfeed-status-string) + (defvoo ,(nnoo-symbol backend 'group) nil nil nnfeed-group) + (defvoo ,(nnoo-symbol backend 'servers) + (make-hash-table :test 'equal) nil nnfeed-servers) + (defvoo ,(nnoo-symbol backend 'group-article-ids) + (make-hash-table :test 'equal) nil nnfeed-group-article-ids) + (defvoo ,(nnoo-symbol backend 'group-articles) + (make-hash-table :test 'eql) nil nnfeed-group-articles) + (defvoo ,(nnoo-symbol backend 'group-article-max-num) 0 nil + nnfeed-group-article-max-num) + (defvoo ,(nnoo-symbol backend 'group-article-mix-num) 1 nil + nnfeed-group-article-min-num) + ,@(mapcar (lambda (fun) + `(deffoo ,(nnoo-symbol backend fun) (&optional server) + (,(nnoo-symbol 'nnoo fun) ',backend server))) + '(server-opened status-message)) + (deffoo ,(nnoo-symbol backend 'open-server) (server &optional defs) + (nnfeed-open-server server defs ',backend)) + (nnoo-import ,backend (nnfeed)))) + +;;;; Feed parser interface: + +;; The following set of server variables define a parser for a +;; specific web feed type. +;; An inheriting backend doesn't necessarily have to define all of +;; these functions (see the comments below for more information). +;; Apart from this set of variables there is also +;; `nnfeed-print-content-function' which can optionally be defined +;; by an inheriting backend to allow more advanced control over the +;; printing of articles. + +(defvoo nnfeed-read-feed-function #'ignore + "Function returning a Lisp object representing a feed (or part of it). + +It should accept two arguments, the address of a feed and the name of +a group (or nil). +If a group name is supplied, it should return a representation of only +the group (as if it was extracted from the feed with +`nnfeed-read-group-function').") + +(defvoo nnfeed-read-group-function #'ignore + "Function returning a cons cell of a group and remaining data from a feed. + +The returned group can be represented by any Lisp object. +It should accept a single argument, a Lisp object representing a feed +\(as can be returned by this function or `nnfeed-read-feed-function').") + +(defvoo nnfeed-read-article-function #'ignore + "Function returning a cons cell of an article and remaining data from a group. + +The returned article can be represented by any Lisp object. +It should accept two arguments, a Lisp object representing a group +\(as can be returned by this function or `nnfeed-read-group-function'), +and a flag indicating whether the last article was not new or updated.") + +(defvoo nnfeed-read-title-function #'ignore + "Function returning the title of a group (a string). + +It should accept a single argument, a Lisp object representing a group +\(as returned by `nnfeed-read-group-function').") + +;; Optional. +(defvoo nnfeed-read-description-function #'ignore + "Function returning the description of a group (a string), or nil. + +It should accept a single argument, a Lisp object representing a group +\(as returned by `nnfeed-read-group-function').") + +;; Either this function or `nnfeed-read-author-function' is required. +(defvoo nnfeed-read-group-author-function #'ignore + "Function returning the author of a group (a string), or nil. + +It should accept a single argument, a Lisp object representing a group +\(as returned by `nnfeed-read-group-function')..") + +(defvoo nnfeed-read-id-function #'ignore + "Function returning the ID of an article. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +(defvoo nnfeed-read-subject-function #'ignore + "Function returning the subject of an article (a string), or nil. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;; Either this function or `nnfeed-read-update-date-function' is required. +(defvoo nnfeed-read-publish-date-function #'ignore + "Function returning the publish date of an article (a time value), or nil. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;; Either this function or `nnfeed-read-publish-date-function' is required. +(defvoo nnfeed-read-update-date-function #'ignore + "Function returning the update date of an article (a time value), or nil. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;; Either this function or `nnfeed-read-group-author-function' is required. +(defvoo nnfeed-read-author-function #'ignore + "Function returning the author of an article (a string), or nil. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +(defvoo nnfeed-read-headers-function #'ignore + "Function returning an alist of article-wide MIME headers. + +Each element of this alist maps a MIME header (a symbol, +i.e. `Content-Type') to its value. As a special case, `:boundary' +maps to a string which will serve as the boundary between article +parts. This must be supplied if a custom boundary is used in a +multipart content type header. The default boundary is \"-_nnfeed_-\", +and is automatically modified to match the name of the back end. +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;; As mentioned in their docstrings, the last two parsing functions +;; can optionally return any Lisp representation they want, provided +;; an appropriate `nnfeed-print-content-function' is defined. This +;; means they are also not _strictly_ required. + +(defvoo nnfeed-read-links-function #'ignore + "Function returning all links contained in an article. + +With the default `nnfeed-print-content-function', it should return a +list of links, where each link is an alist mapping MIME content types +to links formatted for display in a part of that type. Each content +type may also be a list of content types. +Otherwise, it could return any Lisp object. +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +(defvoo nnfeed-read-parts-function #'ignore + "Function returning an alist associating parts of an article to their headers. + +With the default `nnfeed-print-content-function', each part should be a +string. Otherwise, it can be any Lisp object. The \"headers\" of +each part should be a list where each element is either a cons of a +MIME header (a symbol, i.e. `Content-Type') and its value (a string), +or any other Lisp object. MIME headers will be printed, the rest will +be passed on to `nnfeed-print-content-function', which recognizes the +following extra data by default: +- `links', if present, will cause links to be printed in the part. +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;;;; Feed data storage: + +;; This section defines the data types used to store feed data, and +;; functions to read and write it. +;; All variables in this section are automatically defined by +;; `nnfeed-define-basic-backend-interface'. + +(defvoo nnfeed-servers (make-hash-table :test 'equal) + "Hash table mapping known servers to their groups. + +Each value in this table should itself be a hash table mapping known +group names to their data, which should be a vector of the form +[GROUP IDS ARTICLES MAX MIN DESCRIPTION], where: +- GROUP is the \"real\" group name (the name known to the server). +- IDS is a hash table mapping article IDs to their numbers. +- ARTICLES is a hash table mapping article numbers to articles and + their attributes (see `nnfeed-group-articles'). +- MAX is the maximum article number. +- MIN is the minimum article number. +- DESCRIPTION is the group description.") + +(defvoo nnfeed-group-names (make-hash-table :test 'equal) + "Hash table mapping real group names to their custom name.") + +(defun nnfeed--server-address (server) + "Return SERVER's real address." + (if (string-suffix-p "-ephemeral" server) + (setq server (or (cadr (assq (nnoo-symbol nnfeed-backend 'address) + (cddr (gnus-server-to-method + (concat + (symbol-name nnfeed-backend) ":" + server))))) + server)) + server)) + +(defun nnfeed--server-file (server) + "Return the file containing data for SERVER." + (expand-file-name (format "%s/%s.eld" + (string-trim (symbol-name nnfeed-backend) + "nn") + (gnus-newsgroup-savable-name + (nnfeed--server-address server))) + gnus-directory)) + +(defun nnfeed--read-server (server) + "Read SERVER's information from storage." + (if-let ((f (nnfeed--server-file server)) + ((file-readable-p f))) + (with-temp-buffer + (insert-file-contents f) + (goto-char (point-min)) + (puthash server (read (current-buffer)) nnfeed-servers)) + (nnheader-report nnfeed-backend "Can't read %s" server))) + +(defun nnfeed--write-server (server) + "Write SERVER's information to storage." + (if-let ((f (nnfeed--server-file server)) + ((file-writable-p f))) + (if-let ((s (gethash server nnfeed-servers)) + ((hash-table-p s))) + (with-temp-file f + (insert ";;;; -*- mode: lisp-data -*- DO NOT EDIT\n") + (prin1 s (current-buffer)) + (insert "\n") + t) + t) + (nnheader-report nnfeed-backend "Can't write %s" f))) + +;; The following function uses the parsing functions defined in the last +;; section to parse a feed (or just one group from it). +;; This is the only place where these parsing functions are used; the Gnus +;; backend interface extracts all required information from the parsed feed. + +(defun nnfeed--parse-feed (feed &optional group) + "Parse GROUP from FEED into a new or existing server. +If GROUP is omitted or nil, parse the entire FEED." + (let* ((feed (nnfeed--server-address feed)) + (s (or (gethash feed nnfeed-servers) (nnfeed--read-server feed) + (make-hash-table :test 'equal))) + (name group) ; (Maybe) fake name (or nil) + (group (aref (gethash group s `[,group]) 0)) ; Real name (or nil) + data) + (when (setq data (funcall nnfeed-read-feed-function feed group)) + (while-let ((cg (or (and name (cons data)) ; `data' is a single group + (funcall nnfeed-read-group-function data))) + (cg (prog1 (car cg) (setq data (cdr cg))))) + (let* ((name (funcall nnfeed-read-title-function cg)) ; Real name + (group (gethash name nnfeed-group-names name)) ; (Maybe) fake name + (info (gnus-get-info + (concat (symbol-name nnfeed-backend) "+" feed ":" group))) + (g (or (gethash group s) + `[ ,name ,(make-hash-table :test 'equal) + ,(make-hash-table :test 'eql) nil 1 ""])) + (desc (funcall nnfeed-read-description-function cg)) + (ids (aref g 1)) + (articles (aref g 2)) + (max (aref g 3)) + (max (if max max + (setq max 0) ; Find max article number + (dolist ; remembered by Gnus. + ( r (cons (gnus-info-read info) + (gnus-info-marks info)) + max) + (mapc (lambda (x) + (let ((x (if (consp x) + (if (< (car x) (cdr x)) + (cdr x) (car x)) + x))) + (when (< max x) (setq max x)))) + (if (symbolp (car r)) (cdr r) r))))) + (group-author (funcall nnfeed-read-group-author-function cg)) + stale) + (and desc (aset g 5 desc)) + (while-let ((article (funcall nnfeed-read-article-function cg stale)) + (article (prog1 (car article) (setq cg (cdr article))))) + (when-let ((id (funcall nnfeed-read-id-function article)) + (id (format "<%s@%s.%s>" id name nnfeed-backend))) + (let* ((num (gethash id ids)) + (update (funcall nnfeed-read-update-date-function article)) + (prev-update (aref (gethash num articles + '[nil nil nil nil nil]) + 4))) + (if (or (null num) ; New article ID. + (and (null prev-update) update) + (and prev-update update + (time-less-p prev-update update))) + (let* ((num (or num (aset g 3 (setq max (1+ max))))) + (publish (funcall nnfeed-read-publish-date-function + article))) + (setf + (gethash id (aref g 1)) num + (gethash num (aref g 2)) + `[ ,id + ,(or (funcall nnfeed-read-author-function article) + group-author group) + ,(or (funcall nnfeed-read-subject-function article) + "no subject") + ,(or publish update '(0 0)) ; published + ,(or update publish '(0 0)) ; updated + ,(funcall nnfeed-read-links-function article) + ,(funcall nnfeed-read-parts-function article) + ,(funcall nnfeed-read-headers-function article)] + stale nil)) + (setq stale t))))) + (puthash group g s))) + (puthash feed s nnfeed-servers)))) + +;;;; Gnus backend functions: + +;; The following two sections define a Gnus backend interface based on +;; the parsed data from the last section. +;; All server variables in this section are automatically defined by +;; `nnfeed-define-basic-backend-interface'. +;; For more information about these functions see the "Back End +;; Interface" section of the Gnus manual. + +(defvoo nnfeed-group nil + "Name of the current group.") + +(defvoo nnfeed-group-article-ids (make-hash-table :test 'equal) + "Hash table mapping article IDs to their article number.") + +(defvoo nnfeed-group-articles (make-hash-table :test 'eql) + "Hash table mapping article numbers to articles and their attributes. + +Each value in this table should be a vector of the form +[ID FROM SUBJECT DATE UPDATED LINKS PARTS HEADERS], where: +- ID is the ID of the article. +- FROM is the author of the article or group. +- SUBJECT is the subject of the article. +- DATE is the date the article was published, or last updated (time value). +- UPDATE is the date the article was last updated, or published (time value). +- LINKS is a collection of links (any Lisp object). +- PARTS is an alist associating the content of each part of the + article to its headers. +- HEADERS is an alist associating article-wide MIME headers to their value.") + +(defvoo nnfeed-group-article-max-num 0 + "Maximum article number for the current group.") + +(defvoo nnfeed-group-article-min-num 1 + "Minimum article number for the current group.") + +(nnoo-define-basics nnfeed) + +(defun nnfeed--current-server-no-prefix () + "Remove the \"+\" prefix from the current server." + (string-remove-prefix (concat (symbol-name nnfeed-backend) "+") + (nnoo-current-server nnfeed-backend))) + +(defun nnfeed--group-data (group server) + "Get parsed data for GROUP from SERVER." + (when-let ((server (nnfeed--server-address server)) + (s (gethash server nnfeed-servers)) + ((hash-table-p s))) + (gethash group s))) + +(defun nnfeed-retrieve-article (article group) + "Retrieve headers for ARTICLE from GROUP." + (if-let ((a (gethash article (aref group 2)))) + (insert (format "221 %s Article retrieved. +From: %s\nSubject: %s\nDate: %s\nMessage-ID: %s\n.\n" + article + (aref a 1) + (aref a 2) + (format-time-string "%F %H:%M" (aref a 3)) + (aref a 0))) + (insert "404 Article not found.\n.\n"))) + +(deffoo nnfeed-retrieve-headers (articles &optional group server _fetch-old) + (if-let ((server (or server (nnfeed--current-server-no-prefix))) + (g (or (nnfeed--group-data group server) + `[ nil ,nnfeed-group-article-ids ,nnfeed-group-articles + nil nil nil]))) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (or (and (stringp (car articles)) + (mapc (lambda (a) + (nnfeed-retrieve-article + (gethash a (aref g 2)) g)) + articles)) + (and (numberp (car articles)) + (range-map (lambda (a) (nnfeed-retrieve-article a g)) + articles))) + 'headers) + (nnheader-report nnfeed-backend "Group %s not found" (or group "")))) + +(deffoo nnfeed-open-server (server &optional defs backend) + (let ((backend (or backend 'nnfeed)) + (a (nnfeed--server-address server)) + s) + (nnoo-change-server backend server defs) + (when (setq s (or (gethash a nnfeed-servers) (nnfeed--read-server server))) + (maphash (lambda (group g) + (setq g (aref g 0)) + (unless (string= group g) + (puthash group g nnfeed-group-names))) + s)) + (setq a (nnfeed--server-file server)) + (or s (condition-case _ (make-directory (file-name-parent-directory a) t) + (:success (file-writable-p a)) + (t nil)) + (and (nnoo-close-server nnfeed-backend server) + (nnheader-report + nnfeed-backend "Server file %s not readable or writable" + server))))) + +(deffoo nnfeed-request-close () + (when (hash-table-p nnfeed-servers) + (maphash (lambda (server _) (nnfeed--write-server server)) nnfeed-servers) + (setq nnfeed-servers (make-hash-table :test 'equal))) + (setq nnfeed-status-string nil) + t) + +;; The default content printing function, which should be suitable for +;; most inheriting backends. + +(defun nnfeed--print-content (content attributes links) + "Return CONTENT formatted according to ATTRIBUTES, with LINKS possibly added." + (let ((links (and (memq 'links attributes) links))) + (when (or content links) + (concat + (and content (format "%s\n\n" content)) + (mapconcat (lambda (link) + (cdr (assoc (cdr (assq 'Content-Type attributes)) link + (lambda (types type) + (if (stringp types) (string= types type) + (member type types)))))) + links))))) + +(defvoo nnfeed-print-content-function #'nnfeed--print-content + "Function returning a single piece of content for an article (a string). + +It should accept three arguments, a part and its attributes (as returned +by `nnfeed-read-parts-function'), and links (as returned by +`nnfeed-read-links-function').") + +(defun nnfeed--print-part (content headers mime links) + "Print part of an article using its CONTENT, HEADERS, and LINKS. +Only HEADERS of a type included in MIME are considered." + (concat + (mapconcat (lambda (header) + (when-let ((m (car-safe header)) + ((member m mime))) + (format "%s: %s\n" m (cdr header)))) + headers) + "\n" + (funcall nnfeed-print-content-function content headers links))) + +(deffoo nnfeed-request-article (article &optional group server to-buffer) + (if-let ((server (or server (nnfeed--current-server-no-prefix))) + (g (or (nnfeed--group-data group server) + (and (setq group nnfeed-group) + `[ nil ,nnfeed-group-article-ids + ,nnfeed-group-articles + ,nnfeed-group-article-max-num + ,nnfeed-group-article-min-num nil]))) + (num (or (and (stringp article) + (gethash article (aref g 1))) + (and (numberp article) article))) + ((and (<= num (aref g 3)) + (>= num (aref g 4)))) + (a (gethash num (aref g 2)))) + (with-current-buffer (or to-buffer nntp-server-buffer) + (erase-buffer) + (let* ((links (aref a 5)) + (parts (aref a 6)) + (headers (aref a 7)) + (boundary (or (cdr (assq :boundary headers)) + (format "-_%s_-" nnfeed-backend))) + (multi (length> parts 1)) + (mime '( Content-Type Content-Disposition + Content-Transfer-Encoding))) + (insert (format + "Subject: %s\nFrom: %s\nDate: %s\nMessage-ID: %s\n" + (aref a 2) (aref a 1) + (format-time-string + nnfeed-date-format (or (aref a 3) '(0 0))) + (aref a 0)) + (if (assq 'MIME-Version headers) "" "MIME-Version: 1.0\n") + (mapconcat (lambda (header) + (unless (keywordp (car header)) + (format "%s: %s\n" (car header) (cdr header)))) + headers) + (if multi + (if (assq 'Content-Type headers) "" + (format + "Content-Type: multipart/alternative; boundary=%s\n" + boundary)) + (prog1 (nnfeed--print-part + (caar parts) (cdar parts) mime links) + (setq parts nil))) + (mapconcat (lambda (part) + (format "--%s\n%s\n" boundary + (nnfeed--print-part + (car part) (cdr part) mime links))) + parts) + (if multi (format "--%s--" boundary) "\n"))) + `(,group . ,num)) + (nnheader-report nnfeed-backend "No such article"))) + +(deffoo nnfeed-request-group (group &optional server fast _info) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (if-let ((server (or server (nnfeed--current-server-no-prefix))) + (g (or (if fast (nnfeed--group-data group server) + (setq server (nnfeed--parse-feed server group)) + (and (hash-table-p server) (gethash group server))) + `[ ,group ,(make-hash-table :test 'equal) + ,(make-hash-table :test 'eql) 0 1 ""]))) + (progn + (setq nnfeed-group group + nnfeed-group-article-ids (aref g 1) + nnfeed-group-articles (aref g 2) + nnfeed-group-article-max-num (aref g 3) + nnfeed-group-article-min-num (aref g 4)) + (insert (format "211 %s %s %s \"%s\"" + (hash-table-count nnfeed-group-article-ids) + nnfeed-group-article-min-num + nnfeed-group-article-max-num group)) + t) + (insert "404 group not found") + (nnheader-report nnfeed-backend "Group %s not found" group)))) + +(deffoo nnfeed-close-group (group &optional server) + (and (string= group nnfeed-group) + (setq nnfeed-group nil + nnfeed-group-article-ids (make-hash-table :test 'equal) + nnfeed-group-articles (make-hash-table :test 'eql) + nnfeed-group-article-max-num 0 + nnfeed-group-article-min-num 1)) + (setq server (or server (nnfeed--current-server-no-prefix))) + (nnfeed--write-server server)) + +(deffoo nnfeed-request-list (&optional server) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (when-let ((p (point)) + (s (nnfeed--parse-feed + (or server (nnfeed--current-server-no-prefix)))) + ((hash-table-p s))) + (maphash (lambda (group g) + (insert (format "\"%s\" %s %s y\n" + group (aref g 3) (aref g 4)))) + s) + (not (= (point) p))))) + +(deffoo nnfeed-request-post (&optional _server) + (nnheader-report nnfeed-backend "%s is a read only backend" nnfeed-backend)) + +;;;; Optional back end functions: + +(deffoo nnfeed-retrieve-groups (_groups &optional server) + (nnfeed-request-list server) + 'active) + +(deffoo nnfeed-request-type (_group &optional _article) + 'unknown) + +(deffoo nnfeed-request-group-description (group &optional server) + (when-let ((server (or server (nnfeed--current-server-no-prefix))) + (g (nnfeed--group-data group server))) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (insert group " " (aref g 5) "\n")))) + +(deffoo nnfeed-request-list-newsgroups (&optional server) + (when-let ((server (or server (nnfeed--current-server-no-prefix))) + (s (gethash (nnfeed--server-address server) nnfeed-servers)) + ((hash-table-p s))) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (maphash (lambda (group g) + (insert group " " (aref g 5) "\n")) + s)))) + +(deffoo nnfeed-request-rename-group (group new-name &optional server) + (when-let ((server (or server (nnfeed--current-server-no-prefix))) + (a (nnfeed--server-address server)) + (s (or (gethash a nnfeed-servers) + (and ; Open the server to add it to `nnfeed-servers' + (save-match-data + (nnfeed-open-server + server + (cdr ; Get defs and backend. + (assoc a (cdr (assq nnfeed-backend nnoo-state-alist)) + (lambda (car key) + (and (stringp car) + (string-match + (concat + "\\`\\(\\(nn[[:alpha:]]+\\)\\+\\)?" + (regexp-quote key) "\\'") + car) + (setq server car))))) + (if (match-string 1 server) + (intern (match-string 2 server)) 'nnfeed))) + (gethash a nnfeed-servers)))) + (g (or (nnfeed--group-data group a) + `[ ,group ,(make-hash-table :test 'equal) + ,(make-hash-table :test 'eql) nil 1 ""]))) + (puthash new-name g s) + (puthash group new-name nnfeed-group-names) + (remhash group s) + (and (string= group nnfeed-group) + (setq nnfeed-group new-name)) + t)) + +(provide 'nnfeed) + +;;; nnfeed.el ends here -- 2.44.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 24 09:37:06 2024 Received: (at 66188) by debbugs.gnu.org; 24 Mar 2024 13:37:06 +0000 Received: from localhost ([127.0.0.1]:59038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roO20-0002no-Ls for submit@debbugs.gnu.org; Sun, 24 Mar 2024 09:37:06 -0400 Received: from dsemy.com ([46.23.89.208]:10859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roO1r-0002mw-A7; Sun, 24 Mar 2024 09:36:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=dkim; bh=Q6qA4KVmuzB6J zQFGVcTJK17Q55q/22TdQfK66Uy0hs=; h=date:references:in-reply-to: subject:cc:to:from; d=dsemy.com; b=aRaQ2lkcj+HnFHN93bNOGjfKPxVwNj0rw1G Zw6VHM7QVcprBv+g10zM1a0dkCiCiJ+WaP3xaHJlI6+BAGYeT/b8hrFsGB3JPpSrKke6SC AH10ZOd6f4s4xsxo8INQxAzmrSdFRybJ33Ohd1QCqtz8WRYfG9J7fy3RpR9n+Jmml43d1e b3brt+1be7d0kK3dkhOIFdmU7zcZbYijOOdzNtdjtDRLdJCYDh9BNEtVBOM5YZajVL5lne K78TKf+LVc7OGVRvSd89dQz7RNmY+Z36MwviQDJgYhYhLoc4VtkgSrBI2bXpONvpZ5qmS3 jyX7km/DAfiojDYdXx0GK2vWPfQ== Received: from coldharbour.local ( [147.235.211.67]) by dsemy.com (OpenSMTPD) with ESMTPSA id 8258bd71 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 24 Mar 2024 14:35:47 +0100 (CET) Received: from localhost (coldharbour.local [local]) by coldharbour.local (OpenSMTPD) with ESMTPA id 6a3aedcb; Sun, 24 Mar 2024 13:35:18 +0000 (UTC) From: Daniel Semyonov To: James Thomas Subject: Re: bug#66188: 29.1; Include Atom feed reader In-Reply-To: <87ttl3wk81.fsf_-_@dsemy.com> (Daniel Semyonov's message of "Mon, 18 Mar 2024 18:58:06 +0200") References: <87v8fhmgvw.fsf@dsemy.com> <87zfyj8ojz.fsf@dsemy.com> <87ttohxc56.fsf@dsemy.com> <87le83hcm8.fsf@outlook.com> <87h6io5rr5.fsf@dsemy.com> <87r0hof9ll.fsf_-_@dsemy.com> <87jznfpom1.fsf@gmx.net> <874jejb2sg.fsf@dsemy.com> <87fry2pa1n.fsf@gmx.net> <87ttmhwxby.fsf@dsemy.com> <87wmrd9zcy.fsf@outlook.com> <875xyx5ksi.fsf@dsemy.com> <87sf219ntf.fsf@gmx.net> <87msrtkztg.fsf@outlook.com> <87ttm0mnku.fsf@dsemy.com> <87o7c7b0yf.fsf@dsemy.com> <87le79yl11.fsf@gmx.net> <87sf1eh53p.fsf@dsemy.com> <87ttl3wk81.fsf_-_@dsemy.com> Date: Sun, 24 Mar 2024 15:35:18 +0200 Message-ID: <87il1b7nxl.fsf@dsemy.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 66188 Cc: Eric Abrahamsen , 66188@debbugs.gnu.org, 64202@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain >>>>> Daniel Semyonov writes: > I pushed a few more commits (an updated patch is attached) which fix > some edge cases with ephemeral groups and simplify some functions. And a few more which fix a typo which caused duplicate groups being created after renaming a group and relaunching Gnus, and fix the "Web Feed Back Ends" subsection in the Gnus manual by making it a subsubsection. Updated patch attached. Daniel --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Gnus-Add-back-end-for-Atom-feeds-nnatom.patch Content-Description: patch >From ca54f563b9dd03664225639c42b193a29947d391 Mon Sep 17 00:00:00 2001 From: Daniel Semyonov Date: Wed, 21 Jun 2023 10:05:04 +0300 Subject: [PATCH] Gnus: Add back end for Atom feeds (nnatom) * lisp/gnus/gnus.el (gnus-valid-select-methods): Add entry for nnatom. * lisp/gnus/nnfeed.el: New file implementing an abstract web feed back end. * lisp/gnus/nnatom.el: New file implementing a back end for Atom feeds. * doc/misc/gnus.texi (Browsing the Web, Back End Interface): * etc/NEWS (Gnus): Document nnatom and nnfeed. --- doc/misc/gnus.texi | 75 +++++ etc/NEWS | 10 + lisp/gnus/gnus.el | 1 + lisp/gnus/nnatom.el | 276 ++++++++++++++++++ lisp/gnus/nnfeed.el | 683 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 1045 insertions(+) create mode 100644 lisp/gnus/nnatom.el create mode 100644 lisp/gnus/nnfeed.el diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 419a5390374..7a0e6dd79a3 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -715,6 +715,7 @@ Top * Web Searches:: Creating groups from articles that match a string. * RSS:: Reading RDF site summary. +* Atom:: Reading Atom Syndication Format feeds. Other Sources @@ -975,6 +976,7 @@ Top * Writing New Back Ends:: Extending old back ends. * Hooking New Back Ends Into Gnus:: What has to be done on the Gnus end. * Mail-like Back Ends:: Some tips on mail back ends. +* Web Feed Back Ends:: Easily defining back ends for web feeds. Various File Formats @@ -17252,6 +17254,7 @@ Browsing the Web @menu * Web Searches:: Creating groups from articles that match a string. * RSS:: Reading RDF site summary. +* Atom:: Reading Atom Syndication Format feeds. @end menu The main caveat with all these web sources is that they probably won't @@ -17496,6 +17499,40 @@ RSS @end lisp +@node Atom +@subsection Atom +@cindex nnatom +@cindex Atom + +Some web sites provide an Atom Syndication Format feed. Atom is a web +feed format similar in function to RDF Site Summary (@pxref{RSS}). + +The @code{nnatom} back end allows you to add HTTP or local Atom feeds +as Gnus servers (with a single group), as you would with any other +method, by supplying the location of the feed as the server address. +Note, however, that the server address shouldn't be prefixed with +@url{http://} or @url{https://}. + +Features of @code{nnatom} include: + +@itemize @bullet + +@item +Server data is saved per-server in the @file{atom} sub-directory of +@file{gnus-directory}. + +@item +An article part is generated for both the summary and the content for +each entry in the feed. Content of all MIME types should be displayed +correctly through Gnus (as long as they are supported and the feed +specifies a MIME type). + +@item +Article modification and publish dates are tracked, and articles are +updated if changed. + +@end itemize + @node Other Sources @section Other Sources @@ -29997,6 +30034,7 @@ Back End Interface * Writing New Back Ends:: Extending old back ends. * Hooking New Back Ends Into Gnus:: What has to be done on the Gnus end. * Mail-like Back Ends:: Some tips on mail back ends. +* Web Feed Back Ends:: Easily defining back ends for web feeds. @end menu @@ -30770,6 +30808,43 @@ Mail-like Back Ends @end example +@node Web Feed Back Ends +@subsubsection Web Feed Back Ends + +If you want to write a back end for a new type of web feed (RSS, +Atom), or some other type of feed, an ``abstract'' back end +(@code{nnfeed}) exists to enable the creation of such back ends with +minimal knowledge of Gnus. + +@code{nnfeed} defines a generic parser, which uses functions stored in +server variables to parse information from a feed (@code{nnfeed} +itself doesn't actually define any such functions though). + +The data parsed from the feed is stored in server variables (and +stored per-feed in a sub-directory of @option{gnus-directory} whose name +corresponds to the name of the back end). + +A Gnus back end interface is also defined, which uses the data parsed +from the feed. + +Therefore, a new back end only needs to inherit from @code{nnfeed}, +define (fairly) generic parsing functions for the feed type and setup +the required server variables. + +@code{nnfeed} was originally created to support Atom Syndication +Format feeds (@pxref{Atom}), but is very generic (as of writing this, +no standard web feed exists which can meaningfully use all the +features supported): it supports multiple groups contained in a single +feed, it allows for situations when the entire feed can't (or +shouldn't) be read ahead of time and it allows for very advanced +customization of the actual printing of articles from parsed data +(while providing a reasonably powerful default method). + +Further implementation details are available in the documentation +strings of the various @code{nnfeed-*} server variables and +the commentary and other comments of @file{nnfeed.el}. + + @node Score File Syntax @subsection Score File Syntax diff --git a/etc/NEWS b/etc/NEWS index 19588fe8eeb..552f814ed34 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1220,6 +1220,16 @@ This keyword enables the user to install packages using 'package-vc'. ** Gnus ++++ +*** New back end 'nnfeed'. +This allows back end developers to easily create new back ends for web +feeds, as inheriting back ends of 'nnfeed'. + ++++ +*** New back end 'nnatom'. +This allow users to add Atom Syndication Format feeds to Gnus as +servers. + *** The 'nnweb-type' option 'gmane' has been removed. The gmane.org website is, sadly, down since a number of years with no prospect of it coming back. Therefore, it is no longer valid to set diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index dab66b60205..bc8819dc967 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -1360,6 +1360,7 @@ gnus-valid-select-methods ("nnimap" post-mail address prompt-address physical-address respool server-marks cloud) ("nnmaildir" mail respool address server-marks) + ("nnatom" address) ("nnnil" none)) "An alist of valid select methods. The first element of each list lists should be a string with the name diff --git a/lisp/gnus/nnatom.el b/lisp/gnus/nnatom.el new file mode 100644 index 00000000000..e8dfa12aff5 --- /dev/null +++ b/lisp/gnus/nnatom.el @@ -0,0 +1,276 @@ +;;; nnatom.el --- Atom backend for Gnus -*- lexical-binding: t -*- + +;; Copyright (C) 2023 Free Software Foundation, Inc. +;; Author: Daniel Semyonov + +;; This file is part of GNU Emacs. + +;; nnatom 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. + +;; nnatom 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 nnatom. If not, see . + +;;; Commentary: + +;; Gnus backend for HTTP or local feeds following the +;; Atom Syndication Format . + +;;; Code: + +(eval-when-compile + (require 'cl-lib) + (require 'subr-x)) + +(require 'nnfeed) +(require 'mm-url) +(require 'dom) + +(defgroup nnatom nil + "Atom backend for Gnus." + :group 'nnfeed) + +(nnoo-declare nnatom nnfeed) + +(nnfeed-define-basic-backend-interface nnatom) + +;;;; Atom feed parser: + +(defun nnatom--read-feed (feed _) + "Return a list structure representing FEED, or nil." + (if (string-match-p "\\`https?://" feed) + (nnheader-report + nnatom-backend + "Address shouldn't start with \"http://\" or \"https://\"") + (with-temp-buffer + (condition-case e + (if (file-name-absolute-p feed) + (insert-file-contents feed) + (mm-url-insert-file-contents (concat "https://" feed))) + (file-error (nnheader-report nnatom-backend (cdr e))) + (:success (when-let ((data (if (libxml-available-p) + (libxml-parse-xml-region + (point-min) (point-max)) + (car (xml-parse-region + (point-min) (point-max))))) + (authors (list 'authors))) + (when (eq (car data) 'top) + (setq data (assq 'feed data))) + (dom-add-child-before data authors) + (let ((all (dom-children data))) + (while-let ((rest (cdr all)) + (child (car-safe rest)) + (type (car-safe child)) + ((not (eq type 'entry)))) + (and (or (eq type 'author) + (eq type 'contributor)) + (dom-add-child-before authors child)) + (setq all rest)) + ;; Order of entries is reversed as most Atom feeds + ;; list only the "most recent" entries, in reverse + ;; chronological order. + (setcdr all (nreverse (cdr all)))) + data)))))) +(defvoo nnatom-read-feed-function #'nnatom--read-feed + nil nnfeed-read-feed-function) + +(defun nnatom--read-group (data) + "Return the next group and the remaining DATA in a cons cell, or nil." + `(,data)) +(defvoo nnatom-read-group-function #'nnatom--read-group + nil nnfeed-read-group-function) + +(defun nnatom--read-article (data _) + "Return the next article and the remaining DATA in a cons cell, or nil." + (when (eq (car data) 'feed) (setq data (dom-children data))) + ;; Discard any children between/after entries. + (while (and data (not (eq (car-safe (car data)) 'entry))) (pop data)) + (when-let ((article (car data)) + (auths (list 'authors)) (links (list 'links))) + (dom-add-child-before article links) + (dom-add-child-before article auths) + (dolist (child (cddddr article) `(,article . ,(cdr data))) + (pcase (car-safe child) ; Authors and links can appear + ((or 'author 'contributor) ; anywhere in the entry so we + (dom-add-child-before auths child) ; collect them all here to + (dom-add-child-before links child)) ; avoid looping over the + ((or 'link ; entry multiple times later. + (and 'content (guard (assq 'src (dom-attributes child))))) + (dom-add-child-before links child)))))) +(defvoo nnatom-read-article-function #'nnatom--read-article + nil nnfeed-read-article-function) + +(defun nnatom--read-title (group) + "Return the title of GROUP, or nil." + (dom-text (dom-child-by-tag group 'title))) +(defvoo nnatom-read-title-function #'nnatom--read-title + nil nnfeed-read-title-function) + +(defun nnatom--read-description (group) + "Return the description of GROUP, or nil." + (dom-text (dom-child-by-tag group 'subtitle))) +(defvoo nnatom-read-description-function #'nnatom--read-description + nil nnfeed-read-description-function) + +(defun nnatom--read-article-or-group-authors (article-or-group) + "Return the authors of ARTICLE-OR-GROUP, or nil." + (when-let + ((a (mapconcat + (lambda (author) + (let* ((name (dom-text (dom-child-by-tag author 'name))) + (name (unless (string-blank-p name) name)) + (email (dom-text (dom-child-by-tag author 'email))) + (email (unless (string-blank-p email) email))) + (or (and name email (format "%s <%s>" name email)) name email))) + (dom-children (dom-child-by-tag article-or-group 'authors)) + ", ")) + ((not (string-blank-p a)))) + a)) +(defvoo nnatom-read-author-function #'nnatom--read-article-or-group-authors + nil nnfeed-read-author-function) +(defvoo nnatom-read-group-author-function + #'nnatom--read-article-or-group-authors + nil nnfeed-read-group-author-function) + +(defun nnatom--read-subject (article) + "Return the subject of ARTICLE, or nil." + (dom-text (dom-child-by-tag article 'title))) +(defvoo nnatom-read-subject-function #'nnatom--read-subject + nil nnfeed-read-subject-function) + +(defun nnatom--read-id (article) + "Return the ID of ARTICLE. +If the ARTICLE doesn't contain an ID but it does contain a subject, +return the subject. Otherwise, return nil." + (or (dom-text (dom-child-by-tag article 'id)) + (nnatom--read-subject article))) +(defvoo nnatom-read-id-function #'nnatom--read-id + nil nnfeed-read-id-function) + +(defun nnatom--read-publish (article) + "Return the date and time ARTICLE was published, or nil." + (when-let (d (dom-child-by-tag article 'published)) + (date-to-time (dom-text d)))) +(defvoo nnatom-read-publish-date-function #'nnatom--read-publish + nil nnfeed-read-publish-date-function) + +(defun nnatom--read-update (article) + "Return the date and time of the last update to ARTICLE, or nil." + (when-let (d (dom-child-by-tag article 'updated)) + (date-to-time (dom-text d)))) +(defvoo nnatom-read-update-date-function #'nnatom--read-update + nil nnfeed-read-update-date-function) + +(defun nnatom--read-links (article) + "Return all links contained in ARTICLE, or nil." + (let ((alt 0) (rel 0) (sel 0) (enc 0) (via 0) (aut 0)) + (mapcan + (lambda (link) + (when-let ((l (car-safe link))) + (or + (when-let (((eq l 'content)) + (src (dom-attr link 'src)) + (label (concat "Link" + (and (< 1 (cl-incf alt)) + (format " %s" alt))))) + `(((("text/plain") . ,(format "%s: %s\n" label src)) + (("text/html") . ,(format "[%s] " + src label))))) + (when-let (((or (eq l 'author) (eq l 'contributor))) + (name (dom-text (dom-child-by-tag link 'name))) + (name (if (string-blank-p name) + (concat "Author" + (and (< 1 (cl-incf aut)) + (format " %s" aut))) + name)) + (uri (dom-text (dom-child-by-tag link 'uri))) + ((not (string-blank-p uri)))) + `(((("text/plain") . ,(format "%s: %s\n" name uri)) + (("text/html") . ,(format "[%s] " + uri name))))) + (when-let (((eq l 'link)) + (attrs (dom-attributes link)) + (label (or (cdr (assq 'title attrs)) + (pcase (cdr (assq 'rel attrs)) + ("related" + (concat "Related" + (and (< 1 (cl-incf rel)) + (format " %s" rel)))) + ("self" + (concat "More" + (and (< 1 (cl-incf sel)) + (format " %s" sel)))) + ("enclosure" + (concat "Enclosure" + (and (< 1 (cl-incf enc)) + (format " %s" enc)))) + ("via" + (concat "Source" + (and (< 1 (cl-incf via)) + (format " %s" via)))) + (_ (if-let + ((lang (cdr (assq 'hreflang link)))) + (format "Link (%s)" lang) + (concat + "Link" + (and (< 1 (cl-incf alt)) + (format " %s" alt)))))))) + (link (cdr (assq 'href attrs)))) + `(((("text/plain") . ,(format "%s: %s\n" label link)) + (("text/html") . ,(format "[%s] " + link label)))))))) + (dom-children (dom-child-by-tag article 'links))))) +(defvoo nnatom-read-links-function #'nnatom--read-links + nil nnfeed-read-links-function) + +(defun nnatom--read-part (part type) + (let* ((atypes '("html" "plain")) + (mtypes '(("xhtml" . "text/html") ("text" . "text/plain"))) + (xsuff (concat "[+/]xml\\(-\\(dtd\\|external-parsed-entity\\)\\)?\\'" + "\\|^text")) + (part (if (string= type "xhtml") + (with-temp-buffer + (dom-print (dom-child-by-tag part 'div) nil t) + (buffer-substring-no-properties + (point-min) (point-max))) + (dom-text part))) + (type (if (member type atypes) (concat "text/" type) type)) + (type (or (cdr (assoc type mtypes)) type))) + (unless (string-blank-p part) + `(,part (Content-Type . ,(or type (setq type "text/plain"))) + ,(and (not (string-match-p xsuff type)) + '(Content-Transfer-Encoding . "base64")))))) + +(defun nnatom--read-parts (article) + "Return all parts contained in ARTICLE, or an empty HTML part with links." + (let* ((summary (dom-child-by-tag article 'summary)) + (stype (cdr (assq 'type (dom-attributes summary)))) + (summary (nnatom--read-part summary stype)) + (content (dom-child-by-tag article 'content)) + (ctype (cdr (assq 'type (dom-attributes content)))) + (content (nnatom--read-part content ctype)) + (st (string= stype ctype)) + parts) + (cond ((and summary content) + (and st (push summary parts)) + (push (append content '(links)) parts) + (or st (push summary parts))) + ((setq content (or summary content)) + (push (append content '(links)) parts)) + (t (push '((nil (Content-Type . "text/html") links)) parts))) + parts)) +(defvoo nnatom-read-parts-function #'nnatom--read-parts + nil nnfeed-read-parts-function) + +(gnus-declare-backend (symbol-name nnatom-backend) 'address) + +(provide 'nnatom) + +;;; nnatom.el ends here diff --git a/lisp/gnus/nnfeed.el b/lisp/gnus/nnfeed.el new file mode 100644 index 00000000000..0bf599553e4 --- /dev/null +++ b/lisp/gnus/nnfeed.el @@ -0,0 +1,683 @@ +;;; nnfeed.el --- Generic feed backend for Gnus -*- lexical-binding: t -*- + +;; Copyright (C) 2023 Free Software Foundation, Inc. +;; Author: Daniel Semyonov + +;; This file is part of GNU Emacs. + +;; nnfeed 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. + +;; nnfeed 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 nnfeed. If not, see . + +;;; Commentary: + +;; Generic Gnus backend (intended) for implementing backends for web +;; feeds (Atom, RSS). +;; +;; This backend is abstract - it doesn't implement a parser for any +;; specific web feed type, and so can't be used independently. +;; +;; Instead, it implements a generic parser, feed data storage and most +;; of the Gnus backend interface; the intended use for this backend is +;; to be a source of inheritance for backends supporting new web feed +;; types. +;; +;; To implement new backends, use `nnfeed-define-basic-backend-interface': +;; +;; ... +;; (require 'nnfeed) +;; +;; (nnoo-declare nnfoo nnfeed) +;; +;; (nnfeed-define-basic-backend-interface nnfoo) +;; ... +;; [ definitions of parsing functions, see the "Feed parser interface" +;; section for more information. ] +;; +;; (defvoo nnfoo-read-feed-function #'nnfoo--read-feed +;; nil nnfeed-read-feed-function) +;; ... +;; (gnus-declare-backend (symbol-name nnfeed-backend) 'address) +;; +;; (provide 'nnfoo) +;; +;;; Code: + +(eval-when-compile + (require 'subr-x)) + +(require 'gnus) +(require 'nnoo) + +(defgroup nnfeed nil + "Generic feed backend for Gnus." + :group 'gnus) + +(defcustom nnfeed-date-format "%F %X%p" + "Format of displayed dates (see function `format-time-string')." + :type 'string) + +(nnoo-declare nnfeed) + +(defvoo nnfeed-backend nil + "Symbol which identifies this backend.") + +(defvoo nnfeed-status-string nil + "Last status message reported by this backend.") + +;; This macro should be used to define inheriting backends. + +(defmacro nnfeed-define-basic-backend-interface (backend) + "Define a basic set of functions and variables for BACKEND." + `(progn + (defvoo ,(nnoo-symbol backend 'backend) ',backend nil nnfeed-backend) + (defvoo ,(nnoo-symbol backend 'status-string) + nil nil nnfeed-status-string) + (defvoo ,(nnoo-symbol backend 'group) nil nil nnfeed-group) + (defvoo ,(nnoo-symbol backend 'servers) + (make-hash-table :test 'equal) nil nnfeed-servers) + (defvoo ,(nnoo-symbol backend 'group-article-ids) + (make-hash-table :test 'equal) nil nnfeed-group-article-ids) + (defvoo ,(nnoo-symbol backend 'group-articles) + (make-hash-table :test 'eql) nil nnfeed-group-articles) + (defvoo ,(nnoo-symbol backend 'group-article-max-num) 0 nil + nnfeed-group-article-max-num) + (defvoo ,(nnoo-symbol backend 'group-article-mix-num) 1 nil + nnfeed-group-article-min-num) + ,@(mapcar (lambda (fun) + `(deffoo ,(nnoo-symbol backend fun) (&optional server) + (,(nnoo-symbol 'nnoo fun) ',backend server))) + '(server-opened status-message)) + (deffoo ,(nnoo-symbol backend 'open-server) (server &optional defs) + (nnfeed-open-server server defs ',backend)) + (nnoo-import ,backend (nnfeed)))) + +;;;; Feed parser interface: + +;; The following set of server variables define a parser for a +;; specific web feed type. +;; An inheriting backend doesn't necessarily have to define all of +;; these functions (see the comments below for more information). +;; Apart from this set of variables there is also +;; `nnfeed-print-content-function' which can optionally be defined +;; by an inheriting backend to allow more advanced control over the +;; printing of articles. + +(defvoo nnfeed-read-feed-function #'ignore + "Function returning a Lisp object representing a feed (or part of it). + +It should accept two arguments, the address of a feed and the name of +a group (or nil). +If a group name is supplied, it should return a representation of only +the group (as if it was extracted from the feed with +`nnfeed-read-group-function').") + +(defvoo nnfeed-read-group-function #'ignore + "Function returning a cons cell of a group and remaining data from a feed. + +The returned group can be represented by any Lisp object. +It should accept a single argument, a Lisp object representing a feed +\(as can be returned by this function or `nnfeed-read-feed-function').") + +(defvoo nnfeed-read-article-function #'ignore + "Function returning a cons cell of an article and remaining data from a group. + +The returned article can be represented by any Lisp object. +It should accept two arguments, a Lisp object representing a group +\(as can be returned by this function or `nnfeed-read-group-function'), +and a flag indicating whether the last article was not new or updated.") + +(defvoo nnfeed-read-title-function #'ignore + "Function returning the title of a group (a string). + +It should accept a single argument, a Lisp object representing a group +\(as returned by `nnfeed-read-group-function').") + +;; Optional. +(defvoo nnfeed-read-description-function #'ignore + "Function returning the description of a group (a string), or nil. + +It should accept a single argument, a Lisp object representing a group +\(as returned by `nnfeed-read-group-function').") + +;; Either this function or `nnfeed-read-author-function' is required. +(defvoo nnfeed-read-group-author-function #'ignore + "Function returning the author of a group (a string), or nil. + +It should accept a single argument, a Lisp object representing a group +\(as returned by `nnfeed-read-group-function')..") + +(defvoo nnfeed-read-id-function #'ignore + "Function returning the ID of an article. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +(defvoo nnfeed-read-subject-function #'ignore + "Function returning the subject of an article (a string), or nil. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;; Either this function or `nnfeed-read-update-date-function' is required. +(defvoo nnfeed-read-publish-date-function #'ignore + "Function returning the publish date of an article (a time value), or nil. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;; Either this function or `nnfeed-read-publish-date-function' is required. +(defvoo nnfeed-read-update-date-function #'ignore + "Function returning the update date of an article (a time value), or nil. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;; Either this function or `nnfeed-read-group-author-function' is required. +(defvoo nnfeed-read-author-function #'ignore + "Function returning the author of an article (a string), or nil. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +(defvoo nnfeed-read-headers-function #'ignore + "Function returning an alist of article-wide MIME headers. + +Each element of this alist maps a MIME header (a symbol, +i.e. `Content-Type') to its value. As a special case, `:boundary' +maps to a string which will serve as the boundary between article +parts. This must be supplied if a custom boundary is used in a +multipart content type header. The default boundary is \"-_nnfeed_-\", +and is automatically modified to match the name of the back end. +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;; As mentioned in their docstrings, the last two parsing functions +;; can optionally return any Lisp representation they want, provided +;; an appropriate `nnfeed-print-content-function' is defined. This +;; means they are also not _strictly_ required. + +(defvoo nnfeed-read-links-function #'ignore + "Function returning all links contained in an article. + +With the default `nnfeed-print-content-function', it should return a +list of links, where each link is an alist mapping MIME content types +to links formatted for display in a part of that type. Each content +type may also be a list of content types. +Otherwise, it could return any Lisp object. +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +(defvoo nnfeed-read-parts-function #'ignore + "Function returning an alist associating parts of an article to their headers. + +With the default `nnfeed-print-content-function', each part should be a +string. Otherwise, it can be any Lisp object. The \"headers\" of +each part should be a list where each element is either a cons of a +MIME header (a symbol, i.e. `Content-Type') and its value (a string), +or any other Lisp object. MIME headers will be printed, the rest will +be passed on to `nnfeed-print-content-function', which recognizes the +following extra data by default: +- `links', if present, will cause links to be printed in the part. +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;;;; Feed data storage: + +;; This section defines the data types used to store feed data, and +;; functions to read and write it. +;; All variables in this section are automatically defined by +;; `nnfeed-define-basic-backend-interface'. + +(defvoo nnfeed-servers (make-hash-table :test 'equal) + "Hash table mapping known servers to their groups. + +Each value in this table should itself be a hash table mapping known +group names to their data, which should be a vector of the form +[GROUP IDS ARTICLES MAX MIN DESCRIPTION], where: +- GROUP is the \"real\" group name (the name known to the server). +- IDS is a hash table mapping article IDs to their numbers. +- ARTICLES is a hash table mapping article numbers to articles and + their attributes (see `nnfeed-group-articles'). +- MAX is the maximum article number. +- MIN is the minimum article number. +- DESCRIPTION is the group description.") + +(defvoo nnfeed-group-names (make-hash-table :test 'equal) + "Hash table mapping real group names to their custom name.") + +(defun nnfeed--server-address (server) + "Return SERVER's real address." + (if (string-suffix-p "-ephemeral" server) + (setq server (or (cadr (assq (nnoo-symbol nnfeed-backend 'address) + (cddr (gnus-server-to-method + (concat + (symbol-name nnfeed-backend) ":" + server))))) + server)) + server)) + +(defun nnfeed--server-file (server) + "Return the file containing data for SERVER." + (expand-file-name (format "%s/%s.eld" + (string-trim (symbol-name nnfeed-backend) + "nn") + (gnus-newsgroup-savable-name + (nnfeed--server-address server))) + gnus-directory)) + +(defun nnfeed--read-server (server) + "Read SERVER's information from storage." + (if-let ((f (nnfeed--server-file server)) + ((file-readable-p f))) + (with-temp-buffer + (insert-file-contents f) + (goto-char (point-min)) + (puthash server (read (current-buffer)) nnfeed-servers)) + (nnheader-report nnfeed-backend "Can't read %s" server))) + +(defun nnfeed--write-server (server) + "Write SERVER's information to storage." + (if-let ((f (nnfeed--server-file server)) + ((file-writable-p f))) + (if-let ((s (gethash server nnfeed-servers)) + ((hash-table-p s))) + (with-temp-file f + (insert ";;;; -*- mode: lisp-data -*- DO NOT EDIT\n") + (prin1 s (current-buffer)) + (insert "\n") + t) + t) + (nnheader-report nnfeed-backend "Can't write %s" f))) + +;; The following function uses the parsing functions defined in the last +;; section to parse a feed (or just one group from it). +;; This is the only place where these parsing functions are used; the Gnus +;; backend interface extracts all required information from the parsed feed. + +(defun nnfeed--parse-feed (feed &optional group) + "Parse GROUP from FEED into a new or existing server. +If GROUP is omitted or nil, parse the entire FEED." + (let* ((feed (nnfeed--server-address feed)) + (s (or (gethash feed nnfeed-servers) (nnfeed--read-server feed) + (make-hash-table :test 'equal))) + (name group) ; (Maybe) fake name (or nil) + (group (aref (gethash group s `[,group]) 0)) ; Real name (or nil) + data) + (when (setq data (funcall nnfeed-read-feed-function feed group)) + (while-let ((cg (or (and name (cons data)) ; `data' is a single group + (funcall nnfeed-read-group-function data))) + (cg (prog1 (car cg) (setq data (cdr cg))))) + (let* ((name (funcall nnfeed-read-title-function cg)) ; Real name + (group (gethash name nnfeed-group-names name)) ; (Maybe) fake name + (info (gnus-get-info + (concat (symbol-name nnfeed-backend) "+" feed ":" group))) + (g (or (gethash group s) + `[ ,name ,(make-hash-table :test 'equal) + ,(make-hash-table :test 'eql) nil 1 ""])) + (desc (funcall nnfeed-read-description-function cg)) + (ids (aref g 1)) + (articles (aref g 2)) + (max (aref g 3)) + (max (if max max + (setq max 0) ; Find max article number + (dolist ; remembered by Gnus. + ( r (cons (gnus-info-read info) + (gnus-info-marks info)) + max) + (mapc (lambda (x) + (let ((x (if (consp x) + (if (< (car x) (cdr x)) + (cdr x) (car x)) + x))) + (when (< max x) (setq max x)))) + (if (symbolp (car r)) (cdr r) r))))) + (group-author (funcall nnfeed-read-group-author-function cg)) + stale) + (and desc (aset g 5 desc)) + (while-let ((article (funcall nnfeed-read-article-function cg stale)) + (article (prog1 (car article) (setq cg (cdr article))))) + (when-let ((id (funcall nnfeed-read-id-function article)) + (id (format "<%s@%s.%s>" id name nnfeed-backend))) + (let* ((num (gethash id ids)) + (update (funcall nnfeed-read-update-date-function article)) + (prev-update (aref (gethash num articles + '[nil nil nil nil nil]) + 4))) + (if (or (null num) ; New article ID. + (and (null prev-update) update) + (and prev-update update + (time-less-p prev-update update))) + (let* ((num (or num (aset g 3 (setq max (1+ max))))) + (publish (funcall nnfeed-read-publish-date-function + article))) + (setf + (gethash id (aref g 1)) num + (gethash num (aref g 2)) + `[ ,id + ,(or (funcall nnfeed-read-author-function article) + group-author group) + ,(or (funcall nnfeed-read-subject-function article) + "no subject") + ,(or publish update '(0 0)) ; published + ,(or update publish '(0 0)) ; updated + ,(funcall nnfeed-read-links-function article) + ,(funcall nnfeed-read-parts-function article) + ,(funcall nnfeed-read-headers-function article)] + stale nil)) + (setq stale t))))) + (puthash group g s))) + (puthash feed s nnfeed-servers)))) + +;;;; Gnus backend functions: + +;; The following two sections define a Gnus backend interface based on +;; the parsed data from the last section. +;; All server variables in this section are automatically defined by +;; `nnfeed-define-basic-backend-interface'. +;; For more information about these functions see the "Back End +;; Interface" section of the Gnus manual. + +(defvoo nnfeed-group nil + "Name of the current group.") + +(defvoo nnfeed-group-article-ids (make-hash-table :test 'equal) + "Hash table mapping article IDs to their article number.") + +(defvoo nnfeed-group-articles (make-hash-table :test 'eql) + "Hash table mapping article numbers to articles and their attributes. + +Each value in this table should be a vector of the form +[ID FROM SUBJECT DATE UPDATED LINKS PARTS HEADERS], where: +- ID is the ID of the article. +- FROM is the author of the article or group. +- SUBJECT is the subject of the article. +- DATE is the date the article was published, or last updated (time value). +- UPDATE is the date the article was last updated, or published (time value). +- LINKS is a collection of links (any Lisp object). +- PARTS is an alist associating the content of each part of the + article to its headers. +- HEADERS is an alist associating article-wide MIME headers to their value.") + +(defvoo nnfeed-group-article-max-num 0 + "Maximum article number for the current group.") + +(defvoo nnfeed-group-article-min-num 1 + "Minimum article number for the current group.") + +(nnoo-define-basics nnfeed) + +(defun nnfeed--current-server-no-prefix () + "Remove the \"+\" prefix from the current server." + (string-remove-prefix (concat (symbol-name nnfeed-backend) "+") + (nnoo-current-server nnfeed-backend))) + +(defun nnfeed--group-data (group server) + "Get parsed data for GROUP from SERVER." + (when-let ((server (nnfeed--server-address server)) + (s (gethash server nnfeed-servers)) + ((hash-table-p s))) + (gethash group s))) + +(defun nnfeed-retrieve-article (article group) + "Retrieve headers for ARTICLE from GROUP." + (if-let ((a (gethash article (aref group 2)))) + (insert (format "221 %s Article retrieved. +From: %s\nSubject: %s\nDate: %s\nMessage-ID: %s\n.\n" + article + (aref a 1) + (aref a 2) + (format-time-string "%F %H:%M" (aref a 3)) + (aref a 0))) + (insert "404 Article not found.\n.\n"))) + +(deffoo nnfeed-retrieve-headers (articles &optional group server _fetch-old) + (if-let ((server (or server (nnfeed--current-server-no-prefix))) + (g (or (nnfeed--group-data group server) + `[ nil ,nnfeed-group-article-ids ,nnfeed-group-articles + nil nil nil]))) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (or (and (stringp (car articles)) + (mapc (lambda (a) + (nnfeed-retrieve-article + (gethash a (aref g 2)) g)) + articles)) + (and (numberp (car articles)) + (range-map (lambda (a) (nnfeed-retrieve-article a g)) + articles))) + 'headers) + (nnheader-report nnfeed-backend "Group %s not found" (or group "")))) + +(deffoo nnfeed-open-server (server &optional defs backend) + (let ((backend (or backend 'nnfeed)) + (a (nnfeed--server-address server)) + s) + (nnoo-change-server backend server defs) + (when (setq s (or (gethash a nnfeed-servers) (nnfeed--read-server server))) + (maphash (lambda (group g) + (setq g (aref g 0)) + (unless (string= group g) + (puthash g group nnfeed-group-names))) + s)) + (setq a (nnfeed--server-file server)) + (or s (condition-case _ (make-directory (file-name-parent-directory a) t) + (:success (file-writable-p a)) + (t nil)) + (and (nnoo-close-server nnfeed-backend server) + (nnheader-report + nnfeed-backend "Server file %s not readable or writable" + server))))) + +(deffoo nnfeed-request-close () + (when (hash-table-p nnfeed-servers) + (maphash (lambda (server _) (nnfeed--write-server server)) nnfeed-servers) + (setq nnfeed-servers (make-hash-table :test 'equal))) + (setq nnfeed-status-string nil) + t) + +;; The default content printing function, which should be suitable for +;; most inheriting backends. + +(defun nnfeed--print-content (content attributes links) + "Return CONTENT formatted according to ATTRIBUTES, with LINKS possibly added." + (let ((links (and (memq 'links attributes) links))) + (when (or content links) + (concat + (and content (format "%s\n\n" content)) + (mapconcat (lambda (link) + (cdr (assoc (cdr (assq 'Content-Type attributes)) link + (lambda (types type) + (if (stringp types) (string= types type) + (member type types)))))) + links))))) + +(defvoo nnfeed-print-content-function #'nnfeed--print-content + "Function returning a single piece of content for an article (a string). + +It should accept three arguments, a part and its attributes (as returned +by `nnfeed-read-parts-function'), and links (as returned by +`nnfeed-read-links-function').") + +(defun nnfeed--print-part (content headers mime links) + "Print part of an article using its CONTENT, HEADERS, and LINKS. +Only HEADERS of a type included in MIME are considered." + (concat + (mapconcat (lambda (header) + (when-let ((m (car-safe header)) + ((member m mime))) + (format "%s: %s\n" m (cdr header)))) + headers) + "\n" + (funcall nnfeed-print-content-function content headers links))) + +(deffoo nnfeed-request-article (article &optional group server to-buffer) + (if-let ((server (or server (nnfeed--current-server-no-prefix))) + (g (or (nnfeed--group-data group server) + (and (setq group nnfeed-group) + `[ nil ,nnfeed-group-article-ids + ,nnfeed-group-articles + ,nnfeed-group-article-max-num + ,nnfeed-group-article-min-num nil]))) + (num (or (and (stringp article) + (gethash article (aref g 1))) + (and (numberp article) article))) + ((and (<= num (aref g 3)) + (>= num (aref g 4)))) + (a (gethash num (aref g 2)))) + (with-current-buffer (or to-buffer nntp-server-buffer) + (erase-buffer) + (let* ((links (aref a 5)) + (parts (aref a 6)) + (headers (aref a 7)) + (boundary (or (cdr (assq :boundary headers)) + (format "-_%s_-" nnfeed-backend))) + (multi (length> parts 1)) + (mime '( Content-Type Content-Disposition + Content-Transfer-Encoding))) + (insert (format + "Subject: %s\nFrom: %s\nDate: %s\nMessage-ID: %s\n" + (aref a 2) (aref a 1) + (format-time-string + nnfeed-date-format (or (aref a 3) '(0 0))) + (aref a 0)) + (if (assq 'MIME-Version headers) "" "MIME-Version: 1.0\n") + (mapconcat (lambda (header) + (unless (keywordp (car header)) + (format "%s: %s\n" (car header) (cdr header)))) + headers) + (if multi + (if (assq 'Content-Type headers) "" + (format + "Content-Type: multipart/alternative; boundary=%s\n" + boundary)) + (prog1 (nnfeed--print-part + (caar parts) (cdar parts) mime links) + (setq parts nil))) + (mapconcat (lambda (part) + (format "--%s\n%s\n" boundary + (nnfeed--print-part + (car part) (cdr part) mime links))) + parts) + (if multi (format "--%s--" boundary) "\n"))) + `(,group . ,num)) + (nnheader-report nnfeed-backend "No such article"))) + +(deffoo nnfeed-request-group (group &optional server fast _info) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (if-let ((server (or server (nnfeed--current-server-no-prefix))) + (g (or (if fast (nnfeed--group-data group server) + (setq server (nnfeed--parse-feed server group)) + (and (hash-table-p server) (gethash group server))) + `[ ,group ,(make-hash-table :test 'equal) + ,(make-hash-table :test 'eql) 0 1 ""]))) + (progn + (setq nnfeed-group group + nnfeed-group-article-ids (aref g 1) + nnfeed-group-articles (aref g 2) + nnfeed-group-article-max-num (aref g 3) + nnfeed-group-article-min-num (aref g 4)) + (insert (format "211 %s %s %s \"%s\"" + (hash-table-count nnfeed-group-article-ids) + nnfeed-group-article-min-num + nnfeed-group-article-max-num group)) + t) + (insert "404 group not found") + (nnheader-report nnfeed-backend "Group %s not found" group)))) + +(deffoo nnfeed-close-group (group &optional server) + (and (string= group nnfeed-group) + (setq nnfeed-group nil + nnfeed-group-article-ids (make-hash-table :test 'equal) + nnfeed-group-articles (make-hash-table :test 'eql) + nnfeed-group-article-max-num 0 + nnfeed-group-article-min-num 1)) + (setq server (or server (nnfeed--current-server-no-prefix))) + (nnfeed--write-server server)) + +(deffoo nnfeed-request-list (&optional server) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (when-let ((p (point)) + (s (nnfeed--parse-feed + (or server (nnfeed--current-server-no-prefix)))) + ((hash-table-p s))) + (maphash (lambda (group g) + (insert (format "\"%s\" %s %s y\n" + group (aref g 3) (aref g 4)))) + s) + (not (= (point) p))))) + +(deffoo nnfeed-request-post (&optional _server) + (nnheader-report nnfeed-backend "%s is a read only backend" nnfeed-backend)) + +;;;; Optional back end functions: + +(deffoo nnfeed-retrieve-groups (_groups &optional server) + (nnfeed-request-list server) + 'active) + +(deffoo nnfeed-request-type (_group &optional _article) + 'unknown) + +(deffoo nnfeed-request-group-description (group &optional server) + (when-let ((server (or server (nnfeed--current-server-no-prefix))) + (g (nnfeed--group-data group server))) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (insert group " " (aref g 5) "\n")))) + +(deffoo nnfeed-request-list-newsgroups (&optional server) + (when-let ((server (or server (nnfeed--current-server-no-prefix))) + (s (gethash (nnfeed--server-address server) nnfeed-servers)) + ((hash-table-p s))) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (maphash (lambda (group g) + (insert group " " (aref g 5) "\n")) + s)))) + +(deffoo nnfeed-request-rename-group (group new-name &optional server) + (when-let ((server (or server (nnfeed--current-server-no-prefix))) + (a (nnfeed--server-address server)) + (s (or (gethash a nnfeed-servers) + (and ; Open the server to add it to `nnfeed-servers' + (save-match-data + (nnfeed-open-server + server + (cdr ; Get defs and backend. + (assoc a (cdr (assq nnfeed-backend nnoo-state-alist)) + (lambda (car key) + (and (stringp car) + (string-match + (concat + "\\`\\(\\(nn[[:alpha:]]+\\)\\+\\)?" + (regexp-quote key) "\\'") + car) + (setq server car))))) + (if (match-string 1 server) + (intern (match-string 2 server)) 'nnfeed))) + (gethash a nnfeed-servers)))) + (g (or (nnfeed--group-data group a) + `[ ,group ,(make-hash-table :test 'equal) + ,(make-hash-table :test 'eql) nil 1 ""]))) + (puthash new-name g s) + (puthash group new-name nnfeed-group-names) + (remhash group s) + (and (string= group nnfeed-group) + (setq nnfeed-group new-name)) + t)) + +(provide 'nnfeed) + +;;; nnfeed.el ends here -- 2.44.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 06 05:01:40 2024 Received: (at 66188) by debbugs.gnu.org; 6 Apr 2024 09:01:40 +0000 Received: from localhost ([127.0.0.1]:38254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rt1ve-0007Cq-Q4 for submit@debbugs.gnu.org; Sat, 06 Apr 2024 05:01:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rt1vc-0007C4-BN; Sat, 06 Apr 2024 05:01:36 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rt1vQ-0008LS-6y; Sat, 06 Apr 2024 05:01:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=I53jt6qtQDSZldEAefWFdhCDBac3yt+5fQrgGpsolW0=; b=UoeGaYlrr8MP dMfFinDQu+46s7/0qIr/7403w1xNrAYbrObVnQ2N04fTjOpYMLxDel0Qar7u4oYJFkuI5v1MLuSph dtXABSgEEPPuz+EmNUe5kAJGufbQTF93sHke6Q+95ScGDUFjnMKkUL7Mz4FXUEhH5xh4R6RKxTGXM LrgnVymSsXvJ0lxvhMoFQqvaJwv6CjbviVz9/4+sXpI6lnNNEGP0vMd1qthAStJHXEdD0yYPARp/B O7/UDITzZKtpjMSAWDXx4z3r4czJQnEfIAx+WX7LGaZ9X4pMplB/7xXuolWCkAEVAjJxBZR4RZJFj KFQVLyYg4vZqDMmlQGlKNQ==; Date: Sat, 06 Apr 2024 12:01:19 +0300 Message-Id: <8634ry50gw.fsf@gnu.org> From: Eli Zaretskii To: Daniel Semyonov , eric@ericabrahamsen.net In-Reply-To: <87il1b7nxl.fsf@dsemy.com> (bug-gnu-emacs@gnu.org) Subject: Re: bug#64202: bug#66188: 29.1; Include Atom feed reader References: <87v8fhmgvw.fsf@dsemy.com> <87zfyj8ojz.fsf@dsemy.com> <87ttohxc56.fsf@dsemy.com> <87le83hcm8.fsf@outlook.com> <87h6io5rr5.fsf@dsemy.com> <87r0hof9ll.fsf_-_@dsemy.com> <87jznfpom1.fsf@gmx.net> <874jejb2sg.fsf@dsemy.com> <87fry2pa1n.fsf@gmx.net> <87ttmhwxby.fsf@dsemy.com> <87wmrd9zcy.fsf@outlook.com> <875xyx5ksi.fsf@dsemy.com> <87sf219ntf.fsf@gmx.net> <87msrtkztg.fsf@outlook.com> <87ttm0mnku.fsf@dsemy.com> <87o7c7b0yf.fsf@dsemy.com> <87le79yl11.fsf@gmx.net> <87sf1eh53p.fsf@dsemy.com> <87ttl3wk81.fsf_-_@dsemy.com> <87il1b7nxl.fsf@dsemy.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66188 Cc: 66188@debbugs.gnu.org, 64202@debbugs.gnu.org, jimjoe@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ping! Eric, any comments about this? Should we install this? > Cc: Eric Abrahamsen , 66188@debbugs.gnu.org, > 64202@debbugs.gnu.org > Date: Sun, 24 Mar 2024 15:35:18 +0200 > From: Daniel Semyonov via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > >>>>> Daniel Semyonov writes: > > > I pushed a few more commits (an updated patch is attached) which fix > > some edge cases with ephemeral groups and simplify some functions. > > And a few more which fix a typo which caused duplicate groups being > created after renaming a group and relaunching Gnus, and fix the "Web > Feed Back Ends" subsection in the Gnus manual by making it a > subsubsection. Updated patch attached. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 18 05:02:55 2024 Received: (at 66188) by debbugs.gnu.org; 18 Apr 2024 09:02:55 +0000 Received: from localhost ([127.0.0.1]:51182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxNfP-0008JS-Vp for submit@debbugs.gnu.org; Thu, 18 Apr 2024 05:02:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxNf2-0008Ej-0z; Thu, 18 Apr 2024 05:02:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxNei-0000Xk-S0; Thu, 18 Apr 2024 05:02:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=5JKOsMDxtDdyIAq/AuCQy3X+RHnP+QjZa/hs22bDxR8=; b=bLsqR6z3H8VR J6TYtM21EjoNUdZjOWzkR1STWxyAeaTb7+7VuTys7VnD2bqylON8G9e/bLxRvYmFBLu6bB2lB5RSQ b5fKIOvPdmwRXyvLBqSHdLs4nwx8HloQ2jr/ErKwx5dMgE3hVifuLU6LldSv0oykj7LndQXKqxAWg AT2wh+iMO6KGW4yXdR+mQ4L2A+1CC0fnlvuzyoOHfbs8bx//5yAYk8XL7aOoirittsefueG+hLVjI /7yyDz5kgEtbEg+nzRsrx0VW39SnIf6/gOVvldybT7uVMlgxJwkw0eCt32BoSIVgCajF9cLuHB5Gg yY0Fl52IY2p5rEUswhHA5g==; Date: Thu, 18 Apr 2024 12:01:58 +0300 Message-Id: <868r1bf3i1.fsf@gnu.org> From: Eli Zaretskii To: eric@ericabrahamsen.net In-Reply-To: <8634ry50gw.fsf@gnu.org> (message from Eli Zaretskii on Sat, 06 Apr 2024 12:01:19 +0300) Subject: Re: bug#64202: bug#66188: 29.1; Include Atom feed reader References: <87v8fhmgvw.fsf@dsemy.com> <87zfyj8ojz.fsf@dsemy.com> <87ttohxc56.fsf@dsemy.com> <87le83hcm8.fsf@outlook.com> <87h6io5rr5.fsf@dsemy.com> <87r0hof9ll.fsf_-_@dsemy.com> <87jznfpom1.fsf@gmx.net> <874jejb2sg.fsf@dsemy.com> <87fry2pa1n.fsf@gmx.net> <87ttmhwxby.fsf@dsemy.com> <87wmrd9zcy.fsf@outlook.com> <875xyx5ksi.fsf@dsemy.com> <87sf219ntf.fsf@gmx.net> <87msrtkztg.fsf@outlook.com> <87ttm0mnku.fsf@dsemy.com> <87o7c7b0yf.fsf@dsemy.com> <87le79yl11.fsf@gmx.net> <87sf1eh53p.fsf@dsemy.com> <87ttl3wk81.fsf_-_@dsemy.com> <87il1b7nxl.fsf@dsemy.com> <8634ry50gw.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66188 Cc: 66188@debbugs.gnu.org, 64202@debbugs.gnu.org, daniel@dsemy.com, jimjoe@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ping! Ping! Eric, any comments? > Cc: 66188@debbugs.gnu.org, 64202@debbugs.gnu.org, jimjoe@gmx.net > Date: Sat, 06 Apr 2024 12:01:19 +0300 > From: Eli Zaretskii > > Ping! Eric, any comments about this? Should we install this? > > > Cc: Eric Abrahamsen , 66188@debbugs.gnu.org, > > 64202@debbugs.gnu.org > > Date: Sun, 24 Mar 2024 15:35:18 +0200 > > From: Daniel Semyonov via "Bug reports for GNU Emacs, > > the Swiss army knife of text editors" > > > > >>>>> Daniel Semyonov writes: > > > > > I pushed a few more commits (an updated patch is attached) which fix > > > some edge cases with ephemeral groups and simplify some functions. > > > > And a few more which fix a typo which caused duplicate groups being > > created after renaming a group and relaunching Gnus, and fix the "Web > > Feed Back Ends" subsection in the Gnus manual by making it a > > subsubsection. Updated patch attached. > > > > From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 20 20:47:09 2024 Received: (at 66188) by debbugs.gnu.org; 21 Apr 2024 00:47:09 +0000 Received: from localhost ([127.0.0.1]:39545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryLML-0001e7-6B for submit@debbugs.gnu.org; Sat, 20 Apr 2024 20:47:09 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:50070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryLMH-0001cQ-1s; Sat, 20 Apr 2024 20:47:06 -0400 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id A8267FA183; Sun, 21 Apr 2024 00:46:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1713660403; bh=G8nQNBi+llCet0+M/h6TuewbHFBXkunKKyldZOkS8Kg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=FKKdz/YoYLwdCKPEMsdHHKhmgi07U2RqzBP8AbvCkm8XB1GnIabRCw2pVDMxXbwBo 3TDN9gcb1zOfOdu06duUi4q2y84tPrRIT9Bg4NkX90UrhzVnNbikr/lt+5cn6/X7aD csJQeK0bhEozVihwijLsE39fIY58XatLNMXd7Rj4= From: Eric Abrahamsen To: Eli Zaretskii Subject: Re: bug#66188: 29.1; Include Atom feed reader In-Reply-To: <868r1bf3i1.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 18 Apr 2024 12:01:58 +0300") References: <87v8fhmgvw.fsf@dsemy.com> <87ttohxc56.fsf@dsemy.com> <87le83hcm8.fsf@outlook.com> <87h6io5rr5.fsf@dsemy.com> <87r0hof9ll.fsf_-_@dsemy.com> <87jznfpom1.fsf@gmx.net> <874jejb2sg.fsf@dsemy.com> <87fry2pa1n.fsf@gmx.net> <87ttmhwxby.fsf@dsemy.com> <87wmrd9zcy.fsf@outlook.com> <875xyx5ksi.fsf@dsemy.com> <87sf219ntf.fsf@gmx.net> <87msrtkztg.fsf@outlook.com> <87ttm0mnku.fsf@dsemy.com> <87o7c7b0yf.fsf@dsemy.com> <87le79yl11.fsf@gmx.net> <87sf1eh53p.fsf@dsemy.com> <87ttl3wk81.fsf_-_@dsemy.com> <87il1b7nxl.fsf@dsemy.com> <8634ry50gw.fsf@gnu.org> <868r1bf3i1.fsf@gnu.org> Date: Sat, 20 Apr 2024 17:46:42 -0700 Message-ID: <87mspnlez1.fsf_-_@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66188 Cc: 66188@debbugs.gnu.org, 64202@debbugs.gnu.org, daniel@dsemy.com, jimjoe@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: > Ping! Ping! Eric, any comments? Yes, let's do it! My only comment right now is that the manual should explicitly list the steps for creating an atom group: "B nnatom RET" and insert URL without protocol. I still have dreams of fixing the group creation code to prompt for the address, but that can wait. Daniel, would you make that addition? Do you have push access to the Emacs repo? Eric From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 21 14:43:41 2024 Received: (at 66188) by debbugs.gnu.org; 21 Apr 2024 18:43:43 +0000 Received: from localhost ([127.0.0.1]:44267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rycA0-00008B-B5 for submit@debbugs.gnu.org; Sun, 21 Apr 2024 14:43:41 -0400 Received: from dsemy.com ([46.23.89.208]:21349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryc9s-00006P-2v; Sun, 21 Apr 2024 14:43:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=dkim; bh=cw4wu3Tc+PHe0 c2nP1NEiOzeInvu7O4db26I4ECQ/z8=; h=date:references:in-reply-to: subject:cc:to:from; d=dsemy.com; b=MPbtJ0fTfnz2rbS+6mzrUF8KOaQWY41k1TI CN6gB/FGLExEe+L1h0lajxTokF9L2RAPlq6wzDLLmDZ+yti5PgUj+yCCxCwsMef2nZ2P4Z 7bdNQfZtX04JP+jCHM1N66rokmC5AnzlOY9PadlwU5+lbo0hJOTdM3dzrdFfEXHaSdez+8 czOl8S/YHj27O8XszObkoFGZonZYkU8QrNLMtWhgmRSSU9dL4yhhVQ3KX+hAbtGrKTjRPh yPTgdZK+VNCY+MBvLYWQ5UCciyO8EHqMIph3//wVLTB+iIrxecrtJbz3oUauHqiMGhK+TD 7iLKWByqV5X9OGeFHFBDaMQ37vA== Received: from coldharbour.local ( [147.235.220.9]) by dsemy.com (OpenSMTPD) with ESMTPSA id 7b2fa0de (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 21 Apr 2024 20:43:01 +0200 (CEST) Received: from localhost (coldharbour.local [local]) by coldharbour.local (OpenSMTPD) with ESMTPA id bd6d2ad8; Sun, 21 Apr 2024 18:41:57 +0000 (UTC) From: Daniel Semyonov To: Eric Abrahamsen Subject: Re: bug#66188: 29.1; Include Atom feed reader In-Reply-To: <87mspnlez1.fsf_-_@ericabrahamsen.net> (Eric Abrahamsen's message of "Sat, 20 Apr 2024 17:46:42 -0700") References: <87v8fhmgvw.fsf@dsemy.com> <87le83hcm8.fsf@outlook.com> <87h6io5rr5.fsf@dsemy.com> <87r0hof9ll.fsf_-_@dsemy.com> <87jznfpom1.fsf@gmx.net> <874jejb2sg.fsf@dsemy.com> <87fry2pa1n.fsf@gmx.net> <87ttmhwxby.fsf@dsemy.com> <87wmrd9zcy.fsf@outlook.com> <875xyx5ksi.fsf@dsemy.com> <87sf219ntf.fsf@gmx.net> <87msrtkztg.fsf@outlook.com> <87ttm0mnku.fsf@dsemy.com> <87o7c7b0yf.fsf@dsemy.com> <87le79yl11.fsf@gmx.net> <87sf1eh53p.fsf@dsemy.com> <87ttl3wk81.fsf_-_@dsemy.com> <87il1b7nxl.fsf@dsemy.com> <8634ry50gw.fsf@gnu.org> <868r1bf3i1.fsf@gnu.org> <87mspnlez1.fsf_-_@ericabrahamsen.net> Date: Sun, 21 Apr 2024 21:41:57 +0300 Message-ID: <87sezev9qi.fsf@dsemy.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 66188 Cc: Eli Zaretskii , jimjoe@gmx.net, 66188@debbugs.gnu.org, 64202@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> Eric Abrahamsen writes: > Eli Zaretskii writes: >> Ping! Ping! Eric, any comments? > Yes, let's do it! My only comment right now is that the manual should > explicitly list the steps for creating an atom group: "B nnatom RET" = and > insert URL without protocol. I still have dreams of fixing the group > creation code to prompt for the address, but that can wait. > Daniel, would you make that addition? Does the following text (in the 'Atom' subsection of the Gnus manual) not suffice? The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or local Ato= m feeds as Gnus servers (with a single group), as you would with any other method, by supplying the location of the feed as the server address. Note, however, that the server address shouldn't be prefixed with or . > Do you have push access to the Emacs repo? I do not. Daniel From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 21 23:11:44 2024 Received: (at 66188) by debbugs.gnu.org; 22 Apr 2024 03:11:44 +0000 Received: from localhost ([127.0.0.1]:45319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryk5k-0006Tk-Ls for submit@debbugs.gnu.org; Sun, 21 Apr 2024 23:11:44 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:34426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryk5f-0006SG-LV; Sun, 21 Apr 2024 23:11:37 -0400 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 31836FA059; Mon, 22 Apr 2024 03:11:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1713755474; bh=R2eErjloR/k799I5Z8tcnftYRkTq7AZvUrSFAED5UI0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=I96q4t092UHATaoO5yvI9MN9T2NKF2DqeabLOKsC573FFESq/3+RvADgqPRDDSWTy Tqs2VqU7AlnTLklDrp46hxnfIrbIWnouoB8Qt0lFCVXWvfs6xq49M1E1l+hVwssjQa I6xqEqaUXxV06cGFy9uMZih2FoWenx+p03oBKN7A= From: Eric Abrahamsen To: Daniel Semyonov Subject: Re: bug#66188: 29.1; Include Atom feed reader In-Reply-To: <87sezev9qi.fsf@dsemy.com> (Daniel Semyonov's message of "Sun, 21 Apr 2024 21:41:57 +0300") References: <87v8fhmgvw.fsf@dsemy.com> <87h6io5rr5.fsf@dsemy.com> <87r0hof9ll.fsf_-_@dsemy.com> <87jznfpom1.fsf@gmx.net> <874jejb2sg.fsf@dsemy.com> <87fry2pa1n.fsf@gmx.net> <87ttmhwxby.fsf@dsemy.com> <87wmrd9zcy.fsf@outlook.com> <875xyx5ksi.fsf@dsemy.com> <87sf219ntf.fsf@gmx.net> <87msrtkztg.fsf@outlook.com> <87ttm0mnku.fsf@dsemy.com> <87o7c7b0yf.fsf@dsemy.com> <87le79yl11.fsf@gmx.net> <87sf1eh53p.fsf@dsemy.com> <87ttl3wk81.fsf_-_@dsemy.com> <87il1b7nxl.fsf@dsemy.com> <8634ry50gw.fsf@gnu.org> <868r1bf3i1.fsf@gnu.org> <87mspnlez1.fsf_-_@ericabrahamsen.net> <87sezev9qi.fsf@dsemy.com> Date: Sun, 21 Apr 2024 20:11:12 -0700 Message-ID: <87o7a2jdm7.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66188 Cc: Eli Zaretskii , jimjoe@gmx.net, 66188@debbugs.gnu.org, 64202@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 04/21/24 21:41 PM, Daniel Semyonov wrote: >>>>>> Eric Abrahamsen writes: > > > Eli Zaretskii writes: > >> Ping! Ping! Eric, any comments? > > > Yes, let's do it! My only comment right now is that the manual shou= ld > > explicitly list the steps for creating an atom group: "B nnatom RET= " and > > insert URL without protocol. I still have dreams of fixing the group > > creation code to prompt for the address, but that can wait. > > > Daniel, would you make that addition? > > Does the following text (in the 'Atom' subsection of the Gnus manual) > not suffice? > > The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or local A= tom feeds as > Gnus servers (with a single group), as you would with any other method, > by supplying the location of the feed as the server address. Note, > however, that the server address shouldn't be prefixed with or > . I think we need to at least make it clear that you can't create these groups with "G m", which to me anyway is the "normal" way of making a group. It wouldn't hurt to be more explicit about the fact that feeds are created at the server level, not the group level. I'm not suggesting anything radical, something like: --8<---------------cut here---------------start------------->8---=20 The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or local Atom = feeds as Gnus servers, in your Gnus init files or as foreign servers via "B" in the *Group* buffer. The feed location is supplied as the server address, and each server only contains a single group. Note, however, that the server address shouldn't be prefixed with or . --8<---------------cut here---------------end--------------->8--- Or something like that. WDYT? From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 22 18:46:23 2024 Received: (at 66188) by debbugs.gnu.org; 22 Apr 2024 22:46:24 +0000 Received: from localhost ([127.0.0.1]:48299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rz2QU-0005lu-Fu for submit@debbugs.gnu.org; Mon, 22 Apr 2024 18:46:23 -0400 Received: from dsemy.com ([46.23.89.208]:28353) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rz2QN-0005kv-Ny; Mon, 22 Apr 2024 18:46:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=dkim; bh=QoSKBSQIUn8Vr gMetafXOJNXHkAfWBeFR/IBiHICfeo=; h=date:references:in-reply-to: subject:cc:to:from; d=dsemy.com; b=l06KXr6rYfh2qX8GdJOuqLM3HdpoalHcfj7 Cqta1h7AJl0nB0FsEjnaK6JGov/8Pft24ADxdQlU6pwhAPH02dq6c11vytPLsh2QV6z3H/ c9CjVGHPjvF3TWTBGpEkOOJlmIUapfvqnSMSi31qn/DqlM5bf0SdGeEyjA01KpLASah+C9 ZgHklI2EPxfi3vg72Yz9EhFtoyidKvruv1ONVW0HTCh9YoDjeARPzEV/vRV6AsuOTw40F+ UqlxzPWsAnpHbHycsi2+RB+CAE0BNyG4ohyW6cSROBwZkvJYimGzmA+NNbHICyk2axK020 EVRVAOsaGZw9fj5awzYi/jFAZzw== Received: from coldharbour.local ( [147.235.220.9]) by dsemy.com (OpenSMTPD) with ESMTPSA id 0b5c5fb0 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 23 Apr 2024 00:45:48 +0200 (CEST) Received: from localhost (coldharbour.local [local]) by coldharbour.local (OpenSMTPD) with ESMTPA id f7fa5824; Mon, 22 Apr 2024 22:44:44 +0000 (UTC) From: Daniel Semyonov To: Eric Abrahamsen Subject: Re: bug#66188: 29.1; Include Atom feed reader In-Reply-To: <87o7a2jdm7.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 21 Apr 2024 20:11:12 -0700") References: <87v8fhmgvw.fsf@dsemy.com> <87r0hof9ll.fsf_-_@dsemy.com> <87jznfpom1.fsf@gmx.net> <874jejb2sg.fsf@dsemy.com> <87fry2pa1n.fsf@gmx.net> <87ttmhwxby.fsf@dsemy.com> <87wmrd9zcy.fsf@outlook.com> <875xyx5ksi.fsf@dsemy.com> <87sf219ntf.fsf@gmx.net> <87msrtkztg.fsf@outlook.com> <87ttm0mnku.fsf@dsemy.com> <87o7c7b0yf.fsf@dsemy.com> <87le79yl11.fsf@gmx.net> <87sf1eh53p.fsf@dsemy.com> <87ttl3wk81.fsf_-_@dsemy.com> <87il1b7nxl.fsf@dsemy.com> <8634ry50gw.fsf@gnu.org> <868r1bf3i1.fsf@gnu.org> <87mspnlez1.fsf_-_@ericabrahamsen.net> <87sezev9qi.fsf@dsemy.com> <87o7a2jdm7.fsf@ericabrahamsen.net> Date: Tue, 23 Apr 2024 01:44:44 +0300 Message-ID: <871q6xuieb.fsf@dsemy.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66188 Cc: Eli Zaretskii , jimjoe@gmx.net, 66188@debbugs.gnu.org, 64202@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>>>> Eric Abrahamsen writes: > On 04/21/24 21:41 PM, Daniel Semyonov wrote: >>>>>>> Eric Abrahamsen writes: >>=20 >> > Eli Zaretskii writes: >> >> Ping! Ping! Eric, any comments? >>=20 >> > Yes, let's do it! My only comment right now is that the manual sho= uld >> > explicitly list the steps for creating an atom group: "B nnatom RE= T" and >> > insert URL without protocol. I still have dreams of fixing the gro= up >> > creation code to prompt for the address, but that can wait. >>=20 >> > Daniel, would you make that addition? >>=20 >> Does the following text (in the 'Atom' subsection of the Gnus manual) >> not suffice? >>=20 >> The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or loca= l Atom feeds as >> Gnus servers (with a single group), as you would with any other meth= od, >> by supplying the location of the feed as the server address. Note, >> however, that the server address shouldn't be prefixed with or >> . > I think we need to at least make it clear that you can't create these > groups with "G m", which to me anyway is the "normal" way of making a > group. It wouldn't hurt to be more explicit about the fact that feeds > are created at the server level, not the group level. I'm not suggest= ing > anything radical, something like: > --8<---------------cut here---------------start------------->8---=20 > The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or local= Atom feeds as Gnus > servers, in your Gnus init files or as foreign servers via "B" in the > *Group* buffer. The feed location is supplied as the server address, = and > each server only contains a single group. Note, however, that the ser= ver > address shouldn't be prefixed with or . > --8<---------------cut here---------------end--------------->8--- > Or something like that. WDYT? I gave it another thought and you're right, it should be more explicit. I've attached an updated patch but here's the new version of the paragraph (since I actually ended up being even more explicit): The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or local Ato= m feeds as Gnus servers, by adding them to =E2=80=98gnus-secondary-select-methods=E2= =80=99 or as foreign servers by pressing "B" in the =E2=80=98*Group*=E2=80=99 buffer, = for example (*note Finding the News). The address of each server is its feed's location (though the address shouldn't be prefixed with or ) and each server contains a single group which holds the feed's entries. Daniel --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Gnus-Add-back-end-for-Atom-feeds-nnatom.patch Content-Description: patch >From 58486c54878ec0496fc5006406a6a3dd4ffae033 Mon Sep 17 00:00:00 2001 From: Daniel Semyonov Date: Wed, 21 Jun 2023 10:05:04 +0300 Subject: [PATCH] Gnus: Add back end for Atom feeds (nnatom) * lisp/gnus/gnus.el (gnus-valid-select-methods): Add entry for nnatom. * lisp/gnus/nnfeed.el: New file implementing an abstract web feed back end. * lisp/gnus/nnatom.el: New file implementing a back end for Atom feeds. * doc/misc/gnus.texi (Browsing the Web, Back End Interface): * etc/NEWS (Gnus): Document nnatom and nnfeed. --- doc/misc/gnus.texi | 77 +++++ etc/NEWS | 10 + lisp/gnus/gnus.el | 1 + lisp/gnus/nnatom.el | 276 ++++++++++++++++++ lisp/gnus/nnfeed.el | 683 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 1047 insertions(+) create mode 100644 lisp/gnus/nnatom.el create mode 100644 lisp/gnus/nnfeed.el diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 419a5390374..8aa7f855aea 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -715,6 +715,7 @@ Top * Web Searches:: Creating groups from articles that match a string. * RSS:: Reading RDF site summary. +* Atom:: Reading Atom Syndication Format feeds. Other Sources @@ -975,6 +976,7 @@ Top * Writing New Back Ends:: Extending old back ends. * Hooking New Back Ends Into Gnus:: What has to be done on the Gnus end. * Mail-like Back Ends:: Some tips on mail back ends. +* Web Feed Back Ends:: Easily defining back ends for web feeds. Various File Formats @@ -17252,6 +17254,7 @@ Browsing the Web @menu * Web Searches:: Creating groups from articles that match a string. * RSS:: Reading RDF site summary. +* Atom:: Reading Atom Syndication Format feeds. @end menu The main caveat with all these web sources is that they probably won't @@ -17496,6 +17499,42 @@ RSS @end lisp +@node Atom +@subsection Atom +@cindex nnatom +@cindex Atom + +Some web sites provide an Atom Syndication Format feed. Atom is a web +feed format similar in function to RDF Site Summary (@pxref{RSS}). + +The @code{nnatom} back end allows you to add HTTP or local Atom feeds as +Gnus servers, by adding them to @code{gnus-secondary-select-methods} or +as foreign servers by pressing "B" in the @file{*Group*} buffer, for +example (@pxref{Finding the News}). The address of each server is its +feed's location (though the address shouldn't be prefixed with or +) and each server contains a single group which holds the +feed's entries. + +Features of @code{nnatom} include: + +@itemize @bullet + +@item +Server data is saved per-server in the @file{atom} sub-directory of +@file{gnus-directory}. + +@item +An article part is generated for both the summary and the content for +each entry in the feed. Content of all MIME types should be displayed +correctly through Gnus (as long as they are supported and the feed +specifies a MIME type). + +@item +Article modification and publish dates are tracked, and articles are +updated if changed. + +@end itemize + @node Other Sources @section Other Sources @@ -29997,6 +30036,7 @@ Back End Interface * Writing New Back Ends:: Extending old back ends. * Hooking New Back Ends Into Gnus:: What has to be done on the Gnus end. * Mail-like Back Ends:: Some tips on mail back ends. +* Web Feed Back Ends:: Easily defining back ends for web feeds. @end menu @@ -30770,6 +30810,43 @@ Mail-like Back Ends @end example +@node Web Feed Back Ends +@subsubsection Web Feed Back Ends + +If you want to write a back end for a new type of web feed (RSS, +Atom), or some other type of feed, an ``abstract'' back end +(@code{nnfeed}) exists to enable the creation of such back ends with +minimal knowledge of Gnus. + +@code{nnfeed} defines a generic parser, which uses functions stored in +server variables to parse information from a feed (@code{nnfeed} +itself doesn't actually define any such functions though). + +The data parsed from the feed is stored in server variables (and +stored per-feed in a sub-directory of @option{gnus-directory} whose name +corresponds to the name of the back end). + +A Gnus back end interface is also defined, which uses the data parsed +from the feed. + +Therefore, a new back end only needs to inherit from @code{nnfeed}, +define (fairly) generic parsing functions for the feed type and setup +the required server variables. + +@code{nnfeed} was originally created to support Atom Syndication +Format feeds (@pxref{Atom}), but is very generic (as of writing this, +no standard web feed exists which can meaningfully use all the +features supported): it supports multiple groups contained in a single +feed, it allows for situations when the entire feed can't (or +shouldn't) be read ahead of time and it allows for very advanced +customization of the actual printing of articles from parsed data +(while providing a reasonably powerful default method). + +Further implementation details are available in the documentation +strings of the various @code{nnfeed-*} server variables and +the commentary and other comments of @file{nnfeed.el}. + + @node Score File Syntax @subsection Score File Syntax diff --git a/etc/NEWS b/etc/NEWS index 82c73f7416b..fea27bb8a31 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1337,6 +1337,16 @@ when using the ':vc' keyword. ** Gnus ++++ +*** New back end 'nnfeed'. +This allows back end developers to easily create new back ends for web +feeds, as inheriting back ends of 'nnfeed'. + ++++ +*** New back end 'nnatom'. +This allow users to add Atom Syndication Format feeds to Gnus as +servers. + *** The 'nnweb-type' option 'gmane' has been removed. The gmane.org website is, sadly, down since a number of years with no prospect of it coming back. Therefore, it is no longer valid to set diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index dab66b60205..bc8819dc967 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -1360,6 +1360,7 @@ gnus-valid-select-methods ("nnimap" post-mail address prompt-address physical-address respool server-marks cloud) ("nnmaildir" mail respool address server-marks) + ("nnatom" address) ("nnnil" none)) "An alist of valid select methods. The first element of each list lists should be a string with the name diff --git a/lisp/gnus/nnatom.el b/lisp/gnus/nnatom.el new file mode 100644 index 00000000000..e8dfa12aff5 --- /dev/null +++ b/lisp/gnus/nnatom.el @@ -0,0 +1,276 @@ +;;; nnatom.el --- Atom backend for Gnus -*- lexical-binding: t -*- + +;; Copyright (C) 2023 Free Software Foundation, Inc. +;; Author: Daniel Semyonov + +;; This file is part of GNU Emacs. + +;; nnatom 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. + +;; nnatom 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 nnatom. If not, see . + +;;; Commentary: + +;; Gnus backend for HTTP or local feeds following the +;; Atom Syndication Format . + +;;; Code: + +(eval-when-compile + (require 'cl-lib) + (require 'subr-x)) + +(require 'nnfeed) +(require 'mm-url) +(require 'dom) + +(defgroup nnatom nil + "Atom backend for Gnus." + :group 'nnfeed) + +(nnoo-declare nnatom nnfeed) + +(nnfeed-define-basic-backend-interface nnatom) + +;;;; Atom feed parser: + +(defun nnatom--read-feed (feed _) + "Return a list structure representing FEED, or nil." + (if (string-match-p "\\`https?://" feed) + (nnheader-report + nnatom-backend + "Address shouldn't start with \"http://\" or \"https://\"") + (with-temp-buffer + (condition-case e + (if (file-name-absolute-p feed) + (insert-file-contents feed) + (mm-url-insert-file-contents (concat "https://" feed))) + (file-error (nnheader-report nnatom-backend (cdr e))) + (:success (when-let ((data (if (libxml-available-p) + (libxml-parse-xml-region + (point-min) (point-max)) + (car (xml-parse-region + (point-min) (point-max))))) + (authors (list 'authors))) + (when (eq (car data) 'top) + (setq data (assq 'feed data))) + (dom-add-child-before data authors) + (let ((all (dom-children data))) + (while-let ((rest (cdr all)) + (child (car-safe rest)) + (type (car-safe child)) + ((not (eq type 'entry)))) + (and (or (eq type 'author) + (eq type 'contributor)) + (dom-add-child-before authors child)) + (setq all rest)) + ;; Order of entries is reversed as most Atom feeds + ;; list only the "most recent" entries, in reverse + ;; chronological order. + (setcdr all (nreverse (cdr all)))) + data)))))) +(defvoo nnatom-read-feed-function #'nnatom--read-feed + nil nnfeed-read-feed-function) + +(defun nnatom--read-group (data) + "Return the next group and the remaining DATA in a cons cell, or nil." + `(,data)) +(defvoo nnatom-read-group-function #'nnatom--read-group + nil nnfeed-read-group-function) + +(defun nnatom--read-article (data _) + "Return the next article and the remaining DATA in a cons cell, or nil." + (when (eq (car data) 'feed) (setq data (dom-children data))) + ;; Discard any children between/after entries. + (while (and data (not (eq (car-safe (car data)) 'entry))) (pop data)) + (when-let ((article (car data)) + (auths (list 'authors)) (links (list 'links))) + (dom-add-child-before article links) + (dom-add-child-before article auths) + (dolist (child (cddddr article) `(,article . ,(cdr data))) + (pcase (car-safe child) ; Authors and links can appear + ((or 'author 'contributor) ; anywhere in the entry so we + (dom-add-child-before auths child) ; collect them all here to + (dom-add-child-before links child)) ; avoid looping over the + ((or 'link ; entry multiple times later. + (and 'content (guard (assq 'src (dom-attributes child))))) + (dom-add-child-before links child)))))) +(defvoo nnatom-read-article-function #'nnatom--read-article + nil nnfeed-read-article-function) + +(defun nnatom--read-title (group) + "Return the title of GROUP, or nil." + (dom-text (dom-child-by-tag group 'title))) +(defvoo nnatom-read-title-function #'nnatom--read-title + nil nnfeed-read-title-function) + +(defun nnatom--read-description (group) + "Return the description of GROUP, or nil." + (dom-text (dom-child-by-tag group 'subtitle))) +(defvoo nnatom-read-description-function #'nnatom--read-description + nil nnfeed-read-description-function) + +(defun nnatom--read-article-or-group-authors (article-or-group) + "Return the authors of ARTICLE-OR-GROUP, or nil." + (when-let + ((a (mapconcat + (lambda (author) + (let* ((name (dom-text (dom-child-by-tag author 'name))) + (name (unless (string-blank-p name) name)) + (email (dom-text (dom-child-by-tag author 'email))) + (email (unless (string-blank-p email) email))) + (or (and name email (format "%s <%s>" name email)) name email))) + (dom-children (dom-child-by-tag article-or-group 'authors)) + ", ")) + ((not (string-blank-p a)))) + a)) +(defvoo nnatom-read-author-function #'nnatom--read-article-or-group-authors + nil nnfeed-read-author-function) +(defvoo nnatom-read-group-author-function + #'nnatom--read-article-or-group-authors + nil nnfeed-read-group-author-function) + +(defun nnatom--read-subject (article) + "Return the subject of ARTICLE, or nil." + (dom-text (dom-child-by-tag article 'title))) +(defvoo nnatom-read-subject-function #'nnatom--read-subject + nil nnfeed-read-subject-function) + +(defun nnatom--read-id (article) + "Return the ID of ARTICLE. +If the ARTICLE doesn't contain an ID but it does contain a subject, +return the subject. Otherwise, return nil." + (or (dom-text (dom-child-by-tag article 'id)) + (nnatom--read-subject article))) +(defvoo nnatom-read-id-function #'nnatom--read-id + nil nnfeed-read-id-function) + +(defun nnatom--read-publish (article) + "Return the date and time ARTICLE was published, or nil." + (when-let (d (dom-child-by-tag article 'published)) + (date-to-time (dom-text d)))) +(defvoo nnatom-read-publish-date-function #'nnatom--read-publish + nil nnfeed-read-publish-date-function) + +(defun nnatom--read-update (article) + "Return the date and time of the last update to ARTICLE, or nil." + (when-let (d (dom-child-by-tag article 'updated)) + (date-to-time (dom-text d)))) +(defvoo nnatom-read-update-date-function #'nnatom--read-update + nil nnfeed-read-update-date-function) + +(defun nnatom--read-links (article) + "Return all links contained in ARTICLE, or nil." + (let ((alt 0) (rel 0) (sel 0) (enc 0) (via 0) (aut 0)) + (mapcan + (lambda (link) + (when-let ((l (car-safe link))) + (or + (when-let (((eq l 'content)) + (src (dom-attr link 'src)) + (label (concat "Link" + (and (< 1 (cl-incf alt)) + (format " %s" alt))))) + `(((("text/plain") . ,(format "%s: %s\n" label src)) + (("text/html") . ,(format "[%s] " + src label))))) + (when-let (((or (eq l 'author) (eq l 'contributor))) + (name (dom-text (dom-child-by-tag link 'name))) + (name (if (string-blank-p name) + (concat "Author" + (and (< 1 (cl-incf aut)) + (format " %s" aut))) + name)) + (uri (dom-text (dom-child-by-tag link 'uri))) + ((not (string-blank-p uri)))) + `(((("text/plain") . ,(format "%s: %s\n" name uri)) + (("text/html") . ,(format "[%s] " + uri name))))) + (when-let (((eq l 'link)) + (attrs (dom-attributes link)) + (label (or (cdr (assq 'title attrs)) + (pcase (cdr (assq 'rel attrs)) + ("related" + (concat "Related" + (and (< 1 (cl-incf rel)) + (format " %s" rel)))) + ("self" + (concat "More" + (and (< 1 (cl-incf sel)) + (format " %s" sel)))) + ("enclosure" + (concat "Enclosure" + (and (< 1 (cl-incf enc)) + (format " %s" enc)))) + ("via" + (concat "Source" + (and (< 1 (cl-incf via)) + (format " %s" via)))) + (_ (if-let + ((lang (cdr (assq 'hreflang link)))) + (format "Link (%s)" lang) + (concat + "Link" + (and (< 1 (cl-incf alt)) + (format " %s" alt)))))))) + (link (cdr (assq 'href attrs)))) + `(((("text/plain") . ,(format "%s: %s\n" label link)) + (("text/html") . ,(format "[%s] " + link label)))))))) + (dom-children (dom-child-by-tag article 'links))))) +(defvoo nnatom-read-links-function #'nnatom--read-links + nil nnfeed-read-links-function) + +(defun nnatom--read-part (part type) + (let* ((atypes '("html" "plain")) + (mtypes '(("xhtml" . "text/html") ("text" . "text/plain"))) + (xsuff (concat "[+/]xml\\(-\\(dtd\\|external-parsed-entity\\)\\)?\\'" + "\\|^text")) + (part (if (string= type "xhtml") + (with-temp-buffer + (dom-print (dom-child-by-tag part 'div) nil t) + (buffer-substring-no-properties + (point-min) (point-max))) + (dom-text part))) + (type (if (member type atypes) (concat "text/" type) type)) + (type (or (cdr (assoc type mtypes)) type))) + (unless (string-blank-p part) + `(,part (Content-Type . ,(or type (setq type "text/plain"))) + ,(and (not (string-match-p xsuff type)) + '(Content-Transfer-Encoding . "base64")))))) + +(defun nnatom--read-parts (article) + "Return all parts contained in ARTICLE, or an empty HTML part with links." + (let* ((summary (dom-child-by-tag article 'summary)) + (stype (cdr (assq 'type (dom-attributes summary)))) + (summary (nnatom--read-part summary stype)) + (content (dom-child-by-tag article 'content)) + (ctype (cdr (assq 'type (dom-attributes content)))) + (content (nnatom--read-part content ctype)) + (st (string= stype ctype)) + parts) + (cond ((and summary content) + (and st (push summary parts)) + (push (append content '(links)) parts) + (or st (push summary parts))) + ((setq content (or summary content)) + (push (append content '(links)) parts)) + (t (push '((nil (Content-Type . "text/html") links)) parts))) + parts)) +(defvoo nnatom-read-parts-function #'nnatom--read-parts + nil nnfeed-read-parts-function) + +(gnus-declare-backend (symbol-name nnatom-backend) 'address) + +(provide 'nnatom) + +;;; nnatom.el ends here diff --git a/lisp/gnus/nnfeed.el b/lisp/gnus/nnfeed.el new file mode 100644 index 00000000000..0bf599553e4 --- /dev/null +++ b/lisp/gnus/nnfeed.el @@ -0,0 +1,683 @@ +;;; nnfeed.el --- Generic feed backend for Gnus -*- lexical-binding: t -*- + +;; Copyright (C) 2023 Free Software Foundation, Inc. +;; Author: Daniel Semyonov + +;; This file is part of GNU Emacs. + +;; nnfeed 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. + +;; nnfeed 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 nnfeed. If not, see . + +;;; Commentary: + +;; Generic Gnus backend (intended) for implementing backends for web +;; feeds (Atom, RSS). +;; +;; This backend is abstract - it doesn't implement a parser for any +;; specific web feed type, and so can't be used independently. +;; +;; Instead, it implements a generic parser, feed data storage and most +;; of the Gnus backend interface; the intended use for this backend is +;; to be a source of inheritance for backends supporting new web feed +;; types. +;; +;; To implement new backends, use `nnfeed-define-basic-backend-interface': +;; +;; ... +;; (require 'nnfeed) +;; +;; (nnoo-declare nnfoo nnfeed) +;; +;; (nnfeed-define-basic-backend-interface nnfoo) +;; ... +;; [ definitions of parsing functions, see the "Feed parser interface" +;; section for more information. ] +;; +;; (defvoo nnfoo-read-feed-function #'nnfoo--read-feed +;; nil nnfeed-read-feed-function) +;; ... +;; (gnus-declare-backend (symbol-name nnfeed-backend) 'address) +;; +;; (provide 'nnfoo) +;; +;;; Code: + +(eval-when-compile + (require 'subr-x)) + +(require 'gnus) +(require 'nnoo) + +(defgroup nnfeed nil + "Generic feed backend for Gnus." + :group 'gnus) + +(defcustom nnfeed-date-format "%F %X%p" + "Format of displayed dates (see function `format-time-string')." + :type 'string) + +(nnoo-declare nnfeed) + +(defvoo nnfeed-backend nil + "Symbol which identifies this backend.") + +(defvoo nnfeed-status-string nil + "Last status message reported by this backend.") + +;; This macro should be used to define inheriting backends. + +(defmacro nnfeed-define-basic-backend-interface (backend) + "Define a basic set of functions and variables for BACKEND." + `(progn + (defvoo ,(nnoo-symbol backend 'backend) ',backend nil nnfeed-backend) + (defvoo ,(nnoo-symbol backend 'status-string) + nil nil nnfeed-status-string) + (defvoo ,(nnoo-symbol backend 'group) nil nil nnfeed-group) + (defvoo ,(nnoo-symbol backend 'servers) + (make-hash-table :test 'equal) nil nnfeed-servers) + (defvoo ,(nnoo-symbol backend 'group-article-ids) + (make-hash-table :test 'equal) nil nnfeed-group-article-ids) + (defvoo ,(nnoo-symbol backend 'group-articles) + (make-hash-table :test 'eql) nil nnfeed-group-articles) + (defvoo ,(nnoo-symbol backend 'group-article-max-num) 0 nil + nnfeed-group-article-max-num) + (defvoo ,(nnoo-symbol backend 'group-article-mix-num) 1 nil + nnfeed-group-article-min-num) + ,@(mapcar (lambda (fun) + `(deffoo ,(nnoo-symbol backend fun) (&optional server) + (,(nnoo-symbol 'nnoo fun) ',backend server))) + '(server-opened status-message)) + (deffoo ,(nnoo-symbol backend 'open-server) (server &optional defs) + (nnfeed-open-server server defs ',backend)) + (nnoo-import ,backend (nnfeed)))) + +;;;; Feed parser interface: + +;; The following set of server variables define a parser for a +;; specific web feed type. +;; An inheriting backend doesn't necessarily have to define all of +;; these functions (see the comments below for more information). +;; Apart from this set of variables there is also +;; `nnfeed-print-content-function' which can optionally be defined +;; by an inheriting backend to allow more advanced control over the +;; printing of articles. + +(defvoo nnfeed-read-feed-function #'ignore + "Function returning a Lisp object representing a feed (or part of it). + +It should accept two arguments, the address of a feed and the name of +a group (or nil). +If a group name is supplied, it should return a representation of only +the group (as if it was extracted from the feed with +`nnfeed-read-group-function').") + +(defvoo nnfeed-read-group-function #'ignore + "Function returning a cons cell of a group and remaining data from a feed. + +The returned group can be represented by any Lisp object. +It should accept a single argument, a Lisp object representing a feed +\(as can be returned by this function or `nnfeed-read-feed-function').") + +(defvoo nnfeed-read-article-function #'ignore + "Function returning a cons cell of an article and remaining data from a group. + +The returned article can be represented by any Lisp object. +It should accept two arguments, a Lisp object representing a group +\(as can be returned by this function or `nnfeed-read-group-function'), +and a flag indicating whether the last article was not new or updated.") + +(defvoo nnfeed-read-title-function #'ignore + "Function returning the title of a group (a string). + +It should accept a single argument, a Lisp object representing a group +\(as returned by `nnfeed-read-group-function').") + +;; Optional. +(defvoo nnfeed-read-description-function #'ignore + "Function returning the description of a group (a string), or nil. + +It should accept a single argument, a Lisp object representing a group +\(as returned by `nnfeed-read-group-function').") + +;; Either this function or `nnfeed-read-author-function' is required. +(defvoo nnfeed-read-group-author-function #'ignore + "Function returning the author of a group (a string), or nil. + +It should accept a single argument, a Lisp object representing a group +\(as returned by `nnfeed-read-group-function')..") + +(defvoo nnfeed-read-id-function #'ignore + "Function returning the ID of an article. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +(defvoo nnfeed-read-subject-function #'ignore + "Function returning the subject of an article (a string), or nil. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;; Either this function or `nnfeed-read-update-date-function' is required. +(defvoo nnfeed-read-publish-date-function #'ignore + "Function returning the publish date of an article (a time value), or nil. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;; Either this function or `nnfeed-read-publish-date-function' is required. +(defvoo nnfeed-read-update-date-function #'ignore + "Function returning the update date of an article (a time value), or nil. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;; Either this function or `nnfeed-read-group-author-function' is required. +(defvoo nnfeed-read-author-function #'ignore + "Function returning the author of an article (a string), or nil. + +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +(defvoo nnfeed-read-headers-function #'ignore + "Function returning an alist of article-wide MIME headers. + +Each element of this alist maps a MIME header (a symbol, +i.e. `Content-Type') to its value. As a special case, `:boundary' +maps to a string which will serve as the boundary between article +parts. This must be supplied if a custom boundary is used in a +multipart content type header. The default boundary is \"-_nnfeed_-\", +and is automatically modified to match the name of the back end. +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;; As mentioned in their docstrings, the last two parsing functions +;; can optionally return any Lisp representation they want, provided +;; an appropriate `nnfeed-print-content-function' is defined. This +;; means they are also not _strictly_ required. + +(defvoo nnfeed-read-links-function #'ignore + "Function returning all links contained in an article. + +With the default `nnfeed-print-content-function', it should return a +list of links, where each link is an alist mapping MIME content types +to links formatted for display in a part of that type. Each content +type may also be a list of content types. +Otherwise, it could return any Lisp object. +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +(defvoo nnfeed-read-parts-function #'ignore + "Function returning an alist associating parts of an article to their headers. + +With the default `nnfeed-print-content-function', each part should be a +string. Otherwise, it can be any Lisp object. The \"headers\" of +each part should be a list where each element is either a cons of a +MIME header (a symbol, i.e. `Content-Type') and its value (a string), +or any other Lisp object. MIME headers will be printed, the rest will +be passed on to `nnfeed-print-content-function', which recognizes the +following extra data by default: +- `links', if present, will cause links to be printed in the part. +It should accept a single argument, a Lisp object representing an article +\(as returned by `nnfeed-read-article-function').") + +;;;; Feed data storage: + +;; This section defines the data types used to store feed data, and +;; functions to read and write it. +;; All variables in this section are automatically defined by +;; `nnfeed-define-basic-backend-interface'. + +(defvoo nnfeed-servers (make-hash-table :test 'equal) + "Hash table mapping known servers to their groups. + +Each value in this table should itself be a hash table mapping known +group names to their data, which should be a vector of the form +[GROUP IDS ARTICLES MAX MIN DESCRIPTION], where: +- GROUP is the \"real\" group name (the name known to the server). +- IDS is a hash table mapping article IDs to their numbers. +- ARTICLES is a hash table mapping article numbers to articles and + their attributes (see `nnfeed-group-articles'). +- MAX is the maximum article number. +- MIN is the minimum article number. +- DESCRIPTION is the group description.") + +(defvoo nnfeed-group-names (make-hash-table :test 'equal) + "Hash table mapping real group names to their custom name.") + +(defun nnfeed--server-address (server) + "Return SERVER's real address." + (if (string-suffix-p "-ephemeral" server) + (setq server (or (cadr (assq (nnoo-symbol nnfeed-backend 'address) + (cddr (gnus-server-to-method + (concat + (symbol-name nnfeed-backend) ":" + server))))) + server)) + server)) + +(defun nnfeed--server-file (server) + "Return the file containing data for SERVER." + (expand-file-name (format "%s/%s.eld" + (string-trim (symbol-name nnfeed-backend) + "nn") + (gnus-newsgroup-savable-name + (nnfeed--server-address server))) + gnus-directory)) + +(defun nnfeed--read-server (server) + "Read SERVER's information from storage." + (if-let ((f (nnfeed--server-file server)) + ((file-readable-p f))) + (with-temp-buffer + (insert-file-contents f) + (goto-char (point-min)) + (puthash server (read (current-buffer)) nnfeed-servers)) + (nnheader-report nnfeed-backend "Can't read %s" server))) + +(defun nnfeed--write-server (server) + "Write SERVER's information to storage." + (if-let ((f (nnfeed--server-file server)) + ((file-writable-p f))) + (if-let ((s (gethash server nnfeed-servers)) + ((hash-table-p s))) + (with-temp-file f + (insert ";;;; -*- mode: lisp-data -*- DO NOT EDIT\n") + (prin1 s (current-buffer)) + (insert "\n") + t) + t) + (nnheader-report nnfeed-backend "Can't write %s" f))) + +;; The following function uses the parsing functions defined in the last +;; section to parse a feed (or just one group from it). +;; This is the only place where these parsing functions are used; the Gnus +;; backend interface extracts all required information from the parsed feed. + +(defun nnfeed--parse-feed (feed &optional group) + "Parse GROUP from FEED into a new or existing server. +If GROUP is omitted or nil, parse the entire FEED." + (let* ((feed (nnfeed--server-address feed)) + (s (or (gethash feed nnfeed-servers) (nnfeed--read-server feed) + (make-hash-table :test 'equal))) + (name group) ; (Maybe) fake name (or nil) + (group (aref (gethash group s `[,group]) 0)) ; Real name (or nil) + data) + (when (setq data (funcall nnfeed-read-feed-function feed group)) + (while-let ((cg (or (and name (cons data)) ; `data' is a single group + (funcall nnfeed-read-group-function data))) + (cg (prog1 (car cg) (setq data (cdr cg))))) + (let* ((name (funcall nnfeed-read-title-function cg)) ; Real name + (group (gethash name nnfeed-group-names name)) ; (Maybe) fake name + (info (gnus-get-info + (concat (symbol-name nnfeed-backend) "+" feed ":" group))) + (g (or (gethash group s) + `[ ,name ,(make-hash-table :test 'equal) + ,(make-hash-table :test 'eql) nil 1 ""])) + (desc (funcall nnfeed-read-description-function cg)) + (ids (aref g 1)) + (articles (aref g 2)) + (max (aref g 3)) + (max (if max max + (setq max 0) ; Find max article number + (dolist ; remembered by Gnus. + ( r (cons (gnus-info-read info) + (gnus-info-marks info)) + max) + (mapc (lambda (x) + (let ((x (if (consp x) + (if (< (car x) (cdr x)) + (cdr x) (car x)) + x))) + (when (< max x) (setq max x)))) + (if (symbolp (car r)) (cdr r) r))))) + (group-author (funcall nnfeed-read-group-author-function cg)) + stale) + (and desc (aset g 5 desc)) + (while-let ((article (funcall nnfeed-read-article-function cg stale)) + (article (prog1 (car article) (setq cg (cdr article))))) + (when-let ((id (funcall nnfeed-read-id-function article)) + (id (format "<%s@%s.%s>" id name nnfeed-backend))) + (let* ((num (gethash id ids)) + (update (funcall nnfeed-read-update-date-function article)) + (prev-update (aref (gethash num articles + '[nil nil nil nil nil]) + 4))) + (if (or (null num) ; New article ID. + (and (null prev-update) update) + (and prev-update update + (time-less-p prev-update update))) + (let* ((num (or num (aset g 3 (setq max (1+ max))))) + (publish (funcall nnfeed-read-publish-date-function + article))) + (setf + (gethash id (aref g 1)) num + (gethash num (aref g 2)) + `[ ,id + ,(or (funcall nnfeed-read-author-function article) + group-author group) + ,(or (funcall nnfeed-read-subject-function article) + "no subject") + ,(or publish update '(0 0)) ; published + ,(or update publish '(0 0)) ; updated + ,(funcall nnfeed-read-links-function article) + ,(funcall nnfeed-read-parts-function article) + ,(funcall nnfeed-read-headers-function article)] + stale nil)) + (setq stale t))))) + (puthash group g s))) + (puthash feed s nnfeed-servers)))) + +;;;; Gnus backend functions: + +;; The following two sections define a Gnus backend interface based on +;; the parsed data from the last section. +;; All server variables in this section are automatically defined by +;; `nnfeed-define-basic-backend-interface'. +;; For more information about these functions see the "Back End +;; Interface" section of the Gnus manual. + +(defvoo nnfeed-group nil + "Name of the current group.") + +(defvoo nnfeed-group-article-ids (make-hash-table :test 'equal) + "Hash table mapping article IDs to their article number.") + +(defvoo nnfeed-group-articles (make-hash-table :test 'eql) + "Hash table mapping article numbers to articles and their attributes. + +Each value in this table should be a vector of the form +[ID FROM SUBJECT DATE UPDATED LINKS PARTS HEADERS], where: +- ID is the ID of the article. +- FROM is the author of the article or group. +- SUBJECT is the subject of the article. +- DATE is the date the article was published, or last updated (time value). +- UPDATE is the date the article was last updated, or published (time value). +- LINKS is a collection of links (any Lisp object). +- PARTS is an alist associating the content of each part of the + article to its headers. +- HEADERS is an alist associating article-wide MIME headers to their value.") + +(defvoo nnfeed-group-article-max-num 0 + "Maximum article number for the current group.") + +(defvoo nnfeed-group-article-min-num 1 + "Minimum article number for the current group.") + +(nnoo-define-basics nnfeed) + +(defun nnfeed--current-server-no-prefix () + "Remove the \"+\" prefix from the current server." + (string-remove-prefix (concat (symbol-name nnfeed-backend) "+") + (nnoo-current-server nnfeed-backend))) + +(defun nnfeed--group-data (group server) + "Get parsed data for GROUP from SERVER." + (when-let ((server (nnfeed--server-address server)) + (s (gethash server nnfeed-servers)) + ((hash-table-p s))) + (gethash group s))) + +(defun nnfeed-retrieve-article (article group) + "Retrieve headers for ARTICLE from GROUP." + (if-let ((a (gethash article (aref group 2)))) + (insert (format "221 %s Article retrieved. +From: %s\nSubject: %s\nDate: %s\nMessage-ID: %s\n.\n" + article + (aref a 1) + (aref a 2) + (format-time-string "%F %H:%M" (aref a 3)) + (aref a 0))) + (insert "404 Article not found.\n.\n"))) + +(deffoo nnfeed-retrieve-headers (articles &optional group server _fetch-old) + (if-let ((server (or server (nnfeed--current-server-no-prefix))) + (g (or (nnfeed--group-data group server) + `[ nil ,nnfeed-group-article-ids ,nnfeed-group-articles + nil nil nil]))) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (or (and (stringp (car articles)) + (mapc (lambda (a) + (nnfeed-retrieve-article + (gethash a (aref g 2)) g)) + articles)) + (and (numberp (car articles)) + (range-map (lambda (a) (nnfeed-retrieve-article a g)) + articles))) + 'headers) + (nnheader-report nnfeed-backend "Group %s not found" (or group "")))) + +(deffoo nnfeed-open-server (server &optional defs backend) + (let ((backend (or backend 'nnfeed)) + (a (nnfeed--server-address server)) + s) + (nnoo-change-server backend server defs) + (when (setq s (or (gethash a nnfeed-servers) (nnfeed--read-server server))) + (maphash (lambda (group g) + (setq g (aref g 0)) + (unless (string= group g) + (puthash g group nnfeed-group-names))) + s)) + (setq a (nnfeed--server-file server)) + (or s (condition-case _ (make-directory (file-name-parent-directory a) t) + (:success (file-writable-p a)) + (t nil)) + (and (nnoo-close-server nnfeed-backend server) + (nnheader-report + nnfeed-backend "Server file %s not readable or writable" + server))))) + +(deffoo nnfeed-request-close () + (when (hash-table-p nnfeed-servers) + (maphash (lambda (server _) (nnfeed--write-server server)) nnfeed-servers) + (setq nnfeed-servers (make-hash-table :test 'equal))) + (setq nnfeed-status-string nil) + t) + +;; The default content printing function, which should be suitable for +;; most inheriting backends. + +(defun nnfeed--print-content (content attributes links) + "Return CONTENT formatted according to ATTRIBUTES, with LINKS possibly added." + (let ((links (and (memq 'links attributes) links))) + (when (or content links) + (concat + (and content (format "%s\n\n" content)) + (mapconcat (lambda (link) + (cdr (assoc (cdr (assq 'Content-Type attributes)) link + (lambda (types type) + (if (stringp types) (string= types type) + (member type types)))))) + links))))) + +(defvoo nnfeed-print-content-function #'nnfeed--print-content + "Function returning a single piece of content for an article (a string). + +It should accept three arguments, a part and its attributes (as returned +by `nnfeed-read-parts-function'), and links (as returned by +`nnfeed-read-links-function').") + +(defun nnfeed--print-part (content headers mime links) + "Print part of an article using its CONTENT, HEADERS, and LINKS. +Only HEADERS of a type included in MIME are considered." + (concat + (mapconcat (lambda (header) + (when-let ((m (car-safe header)) + ((member m mime))) + (format "%s: %s\n" m (cdr header)))) + headers) + "\n" + (funcall nnfeed-print-content-function content headers links))) + +(deffoo nnfeed-request-article (article &optional group server to-buffer) + (if-let ((server (or server (nnfeed--current-server-no-prefix))) + (g (or (nnfeed--group-data group server) + (and (setq group nnfeed-group) + `[ nil ,nnfeed-group-article-ids + ,nnfeed-group-articles + ,nnfeed-group-article-max-num + ,nnfeed-group-article-min-num nil]))) + (num (or (and (stringp article) + (gethash article (aref g 1))) + (and (numberp article) article))) + ((and (<= num (aref g 3)) + (>= num (aref g 4)))) + (a (gethash num (aref g 2)))) + (with-current-buffer (or to-buffer nntp-server-buffer) + (erase-buffer) + (let* ((links (aref a 5)) + (parts (aref a 6)) + (headers (aref a 7)) + (boundary (or (cdr (assq :boundary headers)) + (format "-_%s_-" nnfeed-backend))) + (multi (length> parts 1)) + (mime '( Content-Type Content-Disposition + Content-Transfer-Encoding))) + (insert (format + "Subject: %s\nFrom: %s\nDate: %s\nMessage-ID: %s\n" + (aref a 2) (aref a 1) + (format-time-string + nnfeed-date-format (or (aref a 3) '(0 0))) + (aref a 0)) + (if (assq 'MIME-Version headers) "" "MIME-Version: 1.0\n") + (mapconcat (lambda (header) + (unless (keywordp (car header)) + (format "%s: %s\n" (car header) (cdr header)))) + headers) + (if multi + (if (assq 'Content-Type headers) "" + (format + "Content-Type: multipart/alternative; boundary=%s\n" + boundary)) + (prog1 (nnfeed--print-part + (caar parts) (cdar parts) mime links) + (setq parts nil))) + (mapconcat (lambda (part) + (format "--%s\n%s\n" boundary + (nnfeed--print-part + (car part) (cdr part) mime links))) + parts) + (if multi (format "--%s--" boundary) "\n"))) + `(,group . ,num)) + (nnheader-report nnfeed-backend "No such article"))) + +(deffoo nnfeed-request-group (group &optional server fast _info) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (if-let ((server (or server (nnfeed--current-server-no-prefix))) + (g (or (if fast (nnfeed--group-data group server) + (setq server (nnfeed--parse-feed server group)) + (and (hash-table-p server) (gethash group server))) + `[ ,group ,(make-hash-table :test 'equal) + ,(make-hash-table :test 'eql) 0 1 ""]))) + (progn + (setq nnfeed-group group + nnfeed-group-article-ids (aref g 1) + nnfeed-group-articles (aref g 2) + nnfeed-group-article-max-num (aref g 3) + nnfeed-group-article-min-num (aref g 4)) + (insert (format "211 %s %s %s \"%s\"" + (hash-table-count nnfeed-group-article-ids) + nnfeed-group-article-min-num + nnfeed-group-article-max-num group)) + t) + (insert "404 group not found") + (nnheader-report nnfeed-backend "Group %s not found" group)))) + +(deffoo nnfeed-close-group (group &optional server) + (and (string= group nnfeed-group) + (setq nnfeed-group nil + nnfeed-group-article-ids (make-hash-table :test 'equal) + nnfeed-group-articles (make-hash-table :test 'eql) + nnfeed-group-article-max-num 0 + nnfeed-group-article-min-num 1)) + (setq server (or server (nnfeed--current-server-no-prefix))) + (nnfeed--write-server server)) + +(deffoo nnfeed-request-list (&optional server) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (when-let ((p (point)) + (s (nnfeed--parse-feed + (or server (nnfeed--current-server-no-prefix)))) + ((hash-table-p s))) + (maphash (lambda (group g) + (insert (format "\"%s\" %s %s y\n" + group (aref g 3) (aref g 4)))) + s) + (not (= (point) p))))) + +(deffoo nnfeed-request-post (&optional _server) + (nnheader-report nnfeed-backend "%s is a read only backend" nnfeed-backend)) + +;;;; Optional back end functions: + +(deffoo nnfeed-retrieve-groups (_groups &optional server) + (nnfeed-request-list server) + 'active) + +(deffoo nnfeed-request-type (_group &optional _article) + 'unknown) + +(deffoo nnfeed-request-group-description (group &optional server) + (when-let ((server (or server (nnfeed--current-server-no-prefix))) + (g (nnfeed--group-data group server))) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (insert group " " (aref g 5) "\n")))) + +(deffoo nnfeed-request-list-newsgroups (&optional server) + (when-let ((server (or server (nnfeed--current-server-no-prefix))) + (s (gethash (nnfeed--server-address server) nnfeed-servers)) + ((hash-table-p s))) + (with-current-buffer nntp-server-buffer + (erase-buffer) + (maphash (lambda (group g) + (insert group " " (aref g 5) "\n")) + s)))) + +(deffoo nnfeed-request-rename-group (group new-name &optional server) + (when-let ((server (or server (nnfeed--current-server-no-prefix))) + (a (nnfeed--server-address server)) + (s (or (gethash a nnfeed-servers) + (and ; Open the server to add it to `nnfeed-servers' + (save-match-data + (nnfeed-open-server + server + (cdr ; Get defs and backend. + (assoc a (cdr (assq nnfeed-backend nnoo-state-alist)) + (lambda (car key) + (and (stringp car) + (string-match + (concat + "\\`\\(\\(nn[[:alpha:]]+\\)\\+\\)?" + (regexp-quote key) "\\'") + car) + (setq server car))))) + (if (match-string 1 server) + (intern (match-string 2 server)) 'nnfeed))) + (gethash a nnfeed-servers)))) + (g (or (nnfeed--group-data group a) + `[ ,group ,(make-hash-table :test 'equal) + ,(make-hash-table :test 'eql) nil 1 ""]))) + (puthash new-name g s) + (puthash group new-name nnfeed-group-names) + (remhash group s) + (and (string= group nnfeed-group) + (setq nnfeed-group new-name)) + t)) + +(provide 'nnfeed) + +;;; nnfeed.el ends here -- 2.44.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 23 10:35:17 2024 Received: (at 66188) by debbugs.gnu.org; 23 Apr 2024 14:35:18 +0000 Received: from localhost ([127.0.0.1]:52579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzHEm-0007eE-IS for submit@debbugs.gnu.org; Tue, 23 Apr 2024 10:35:17 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:49300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzHEd-0007bM-SR; Tue, 23 Apr 2024 10:35:06 -0400 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 5FDBAFABD7; Tue, 23 Apr 2024 14:34:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1713882881; bh=gWlqtvNipqyp136+b4tXZIEBVr8AtxU1FxaV8ehGi3w=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=JU7v0qVDexP8W6VjpYwAxtwHHVlaro6/D3mNm7qUIK05xf5VLsixQdS2k6MWgV7Oh 4g2FAXRGV9/hYRLgih9z3IopXyDKmSvnRzMe8wPiXciJVJME+VBQrBMgeOO79LANhM 5Ob0pTK8BrA/+Gg/LrXtTJpISPEJ2+97s24wzFl8= From: Eric Abrahamsen To: Daniel Semyonov Subject: Re: bug#66188: 29.1; Include Atom feed reader In-Reply-To: <871q6xuieb.fsf@dsemy.com> (Daniel Semyonov's message of "Tue, 23 Apr 2024 01:44:44 +0300") References: <87v8fhmgvw.fsf@dsemy.com> <87jznfpom1.fsf@gmx.net> <874jejb2sg.fsf@dsemy.com> <87fry2pa1n.fsf@gmx.net> <87ttmhwxby.fsf@dsemy.com> <87wmrd9zcy.fsf@outlook.com> <875xyx5ksi.fsf@dsemy.com> <87sf219ntf.fsf@gmx.net> <87msrtkztg.fsf@outlook.com> <87ttm0mnku.fsf@dsemy.com> <87o7c7b0yf.fsf@dsemy.com> <87le79yl11.fsf@gmx.net> <87sf1eh53p.fsf@dsemy.com> <87ttl3wk81.fsf_-_@dsemy.com> <87il1b7nxl.fsf@dsemy.com> <8634ry50gw.fsf@gnu.org> <868r1bf3i1.fsf@gnu.org> <87mspnlez1.fsf_-_@ericabrahamsen.net> <87sezev9qi.fsf@dsemy.com> <87o7a2jdm7.fsf@ericabrahamsen.net> <871q6xuieb.fsf@dsemy.com> Date: Tue, 23 Apr 2024 07:34:40 -0700 Message-ID: <874jbsi1vj.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66188 Cc: Eli Zaretskii , jimjoe@gmx.net, 66188@debbugs.gnu.org, 64202@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 04/23/24 01:44 AM, Daniel Semyonov wrote: >>>>>> Eric Abrahamsen writes: > > > On 04/21/24 21:41 PM, Daniel Semyonov wrote: > >>>>>>> Eric Abrahamsen writes: > >>=20 > >> > Eli Zaretskii writes: > >> >> Ping! Ping! Eric, any comments? > >>=20 > >> > Yes, let's do it! My only comment right now is that the manual s= hould > >> > explicitly list the steps for creating an atom group: "B nnatom = RET" and > >> > insert URL without protocol. I still have dreams of fixing the g= roup > >> > creation code to prompt for the address, but that can wait. > >>=20 > >> > Daniel, would you make that addition? > >>=20 > >> Does the following text (in the 'Atom' subsection of the Gnus manu= al) > >> not suffice? > >>=20 > >> The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or lo= cal Atom feeds as > >> Gnus servers (with a single group), as you would with any other me= thod, > >> by supplying the location of the feed as the server address. Note, > >> however, that the server address shouldn't be prefixed with or > >> . > > > I think we need to at least make it clear that you can't create the= se > > groups with "G m", which to me anyway is the "normal" way of making= a > > group. It wouldn't hurt to be more explicit about the fact that fee= ds > > are created at the server level, not the group level. I'm not sugge= sting > > anything radical, something like: > > > --8<---------------cut here---------------start------------->8---=20 > > The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or loc= al Atom feeds as Gnus > > servers, in your Gnus init files or as foreign servers via "B" in t= he > > *Group* buffer. The feed location is supplied as the server address= , and > > each server only contains a single group. Note, however, that the s= erver > > address shouldn't be prefixed with or . > > --8<---------------cut here---------------end--------------->8--- > > > Or something like that. WDYT? > > I gave it another thought and you're right, it should be more explicit. > I've attached an updated patch but here's the new version of the > paragraph (since I actually ended up being even more explicit): > > The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or local A= tom feeds as > Gnus servers, by adding them to =E2=80=98gnus-secondary-select-methods= =E2=80=99 or as > foreign servers by pressing "B" in the =E2=80=98*Group*=E2=80=99 buffer= , for example > (*note Finding the News). The address of each server is its feed's > location (though the address shouldn't be prefixed with or > ) and each server contains a single group which holds the > feed's entries. That looks great -- I think it can't hurt to provide some more hand-holding in the manual. I'll get this in this morning. Thanks! Eric From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 23 18:09:21 2024 Received: (at 66188) by debbugs.gnu.org; 23 Apr 2024 22:09:21 +0000 Received: from localhost ([127.0.0.1]:54625 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzOKG-0000JM-3r for submit@debbugs.gnu.org; Tue, 23 Apr 2024 18:09:21 -0400 Received: from dsemy.com ([46.23.89.208]:46422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzOK3-0000Fn-7l; Tue, 23 Apr 2024 18:09:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=dkim; bh=O8HKb5BLLKHnO 7npw35tis5fI1ev+XB+S2+7ndliICc=; h=date:references:in-reply-to: subject:cc:to:from; d=dsemy.com; b=BzB1mJAlIiN0FWoRi6liWbM0hzZpytlQZU+ hbxgBmU9ayVggh6PRgbIJ0AfPfejP4yRgxd+KbsYa82jkpqz/OPshRVt5YXLYjF91w7Cv5 nZARwuqNAkAk/Ia7ieme5sCbaNxmPDO9p/Mb+rmFLsDV19/bM8VcMUUKHyIixDP34KVibX AJwY8j71N08xTPFnUfytVV+KiKzJU3OdActabKyKHmSBwlMyOFhknjM3HnC4JodAxhYld+ NLZhGEu1NmbJhOP+TpibO5M8dYz0QlfapT8yanTpmKM1xeEDlZoLDZZYt9+9CJRz5JIO8l GMWjnVQoZcH/XU/p/VmJxdqOHVQ== Received: from coldharbour.local ( [2a06:c701:4864:6500:8193:ebb0:ffbc:2f3b]) by dsemy.com (OpenSMTPD) with ESMTPSA id 6f1e8eeb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 24 Apr 2024 00:08:42 +0200 (CEST) Received: from localhost (coldharbour.local [local]) by coldharbour.local (OpenSMTPD) with ESMTPA id 591da9f1; Tue, 23 Apr 2024 22:07:41 +0000 (UTC) From: Daniel Semyonov To: Eric Abrahamsen Subject: Re: bug#66188: 29.1; Include Atom feed reader In-Reply-To: <874jbsi1vj.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Tue, 23 Apr 2024 07:34:40 -0700") References: <87v8fhmgvw.fsf@dsemy.com> <874jejb2sg.fsf@dsemy.com> <87fry2pa1n.fsf@gmx.net> <87ttmhwxby.fsf@dsemy.com> <87wmrd9zcy.fsf@outlook.com> <875xyx5ksi.fsf@dsemy.com> <87sf219ntf.fsf@gmx.net> <87msrtkztg.fsf@outlook.com> <87ttm0mnku.fsf@dsemy.com> <87o7c7b0yf.fsf@dsemy.com> <87le79yl11.fsf@gmx.net> <87sf1eh53p.fsf@dsemy.com> <87ttl3wk81.fsf_-_@dsemy.com> <87il1b7nxl.fsf@dsemy.com> <8634ry50gw.fsf@gnu.org> <868r1bf3i1.fsf@gnu.org> <87mspnlez1.fsf_-_@ericabrahamsen.net> <87sezev9qi.fsf@dsemy.com> <87o7a2jdm7.fsf@ericabrahamsen.net> <871q6xuieb.fsf@dsemy.com> <874jbsi1vj.fsf@ericabrahamsen.net> Date: Wed, 24 Apr 2024 01:07:41 +0300 Message-ID: <877cgnka1e.fsf@dsemy.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 66188 Cc: 64202@debbugs.gnu.org, Eli Zaretskii , 66188@debbugs.gnu.org, jimjoe@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> Eric Abrahamsen writes: > On 04/23/24 01:44 AM, Daniel Semyonov wrote: >>>>>>> Eric Abrahamsen writes: >>=20 >> > On 04/21/24 21:41 PM, Daniel Semyonov wrote: >> >>>>>>> Eric Abrahamsen writes: >> >>=20 >> >> > Eli Zaretskii writes: >> >> >> Ping! Ping! Eric, any comments? >> >>=20 >> >> > Yes, let's do it! My only comment right now is that the manual = should >> >> > explicitly list the steps for creating an atom group: "B nnatom= RET" and >> >> > insert URL without protocol. I still have dreams of fixing the = group >> >> > creation code to prompt for the address, but that can wait. >> >>=20 >> >> > Daniel, would you make that addition? >> >>=20 >> >> Does the following text (in the 'Atom' subsection of the Gnus man= ual) >> >> not suffice? >> >>=20 >> >> The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or l= ocal Atom feeds as >> >> Gnus servers (with a single group), as you would with any other m= ethod, >> >> by supplying the location of the feed as the server address. Not= e, >> >> however, that the server address shouldn't be prefixed with or >> >> . >>=20 >> > I think we need to at least make it clear that you can't create th= ese >> > groups with "G m", which to me anyway is the "normal" way of makin= g a >> > group. It wouldn't hurt to be more explicit about the fact that fe= eds >> > are created at the server level, not the group level. I'm not sugg= esting >> > anything radical, something like: >>=20 >> > --8<---------------cut here---------------start------------->8---= =20 >> > The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or lo= cal Atom feeds as Gnus >> > servers, in your Gnus init files or as foreign servers via "B" in = the >> > *Group* buffer. The feed location is supplied as the server addres= s, and >> > each server only contains a single group. Note, however, that the = server >> > address shouldn't be prefixed with or . >> > --8<---------------cut here---------------end--------------->8--- >>=20 >> > Or something like that. WDYT? >>=20 >> I gave it another thought and you're right, it should be more explic= it. >> I've attached an updated patch but here's the new version of the >> paragraph (since I actually ended up being even more explicit): >>=20 >> The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or loca= l Atom feeds as >> Gnus servers, by adding them to =E2=80=98gnus-secondary-select-metho= ds=E2=80=99 or as >> foreign servers by pressing "B" in the =E2=80=98*Group*=E2=80=99 buf= fer, for example >> (*note Finding the News). The address of each server is its feed's >> location (though the address shouldn't be prefixed with or >> ) and each server contains a single group which holds the >> feed's entries. > That looks great -- I think it can't hurt to provide some more > hand-holding in the manual. I'll get this in this morning. Great, I just did a git pull and I see it; thank you very much! Daniel (BTW I guess this report should be closed; I'm not really sure what the procedure is since this technically isn't my report, but instead was merged with mine at some point) From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 24 10:22:22 2024 Received: (at 66188-done) by debbugs.gnu.org; 24 Apr 2024 14:22:22 +0000 Received: from localhost ([127.0.0.1]:58709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzdVo-0006uq-MC for submit@debbugs.gnu.org; Wed, 24 Apr 2024 10:22:22 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:56728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzdTI-0006Vk-2v; Wed, 24 Apr 2024 10:19:46 -0400 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 63102FA059; Wed, 24 Apr 2024 14:19:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1713968355; bh=rojycCApCil+wyjlC9JexbXPrUG3LqYoNHYbK0CKagw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=U6w5g1F5bJhy1XtrwAjJCf80piMzbvbe+O7yKqM0XLFfwbXVG7sqzMPEU9caXE1GG pkZ7jJLriAypkeFlrmohfItgbYGH1/ro7EPt3IbEDmsrULG8TmsaoxNy3u4hYf3zkX qFdz0m79pzu4bvft07+YqzIXQdhGupOwVhglgsWw= From: Eric Abrahamsen To: Daniel Semyonov Subject: Re: bug#66188: 29.1; Include Atom feed reader In-Reply-To: <877cgnka1e.fsf@dsemy.com> (Daniel Semyonov's message of "Wed, 24 Apr 2024 01:07:41 +0300") References: <87v8fhmgvw.fsf@dsemy.com> <87fry2pa1n.fsf@gmx.net> <87ttmhwxby.fsf@dsemy.com> <87wmrd9zcy.fsf@outlook.com> <875xyx5ksi.fsf@dsemy.com> <87sf219ntf.fsf@gmx.net> <87msrtkztg.fsf@outlook.com> <87ttm0mnku.fsf@dsemy.com> <87o7c7b0yf.fsf@dsemy.com> <87le79yl11.fsf@gmx.net> <87sf1eh53p.fsf@dsemy.com> <87ttl3wk81.fsf_-_@dsemy.com> <87il1b7nxl.fsf@dsemy.com> <8634ry50gw.fsf@gnu.org> <868r1bf3i1.fsf@gnu.org> <87mspnlez1.fsf_-_@ericabrahamsen.net> <87sezev9qi.fsf@dsemy.com> <87o7a2jdm7.fsf@ericabrahamsen.net> <871q6xuieb.fsf@dsemy.com> <874jbsi1vj.fsf@ericabrahamsen.net> <877cgnka1e.fsf@dsemy.com> Date: Wed, 24 Apr 2024 07:19:14 -0700 Message-ID: <87plue4zdp.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66188-done Cc: Eli Zaretskii , 64202-done@debbugs.gnu.org, 66188-done@debbugs.gnu.org, jimjoe@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 04/24/24 01:07 AM, Daniel Semyonov wrote: >>>>>> Eric Abrahamsen writes: > > > On 04/23/24 01:44 AM, Daniel Semyonov wrote: > >>>>>>> Eric Abrahamsen writes: > >>=20 > >> > On 04/21/24 21:41 PM, Daniel Semyonov wrote: > >> >>>>>>> Eric Abrahamsen writes: > >> >>=20 > >> >> > Eli Zaretskii writes: > >> >> >> Ping! Ping! Eric, any comments? > >> >>=20 > >> >> > Yes, let's do it! My only comment right now is that the manua= l should > >> >> > explicitly list the steps for creating an atom group: "B nnat= om RET" and > >> >> > insert URL without protocol. I still have dreams of fixing th= e group > >> >> > creation code to prompt for the address, but that can wait. > >> >>=20 > >> >> > Daniel, would you make that addition? > >> >>=20 > >> >> Does the following text (in the 'Atom' subsection of the Gnus m= anual) > >> >> not suffice? > >> >>=20 > >> >> The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or= local Atom feeds as > >> >> Gnus servers (with a single group), as you would with any other= method, > >> >> by supplying the location of the feed as the server address. N= ote, > >> >> however, that the server address shouldn't be prefixed with or > >> >> . > >>=20 > >> > I think we need to at least make it clear that you can't create = these > >> > groups with "G m", which to me anyway is the "normal" way of mak= ing a > >> > group. It wouldn't hurt to be more explicit about the fact that = feeds > >> > are created at the server level, not the group level. I'm not su= ggesting > >> > anything radical, something like: > >>=20 > >> > --8<---------------cut here---------------start------------->8--= -=20 > >> > The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or = local Atom feeds as Gnus > >> > servers, in your Gnus init files or as foreign servers via "B" i= n the > >> > *Group* buffer. The feed location is supplied as the server addr= ess, and > >> > each server only contains a single group. Note, however, that th= e server > >> > address shouldn't be prefixed with or . > >> > --8<---------------cut here---------------end--------------->8--- > >>=20 > >> > Or something like that. WDYT? > >>=20 > >> I gave it another thought and you're right, it should be more expl= icit. > >> I've attached an updated patch but here's the new version of the > >> paragraph (since I actually ended up being even more explicit): > >>=20 > >> The =E2=80=98nnatom=E2=80=99 back end allows you to add HTTP or lo= cal Atom feeds as > >> Gnus servers, by adding them to =E2=80=98gnus-secondary-select-met= hods=E2=80=99 or as > >> foreign servers by pressing "B" in the =E2=80=98*Group*=E2=80=99 b= uffer, for example > >> (*note Finding the News). The address of each server is its feed's > >> location (though the address shouldn't be prefixed with = or > >> ) and each server contains a single group which holds the > >> feed's entries. > > > That looks great -- I think it can't hurt to provide some more > > hand-holding in the manual. I'll get this in this morning. > > Great, I just did a git pull and I see it; thank you very much! > > Daniel > > (BTW I guess this report should be closed; I'm not really sure what the > procedure is since this technically isn't my report, but instead was > merged with mine at some point) Yes, we can close these, if they've been merged then they're the "same" report. And bug reports aren't precious, if we need another, we can open another! Speaking of getting more bug reports, do you want to post on gnus.general and let people know this new backend is available? It would be good to get some usage. Thanks, Eric From unknown Fri Jun 20 07:22:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 23 May 2024 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator