GNU bug report logs - #42334
28.0.50; gnus-thread-sort-functions vs. loose threads

Previous Next

Package: emacs;

Reported by: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>

Date: Sun, 12 Jul 2020 13:07:01 UTC

Severity: normal

Tags: wontfix

Found in version 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42334 in the body.
You can then email your comments to 42334 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#42334; Package emacs. (Sun, 12 Jul 2020 13:07:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kévin Le Gouguec <kevin.legouguec <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 12 Jul 2020 13:07:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; gnus-thread-sort-functions vs. loose threads
Date: Sun, 12 Jul 2020 15:05:56 +0200
[Message part 1 (text/plain, inline)]
Hello,

I try to configure gnus-thread-sort-functions so that threads are sorted
from least recently updated (at the top) to most recently updated (at
the bottom):

#+begin_src elisp
(setq gnus-thread-sort-functions '(gnus-thread-sort-by-number
                                   (not gnus-thread-sort-by-most-recent-date)))
#+end_src

The above works as intended most of the time, except when loose threads
are involved.  To reproduce:

- copy the attached emacs-devel.mbox to /tmp,
- copy the attached init.el somewhere,
- install gnus-mock from ELPA,
- evaluate the following, with init.el in default-directory:

#+begin_src elisp
(let ((gnus-mock-init-file (expand-file-name "init.el"))
      (gnus-mock-emacs-program (expand-file-name "src/emacs" source-directory)))
  (package-initialize)
  (gnus-mock-start))
#+end_src

This produces the following summary buffer:

20200708T163331 Philip K.               Re: Updating dired-guess-shell-alist-default
20200708T170847     Stefan Monnier          
20200708T163824 João Távora             Re: Byte-compilation warnings after merging eldoc changes

AFAICT, the first thread should be sorted last, since it has been
updated more recently than the second thread.  What leads me to believe
that this issue is linked to loose threads is that if we ask Gnus not to
gather those…

#+begin_src elisp
;; Evaluate:
(setq gnus-summary-make-false-root nil)
;; Then refresh with M-g.
#+end_src

… then the issue goes away:

20200708T163331 Philip K.               Re: Updating dired-guess-shell-alist-default
20200708T163824 João Távora             Re: Byte-compilation warnings after merging eldoc changes
20200708T170847 Stefan Monnier          Re: Updating dired-guess-shell-alist-default


Is this indeed a bug, or am I missing something?

Thank you for your time.


PS: when playing with this example, if you happen to set
gnus-summary-make-false-root to 'dummy, and notice that both the dummy
root *and* the first message display the subject line, note that I
already sent a report (and a patch) over at bug#40520.


[emacs-devel.mbox (application/mbox, attachment)]
[init.el (application/emacs-lisp, attachment)]
[Message part 4 (text/plain, inline)]

In GNU Emacs 28.0.50 (build 10, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, cairo version 1.16.0)
 of 2020-07-04 built on hirondell
Repository revision: 5d1bac0ac951e25d0b0b39a9919f13053162d5df
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)

Configured using:
 'configure --with-xwidgets --with-cairo'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42334; Package emacs. (Sun, 19 Jul 2020 00:15:02 GMT) Full text and rfc822 format available.

Message #8 received at 42334 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Cc: 42334 <at> debbugs.gnu.org
Subject: Re: bug#42334: 28.0.50; gnus-thread-sort-functions vs. loose threads
Date: Sun, 19 Jul 2020 02:13:38 +0200
Kévin Le Gouguec <kevin.legouguec <at> gmail.com> writes:

> Is this indeed a bug, or am I missing something?

It's an artefact of the way Gnus does these things.  This is the code:

	   (gnus-sort-gathered-threads
	    (funcall gnus-summary-thread-gathering-function
		     (gnus-sort-threads
		      (gnus-cut-threads (gnus-make-threads)))))

First we sort the threads, then we gather loose threads, and then we
sort the loose threads individually.

So there's no way to do sorting (globally) after the threads have been
gathered.

Changing the order all this happens in would be possible, but it would
change how this all behaves.  So to fix this, we'd have to add yet
another sort -- on the outside, after doing all this, and this would
require a new set of sorting predicates, because the structure of a
gathered thread is different than the structure of a normal thread.

So you couldn't use gnus-thread-sort-by-most-recent-date and the like
for that top-level sorting thing.

So I don't think adding this functionality is worth it, although it's
something that's been requested a few times, and I'm closing this bug
report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 19 Jul 2020 00:15:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 42334 <at> debbugs.gnu.org and Kévin Le Gouguec <kevin.legouguec <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 19 Jul 2020 00:15:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42334; Package emacs. (Sun, 19 Jul 2020 09:43:01 GMT) Full text and rfc822 format available.

Message #15 received at 42334 <at> debbugs.gnu.org (full text, mbox):

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 42334 <at> debbugs.gnu.org
Subject: Re: bug#42334: 28.0.50; gnus-thread-sort-functions vs. loose threads
Date: Sun, 19 Jul 2020 11:42:45 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> So I don't think adding this functionality is worth it, although it's
> something that's been requested a few times, and I'm closing this bug
> report.

Understood.  It's not too annoying when reading news since I rarely have
more than a screenful of summary for any given group, but it can get
confusing when looking at archives: a recently updated subthread can be
hidden several screens up because a sibling subthread is too old…

I'll file this one under "don't hack on this unless I can spend a couple
of days on it".  Thanks a lot for taking the time to pinpoint where the
issue lies, that's really helpful!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42334; Package emacs. (Sun, 19 Jul 2020 13:10:02 GMT) Full text and rfc822 format available.

Message #18 received at 42334 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Cc: 42334 <at> debbugs.gnu.org
Subject: Re: bug#42334: 28.0.50; gnus-thread-sort-functions vs. loose threads
Date: Sun, 19 Jul 2020 15:09:13 +0200
Kévin Le Gouguec <kevin.legouguec <at> gmail.com> writes:

> Understood.  It's not too annoying when reading news since I rarely have
> more than a screenful of summary for any given group, but it can get
> confusing when looking at archives: a recently updated subthread can be
> hidden several screens up because a sibling subthread is too old…
>
> I'll file this one under "don't hack on this unless I can spend a couple
> of days on it".  Thanks a lot for taking the time to pinpoint where the
> issue lies, that's really helpful!

It would be nice.  The thing is that it requires writing new versions of
all these functions:

           (choice (function-item gnus-thread-sort-by-number)
                   (function-item gnus-thread-sort-by-author)
                   (function-item gnus-thread-sort-by-recipient)
                   (function-item gnus-thread-sort-by-subject)
                   (function-item gnus-thread-sort-by-date)
                   (function-item gnus-thread-sort-by-score)
                   (function-item gnus-thread-sort-by-most-recent-number)
                   (function-item gnus-thread-sort-by-most-recent-date)
                   (function-item gnus-thread-sort-by-random)
                   (function-item gnus-thread-sort-by-total-score)

The new versions would take gathered threads as the parameters instead
of real threads.  (Gathered threads are just lists of real threads, so
it's pretty straightforward.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 17 Aug 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 244 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.