summaryrefslogtreecommitdiff
path: root/lisp/gnus
diff options
context:
space:
mode:
authorAndrew G Cohen <cohen@andy.bu.edu>2017-04-23 08:25:02 +0800
committerAndrew G Cohen <cohen@andy.bu.edu>2017-04-23 08:25:02 +0800
commit03f63888923404cd99023b853294f92536d3c87c (patch)
tree498042c64e9c6ef8e449248f6b6ec1ef6a3024e8 /lisp/gnus
parentea9acccd643272962831b63d932e283b8ecca7a7 (diff)
downloademacs-03f63888923404cd99023b853294f92536d3c87c.tar.gz
Allow limiting gnus summary buffers to a thread
* lisp/gnus/gnus-sum.el (gnus-summary-limit-include-thread): Include an optional argument to allow limiting the summary buffer to just the thread-related articles. (gnus-refer-thread-limit-to-thread): Introduce customizable variable to control whether thread-referral adds the thread to the summary buffer or limits to just the thread. (gnus-summary-refer-thread): Use the new variable.
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/gnus-sum.el20
1 files changed, 15 insertions, 5 deletions
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index c86fea015e7..2414e866574 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -119,6 +119,14 @@ current group."
:group 'gnus-thread
:type 'boolean)
+(defcustom gnus-refer-thread-limit-to-thread nil
+ "If non-nil referring a thread will limit the summary buffer to
+articles in the thread. A nil value will add the thread articles
+to the summary buffer."
+ :version "25.1"
+ :group 'gnus-thread
+ :type 'boolean)
+
(defcustom gnus-summary-make-false-root 'adopt
"nil means that Gnus won't gather loose threads.
If the root of a thread has expired or been read in a previous
@@ -8568,10 +8576,11 @@ Returns how many articles were removed."
(gnus-summary-limit gnus-newsgroup-unseen)
(gnus-summary-position-point)))
-(defun gnus-summary-limit-include-thread (id)
- "Display all the hidden articles that is in the thread with ID in it.
+(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."
+article. If thread-only is non-nil limit the summary buffer to
+these articles."
(interactive (list (mail-header-id (gnus-summary-article-header))))
(let ((articles (gnus-articles-in-thread
(gnus-id-to-thread (gnus-root-id id))))
@@ -8580,7 +8589,8 @@ article."
(gnus-fetch-old-headers nil)
(gnus-build-sparse-threads nil))
(prog1
- (gnus-summary-limit (nconc articles gnus-newsgroup-limit))
+ (gnus-summary-limit (if thread-only articles
+ (nconc articles gnus-newsgroup-limit)))
(gnus-summary-limit-include-matching-articles
"subject"
(regexp-quote (gnus-general-simplify-subject
@@ -9054,7 +9064,7 @@ non-numeric or nil fetch the number specified by the
'gnus-article-sort-by-number)))
(setq gnus-newsgroup-articles
(gnus-sorted-nunion gnus-newsgroup-articles article-ids))
- (gnus-summary-limit-include-thread id)))
+ (gnus-summary-limit-include-thread id gnus-refer-thread-limit-to-thread)))
(gnus-summary-show-thread))
(defun gnus-summary-open-group-with-article (message-id)