Unnamed repository; edit this file 'description' to name the repository.
 help / color / Atom feed
* Finding last messages in a thread
@ 2020-04-30  3:15 Michael Heerdegen
  2020-04-30  4:16 ` Eric Abrahamsen
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Michael Heerdegen @ 2020-04-30  3:15 UTC (permalink / raw)
  To: info-gnus-english

Hello,

is there a quick way to sort the messages in a thread chronologically?
My goal is to find the latest articles in a thread.

I guessed the quickest way could be to limit to the current thread
(???), and then turn off threading (C-M-t), but the first functionality
doesn't seem to exist, so I implemented it quicky:

#+begin_src emacs-lisp
(defun my-gnus-limit-to-current-thread ()
  (interactive)
  (let ((a (gnus-summary-article-number)))
    (gnus-summary-limit
     (gnus-summary-articles-in-thread
      (let ((a a))
        (dotimes (_ (gnus-summary-thread-level))
          (cl-callf gnus-summary-article-parent a))
        a)))
    (gnus-summary-goto-subject a)))
#+end_src

Do I miss something?

TIA,

Michael.


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Finding last messages in a thread
  2020-04-30  3:15 Finding last messages in a thread Michael Heerdegen
@ 2020-04-30  4:16 ` Eric Abrahamsen
  2020-04-30  4:46   ` Michael Heerdegen
  2020-04-30  5:31 ` Lars Ingebrigtsen
  2020-04-30 20:36 ` Achilles Yuce
  2 siblings, 1 reply; 14+ messages in thread
From: Eric Abrahamsen @ 2020-04-30  4:16 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: info-gnus-english

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Hello,
>
> is there a quick way to sort the messages in a thread chronologically?
> My goal is to find the latest articles in a thread.
>
> I guessed the quickest way could be to limit to the current thread
> (???), and then turn off threading (C-M-t), but the first functionality
> doesn't seem to exist, so I implemented it quicky:
>
> #+begin_src emacs-lisp
> (defun my-gnus-limit-to-current-thread ()
>   (interactive)
>   (let ((a (gnus-summary-article-number)))
>     (gnus-summary-limit
>      (gnus-summary-articles-in-thread
>       (let ((a a))
>         (dotimes (_ (gnus-summary-thread-level))
>           (cl-callf gnus-summary-article-parent a))
>         a)))
>     (gnus-summary-goto-subject a)))
> #+end_src
>
> Do I miss something?

Elsewhere the gnus code does this with `gnus-root-id', but I have no
idea if that is any faster or more convenient than your version (I would
be curious to know). I wonder if you could use the
`gnus-newsgroup-dependencies' hashtable.

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Finding last messages in a thread
  2020-04-30  4:16 ` Eric Abrahamsen
@ 2020-04-30  4:46   ` Michael Heerdegen
  2020-04-30  5:29     ` Eric Abrahamsen
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2020-04-30  4:46 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: info-gnus-english

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Elsewhere the gnus code does this with `gnus-root-id', but I have no
> idea if that is any faster or more convenient than your version (I would
> be curious to know). I wonder if you could use the
> `gnus-newsgroup-dependencies' hashtable.

Maybe, I didn't invest too much time.

But - I didn't miss any already existing method to reach my goal
(finding the chronologically last messages in a thread)?

Michael.

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Finding last messages in a thread
  2020-04-30  4:46   ` Michael Heerdegen
@ 2020-04-30  5:29     ` Eric Abrahamsen
  0 siblings, 0 replies; 14+ messages in thread
From: Eric Abrahamsen @ 2020-04-30  5:29 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: info-gnus-english

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Elsewhere the gnus code does this with `gnus-root-id', but I have no
>> idea if that is any faster or more convenient than your version (I would
>> be curious to know). I wonder if you could use the
>> `gnus-newsgroup-dependencies' hashtable.
>
> Maybe, I didn't invest too much time.
>
> But - I didn't miss any already existing method to reach my goal
> (finding the chronologically last messages in a thread)?

No, not that I'm aware of (mind you, I "discover" new Gnus functions
every few days).

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Finding last messages in a thread
  2020-04-30  3:15 Finding last messages in a thread Michael Heerdegen
  2020-04-30  4:16 ` Eric Abrahamsen
@ 2020-04-30  5:31 ` Lars Ingebrigtsen
  2020-04-30  7:01   ` Andrew Cohen
  2020-04-30 20:36 ` Achilles Yuce
  2 siblings, 1 reply; 14+ messages in thread
From: Lars Ingebrigtsen @ 2020-04-30  5:31 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: info-gnus-english

Michael Heerdegen <michael_heerdegen@web.de> writes:

> I guessed the quickest way could be to limit to the current thread
> (???), and then turn off threading (C-M-t), but the first functionality
> doesn't seem to exist, so I implemented it quicky:

Limiting to a thread seems like a natural thing to do, but I can't find
such a command, either.  It seems like Gnus should have such a command.

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

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Finding last messages in a thread
  2020-04-30  5:31 ` Lars Ingebrigtsen
@ 2020-04-30  7:01   ` Andrew Cohen
  2020-04-30  8:25     ` Andrew Cohen
  0 siblings, 1 reply; 14+ messages in thread
From: Andrew Cohen @ 2020-04-30  7:01 UTC (permalink / raw)
  To: info-gnus-english

>>>>> "LI" == Lars Ingebrigtsen <larsi@gnus.org> writes:

    LI> Michael Heerdegen <michael_heerdegen@web.de> writes:
    >> I guessed the quickest way could be to limit to the current
    >> thread (???), and then turn off threading (C-M-t), but the first
    >> functionality doesn't seem to exist, so I implemented it quicky:

    LI> Limiting to a thread seems like a natural thing to do, but I
    LI> can't find such a command, either.  It seems like Gnus should
    LI> have such a command.

I think this already exists (bound to "/ T")

(defun gnus-summary-limit-include-thread (id &optional thread-only)
  "Display all hidden articles belonging to thread ID.
When called interactively, ID is the Message-ID of the current
article.  If thread-only is non-nil limit the summary buffer to
these articles."

What I typically do is "A T" (gnus-summary-refer-thread) which will
additionally search for all the articles in the thread.


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Finding last messages in a thread
  2020-04-30  7:01   ` Andrew Cohen
@ 2020-04-30  8:25     ` Andrew Cohen
  2020-04-30 22:18       ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Andrew Cohen @ 2020-04-30  8:25 UTC (permalink / raw)
  To: info-gnus-english


>>>>> "AC" == Andrew Cohen <cohen@bu.edu> writes:

>>>>> "LI" == Lars Ingebrigtsen <larsi@gnus.org> writes:
    LI> Michael Heerdegen <michael_heerdegen@web.de> writes:
    >>> I guessed the quickest way could be to limit to the current
    >>> thread (???), and then turn off threading (C-M-t), but the first
    >>> functionality doesn't seem to exist, so I implemented it quicky:

    LI> Limiting to a thread seems like a natural thing to do, but I
    LI> can't find such a command, either.  It seems like Gnus should
    LI> have such a command.

    AC> I think this already exists (bound to "/ T")

    AC> (defun gnus-summary-limit-include-thread (id &optional
    AC> thread-only) "Display all hidden articles belonging to thread
    AC> ID.  When called interactively, ID is the Message-ID of the
    AC> current article.  If thread-only is non-nil limit the summary
    AC> buffer to these articles."

    AC> What I typically do is "A T" (gnus-summary-refer-thread) which
    AC> will additionally search for all the articles in the thread.

And...its broken (I think). Since I use "A T" I never tried "/ T". With
a prefix arg its supposed to limit the summary buffer to the articles in
the thread, but it doesn't. I believe the (interactive) expression is
wrong, so that the prefix arg is thrown away. 


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Finding last messages in a thread
  2020-04-30  3:15 Finding last messages in a thread Michael Heerdegen
  2020-04-30  4:16 ` Eric Abrahamsen
  2020-04-30  5:31 ` Lars Ingebrigtsen
@ 2020-04-30 20:36 ` Achilles Yuce
  2020-04-30 20:45   ` Michael Heerdegen
  2 siblings, 1 reply; 14+ messages in thread
From: Achilles Yuce @ 2020-04-30 20:36 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: info-gnus-english

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Hello,
>
> is there a quick way to sort the messages in a thread chronologically?
> My goal is to find the latest articles in a thread.
>
> I guessed the quickest way could be to limit to the current thread
> (???), and then turn off threading (C-M-t), but the first functionality
> doesn't seem to exist, so I implemented it quicky:
>
> Do I miss something?
>
> TIA,
>
> Michael.
>

Hello,

What i usually do to get a single thread sorted with articles is;

/n /T C-c C-s C-d

Regards,

-- 
Achilles Yuce                               GPG: B631 00A1 35BC 97C2 24A1
                                                 3306 44F9 71F3 1CCF 32E2

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Finding last messages in a thread
  2020-04-30 20:36 ` Achilles Yuce
@ 2020-04-30 20:45   ` Michael Heerdegen
  2020-04-30 20:52     ` Achilles Yuce
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2020-04-30 20:45 UTC (permalink / raw)
  To: Achilles Yuce; +Cc: info-gnus-english

Achilles Yuce <ayuce@posteo.mx> writes:

> What i usually do to get a single thread sorted with articles is;
>
> /n /T C-c C-s C-d
     ^

Is this A T?  But then it works well, yes, thanks for sharing!

Michael.

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Finding last messages in a thread
  2020-04-30 20:45   ` Michael Heerdegen
@ 2020-04-30 20:52     ` Achilles Yuce
  0 siblings, 0 replies; 14+ messages in thread
From: Achilles Yuce @ 2020-04-30 20:52 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: info-gnus-english

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Achilles Yuce <ayuce@posteo.mx> writes:
>
>> What i usually do to get a single thread sorted with articles is;
>>
>> /n /T C-c C-s C-d
>      ^
>
> Is this A T?  But then it works well, yes, thanks for sharing!
>
> Michael.


Either of these work for me. I am glad it worked for you as well.


     Achilles

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Finding last messages in a thread
  2020-04-30  8:25     ` Andrew Cohen
@ 2020-04-30 22:18       ` Michael Heerdegen
  2020-05-01  0:27         ` Andrew Cohen
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2020-04-30 22:18 UTC (permalink / raw)
  To: info-gnus-english

Andrew Cohen <cohen@bu.edu> writes:

> And...its broken (I think). Since I use "A T" I never tried "/ T". With
> a prefix arg its supposed to limit the summary buffer to the articles in
> the thread, but it doesn't. I believe the (interactive) expression is
> wrong, so that the prefix arg is thrown away. 

Yes, looks like that.  I wonder who has done that.  Let's see:

  03f6388892 Allow limiting gnus summary buffers to a thread

committed by a certain "Andrew G Cohen".  Hmm, never heard that name.
Should we contact him?


Michael.


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Finding last messages in a thread
  2020-04-30 22:18       ` Michael Heerdegen
@ 2020-05-01  0:27         ` Andrew Cohen
  2020-05-01  1:27           ` Michael Heerdegen
  0 siblings, 1 reply; 14+ messages in thread
From: Andrew Cohen @ 2020-05-01  0:27 UTC (permalink / raw)
  To: info-gnus-english


>>>>> "MH" == Michael Heerdegen <michael_heerdegen@web.de> writes:

    MH> Andrew Cohen <cohen@bu.edu> writes:
    >> And...its broken (I think). Since I use "A T" I never tried "/
    >> T". With a prefix arg its supposed to limit the summary buffer to
    >> the articles in the thread, but it doesn't. I believe the
    >> (interactive) expression is wrong, so that the prefix arg is
    >> thrown away.

    MH> Yes, looks like that.  I wonder who has done that.  Let's see:

    MH>   03f6388892 Allow limiting gnus summary buffers to a thread

    MH> committed by a certain "Andrew G Cohen".  Hmm, never heard that
    MH> name.  Should we contact him?

Err, I'm pretty sure he is unavailable :)


Anyway, here is the fix to get the prefix-arg properly passed (I don't
have a current checkout of master and my local trees are a mess and I
don't have time to fix it all up, blah, blah, can someone push this for
me please:):


@@ -8698,7 +8556,8 @@ gnus-summary-limit-include-thread
 When called interactively, ID is the Message-ID of the current
 article.  If thread-only is non-nil limit the summary buffer to
 these articles."
-  (interactive (list (mail-header-id (gnus-summary-article-header))))
+  (interactive (list (mail-header-id (gnus-summary-article-header))
+                    current-prefix-arg))
   (let ((articles (gnus-articles-in-thread
                   (gnus-id-to-thread (gnus-root-id id))))
        ;;we REALLY want the whole thread---this prevents cut-threads





_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Finding last messages in a thread
  2020-05-01  0:27         ` Andrew Cohen
@ 2020-05-01  1:27           ` Michael Heerdegen
  2020-05-01  2:12             ` Andrew Cohen
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Heerdegen @ 2020-05-01  1:27 UTC (permalink / raw)
  To: info-gnus-english

Andrew Cohen <cohen@bu.edu> writes:

> don't have time to fix it all up, blah, blah, can someone push this for
> me please:):

Sure.

> @@ -8698,7 +8556,8 @@ gnus-summary-limit-include-thread
>  When called interactively, ID is the Message-ID of the current
>  article.  If thread-only is non-nil limit the summary buffer to
>  these articles."
> -  (interactive (list (mail-header-id (gnus-summary-article-header))))
> +  (interactive (list (mail-header-id (gnus-summary-article-header))
> +                    current-prefix-arg))
>    (let ((articles (gnus-articles-in-thread
>                    (gnus-id-to-thread (gnus-root-id id))))
>         ;;we REALLY want the whole thread---this prevents cut-threads

But I have some questions first (somewhat interdependent):

(1) I wasn't able to discover this.  Should there be a menu entry for
this function?

(2) It currently has the binding / T.  But it doesn't seem to be a pure
limit command, since it also shows additional articles.  Do we want it
like this?

(3) Will people call this more often with prefix arg?  If yes, should we
toggle the meaning of the prefix, or split the command into two separate
commands?

I'm not a Gnus guru, so I don't have a strong opinion myself, but I
wondered.


Michael.


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Finding last messages in a thread
  2020-05-01  1:27           ` Michael Heerdegen
@ 2020-05-01  2:12             ` Andrew Cohen
  0 siblings, 0 replies; 14+ messages in thread
From: Andrew Cohen @ 2020-05-01  2:12 UTC (permalink / raw)
  To: info-gnus-english


>>>>> "MH" == Michael Heerdegen <michael_heerdegen@web.de> writes:


[...]

    MH> But I have some questions first (somewhat interdependent):

    MH> (1) I wasn't able to discover this.  Should there be a menu
    MH> entry for this function?

Sure.

    MH> (2) It currently has the binding / T.  But it doesn't seem to be
    MH> a pure limit command, since it also shows additional articles.
    MH> Do we want it like this?

    MH> (3) Will people call this more often with prefix arg?  If yes,
    MH> should we toggle the meaning of the prefix, or split the command
    MH> into two separate commands?

This part of gnus is a (slight) mess. There are commands for limiting
that are of the form 'gnus-summary-limit-to-x which indeed limit the
summary buffer given some criteria. Then there are several commands of
the form 'gnus-summary-limit-include-x whose purpose is to ADD to the
currently limited display some things that were hidden (dormant,
expunged, etc). That is what 'gnus-summary-limit-include-threads is for
(since often articles in the thread are hidden in the summary display;
for example you might have ticked articles and unticked articles in a
thread and the unticked articles are hidden).

Clearly limiting to and displaying hidden articles are independent, so
there are four possible outcomes for limiting and displaying based on
criterion "X". Ideally all of this would be cleaned up with a common
syntax for these functions. This would take a bit of work, and I'm not
sure its worth just changing things for the one case of threads. But if
anyone is eager to tackle this it would help clean up the code
significantly, and shouldn't be too much work.

Having said that, if you wanted to skip the work of cleaning everything
up I would favor creating a separate command for
'gnus-summary-limit-to-thread and remove the prefix-arg and the
associated code path from 'gnus-summary-limit-include-thread and change
the bindings (and the one use case in 'gnus-summary-refer-thread).

Best,
Andy






_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, back to index

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30  3:15 Finding last messages in a thread Michael Heerdegen
2020-04-30  4:16 ` Eric Abrahamsen
2020-04-30  4:46   ` Michael Heerdegen
2020-04-30  5:29     ` Eric Abrahamsen
2020-04-30  5:31 ` Lars Ingebrigtsen
2020-04-30  7:01   ` Andrew Cohen
2020-04-30  8:25     ` Andrew Cohen
2020-04-30 22:18       ` Michael Heerdegen
2020-05-01  0:27         ` Andrew Cohen
2020-05-01  1:27           ` Michael Heerdegen
2020-05-01  2:12             ` Andrew Cohen
2020-04-30 20:36 ` Achilles Yuce
2020-04-30 20:45   ` Michael Heerdegen
2020-04-30 20:52     ` Achilles Yuce

Unnamed repository; edit this file 'description' to name the repository.

Archives are clonable: git clone --mirror http://inbox.vuxu.org/info-gnus-english

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.emacs.gnus.user


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git