all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: James Thomas via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Daniel Semyonov <daniel@dsemy.com>
Cc: 64202@debbugs.gnu.org
Subject: bug#64202: bug#66188: 29.1; Include Atom feed reader
Date: Thu, 22 Feb 2024 07:47:15 +0530	[thread overview]
Message-ID: <87msrtkztg.fsf@outlook.com> (raw)
In-Reply-To: <87sf219ntf.fsf@gmx.net> (James Thomas's message of "Sat, 10 Feb 2024 05:45:40 +0530")

James Thomas wrote:

> Daniel Semyonov wrote:
>
>>>>>>> James Thomas writes:
>>
>>     >> If the posts appear in a chronological order, it should end up
>>     >> being correct.  I think what's happening is that the feed you're
>>     >> testing actually uses a reverse chronological order for posts.
>>     >> If not, send me the feed, I might be misunderstanding something.
>>
>>     > Hmm.. It seems to be happening that way for every server I used:
>>
>>     > git.savannah.gnu.org/cgit/emacs.git/atom/?h=master
>>
>>     > rss.slashdot.org/Slashdot/slashdotMainatom:Slashdot
>>
>>     > github.com/emacs-mirror/emacs/commits.atom
>>
>> These feeds (except for the second one which I can't access) are in
>> reverse-chronological order.
>
> Right. I was hoping that that could be made the default.
>
> But I think the patch is fine to be included as it is; from my 1-2 weeks
> of testing.
>
> Cheers,
> James

This doesn't seem to work for some feeds such as:

en.wikipedia.org/w/index.php?title=Special:RecentChanges&feed=atom
thehackernews.com/feeds/posts/default

In the first one above, is the colon character to blame?

Another thing: I've been using your branch also with my addition below
for assuming reverse-chronological as a default (Sorry! But it was
really bugging me! :-)).

diff --git a/lisp/gnus/nnatom.el b/lisp/gnus/nnatom.el
index 2fcf59c1441..9f2b9c359aa 100644
--- a/lisp/gnus/nnatom.el
+++ b/lisp/gnus/nnatom.el
@@ -64,14 +64,16 @@ nnatom--read-feed
                     (when (eq (car data) 'top)
                       (setq data (assq 'feed data)))
                     (dom-add-child-before data auth)
-                    (catch :stop ; Collect feed authors, stop at first entry.
-                      (dolist (child (cdddr data))
-                        (let ((tag (car-safe child)))
-                          (if (eq tag 'entry)
-                              (throw :stop data)
-                            (and (or (eq tag 'author)
-                                     (eq tag 'contributor))
-                                 (dom-add-child-before auth child)))))
+                    (let ((prev (cddr data)))
+                      (while-let ((next (cdr prev))
+                                  (child (car-safe next))
+                                  (tag (car-safe child))
+                                  (_ (not (eq tag 'entry))))
+                        (and (or (eq tag 'author)
+                                 (eq tag 'contributor))
+                             (dom-add-child-before auth child))
+                        (setq prev next))
+                      (setcdr prev (nreverse (cdr prev)))
                       data)))))))
 (defvoo nnatom-read-feed-function #'nnatom--read-feed
   nil nnfeed-read-feed-function)


My case for such a change:

- Reverse-chronological makes sense as a default because a feed link
  only guarantees to provide the latest updates, not an unbroken chain
  of all events since the beginning.

- nnrss.el does it that way: see the 'nreverse' in line #643.

- Performance impact should be minimal because nreverse is O(n) and
  perhaps having to sort by date afterward (rather than simply use the
  existing number) would more than compensate for that.

- Running -catchup-to-here (on a datetime-sorted Summary buffer) will
  only have to record a single article number range in the newsrc.

(My code is probably not as beautiful as many would like it to be)

Would like to know your thoughts.

Regards,
James





  reply	other threads:[~2024-02-22  2:17 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21  7:08 bug#64202: [PATCH] Gnus: Add back end for Atom feeds (nnatom) Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-21  9:50 ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-21 13:02 ` Eli Zaretskii
2023-06-21 14:26   ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-25 10:07 ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-26 13:26   ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-26 14:52     ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-01  8:39       ` Eli Zaretskii
2023-07-01 11:33         ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-02 22:59           ` Eric Abrahamsen
2023-07-03  0:00             ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-03  4:01               ` Eric Abrahamsen
2023-07-05 12:36                 ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-05 17:17                   ` Eric Abrahamsen
2023-07-05 18:50                     ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-05 19:07                       ` Eric Abrahamsen
2023-07-15  0:59                         ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-15  1:26                           ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18 17:32                           ` Eric Abrahamsen
2023-07-19  4:37                             ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-19 15:39                               ` Eric Abrahamsen
2023-12-08  3:31 ` Husain Alshehhi
2023-12-08  3:31 ` Husain Alshehhi
     [not found] ` <875y1974k0.fsf@>
2023-12-08  9:32   ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-08 16:01     ` Eric Abrahamsen
2023-12-08 16:26     ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-09 11:03       ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-09 13:59         ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-12 18:08           ` Eric Abrahamsen
2023-12-16 15:14           ` Thomas Fitzsimmons
2023-12-17  0:13             ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-17 12:10               ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-17 15:55                 ` Thomas Fitzsimmons
2023-12-17 16:15                   ` Eric Abrahamsen
2023-12-17 20:27                     ` Eric Abrahamsen
2024-02-02  1:35                 ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-04 12:38                   ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-07 17:49                     ` bug#64202: bug#66188: 29.1; Include Atom feed reader Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-08  4:27                       ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-08 11:42                         ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-09  3:54                           ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-09 14:01                             ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-09 20:06                               ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-09 22:34                                 ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-10  0:15                                   ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-22  2:17                                     ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-02-22 17:10                                       ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-23 16:27                                         ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-24 14:49                                           ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-27  5:02                                             ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-03  2:40                                               ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-18 16:58                                               ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-24 13:35                                                 ` bug#64202: " Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-06  9:01                                                   ` bug#66188: " Eli Zaretskii
2024-04-18  9:01                                                     ` Eli Zaretskii
2024-04-21  0:46                                                       ` Eric Abrahamsen
2024-04-21 18:41                                                         ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-22  3:11                                                           ` Eric Abrahamsen
2024-04-22 22:44                                                             ` bug#64202: " Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-23 14:34                                                               ` Eric Abrahamsen
2024-04-23 22:07                                                                 ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-24 14:19                                                                   ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87msrtkztg.fsf@outlook.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=64202@debbugs.gnu.org \
    --cc=daniel@dsemy.com \
    --cc=jimjoe@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.