aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew G Cohen2017-04-23 08:25:02 +0800
committerAndrew G Cohen2017-04-23 08:25:02 +0800
commit03f63888923404cd99023b853294f92536d3c87c (patch)
tree498042c64e9c6ef8e449248f6b6ec1ef6a3024e8
parentea9acccd643272962831b63d932e283b8ecca7a7 (diff)
downloademacs-03f63888923404cd99023b853294f92536d3c87c.tar.gz
emacs-03f63888923404cd99023b853294f92536d3c87c.zip
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.
-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."
119 :group 'gnus-thread 119 :group 'gnus-thread
120 :type 'boolean) 120 :type 'boolean)
121 121
122(defcustom gnus-refer-thread-limit-to-thread nil
123 "If non-nil referring a thread will limit the summary buffer to
124articles in the thread. A nil value will add the thread articles
125to the summary buffer."
126 :version "25.1"
127 :group 'gnus-thread
128 :type 'boolean)
129
122(defcustom gnus-summary-make-false-root 'adopt 130(defcustom gnus-summary-make-false-root 'adopt
123 "nil means that Gnus won't gather loose threads. 131 "nil means that Gnus won't gather loose threads.
124If the root of a thread has expired or been read in a previous 132If the root of a thread has expired or been read in a previous
@@ -8568,10 +8576,11 @@ Returns how many articles were removed."
8568 (gnus-summary-limit gnus-newsgroup-unseen) 8576 (gnus-summary-limit gnus-newsgroup-unseen)
8569 (gnus-summary-position-point))) 8577 (gnus-summary-position-point)))
8570 8578
8571(defun gnus-summary-limit-include-thread (id) 8579(defun gnus-summary-limit-include-thread (id &optional thread-only)
8572 "Display all the hidden articles that is in the thread with ID in it. 8580 "Display all hidden articles belonging to thread ID.
8573When called interactively, ID is the Message-ID of the current 8581When called interactively, ID is the Message-ID of the current
8574article." 8582article. If thread-only is non-nil limit the summary buffer to
8583these articles."
8575 (interactive (list (mail-header-id (gnus-summary-article-header)))) 8584 (interactive (list (mail-header-id (gnus-summary-article-header))))
8576 (let ((articles (gnus-articles-in-thread 8585 (let ((articles (gnus-articles-in-thread
8577 (gnus-id-to-thread (gnus-root-id id)))) 8586 (gnus-id-to-thread (gnus-root-id id))))
@@ -8580,7 +8589,8 @@ article."
8580 (gnus-fetch-old-headers nil) 8589 (gnus-fetch-old-headers nil)
8581 (gnus-build-sparse-threads nil)) 8590 (gnus-build-sparse-threads nil))
8582 (prog1 8591 (prog1
8583 (gnus-summary-limit (nconc articles gnus-newsgroup-limit)) 8592 (gnus-summary-limit (if thread-only articles
8593 (nconc articles gnus-newsgroup-limit)))
8584 (gnus-summary-limit-include-matching-articles 8594 (gnus-summary-limit-include-matching-articles
8585 "subject" 8595 "subject"
8586 (regexp-quote (gnus-general-simplify-subject 8596 (regexp-quote (gnus-general-simplify-subject
@@ -9054,7 +9064,7 @@ non-numeric or nil fetch the number specified by the
9054 'gnus-article-sort-by-number))) 9064 'gnus-article-sort-by-number)))
9055 (setq gnus-newsgroup-articles 9065 (setq gnus-newsgroup-articles
9056 (gnus-sorted-nunion gnus-newsgroup-articles article-ids)) 9066 (gnus-sorted-nunion gnus-newsgroup-articles article-ids))
9057 (gnus-summary-limit-include-thread id))) 9067 (gnus-summary-limit-include-thread id gnus-refer-thread-limit-to-thread)))
9058 (gnus-summary-show-thread)) 9068 (gnus-summary-show-thread))
9059 9069
9060(defun gnus-summary-open-group-with-article (message-id) 9070(defun gnus-summary-open-group-with-article (message-id)