summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-topic.el
diff options
context:
space:
mode:
authorAlex Bochannek <alex@bochannek.com>2021-06-02 07:41:25 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-06-02 07:41:25 +0200
commit16793dc35a5be4d05e3fa42ea8cf6aa1e67f1dc9 (patch)
tree3eece5ba4f25fe8ca154d7a62a7a8905af6a4330 /lisp/gnus/gnus-topic.el
parent4784b6eb9a8d0d54b56db0805732ffc5e71332d3 (diff)
downloademacs-16793dc35a5be4d05e3fa42ea8cf6aa1e67f1dc9.tar.gz
emacs-16793dc35a5be4d05e3fa42ea8cf6aa1e67f1dc9.tar.bz2
emacs-16793dc35a5be4d05e3fa42ea8cf6aa1e67f1dc9.zip
Add new user option to Gnus to allow `#' to toggle
* doc/misc/gnus.texi (Marking Groups, Setting Process Marks): Mention the new variable. * lisp/gnus/gnus-group.el (gnus-group-make-menu-bar): Update menu. (gnus-group-mark-group): Support the variable. (gnus-group-mark-update): New command. (gnus-group-unmark-group, gnus-group-mark-region): Pass in new parameter. * lisp/gnus/gnus-sum.el (gnus-summary-make-menu-bar): Update menu. (gnus-summary-mark-as-processable): Use the variable. * lisp/gnus/gnus-topic.el (gnus-topic-mark-topic): (bug#48683). * lisp/gnus/gnus-topic.el (gnus-topic-mark-topic): Use the variable. * lisp/gnus/gnus.el (gnus-process-mark-toggle): New user option.
Diffstat (limited to 'lisp/gnus/gnus-topic.el')
-rw-r--r--lisp/gnus/gnus-topic.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el
index b3d17bc03fb..c0484622f40 100644
--- a/lisp/gnus/gnus-topic.el
+++ b/lisp/gnus/gnus-topic.el
@@ -1112,7 +1112,7 @@ articles in the topic and its subtopics."
["Delete" gnus-topic-delete t]
["Rename..." gnus-topic-rename t]
["Create..." gnus-topic-create-topic t]
- ["Mark" gnus-topic-mark-topic t]
+ ["Set/Toggle mark" gnus-topic-mark-topic t]
["Indent" gnus-topic-indent t]
["Sort" gnus-topic-sort-topics t]
["Previous topic" gnus-topic-goto-previous-topic t]
@@ -1436,7 +1436,7 @@ If PERMANENT, make it stay shown in subsequent sessions as well."
(setcar (cdr (cadr topic)) 'visible)
(gnus-group-list-groups)))))
-(defun gnus-topic-mark-topic (topic &optional unmark non-recursive)
+(defun gnus-topic-mark-topic (topic &optional unmark non-recursive no-toggle)
"Mark all groups in the TOPIC with the process mark.
If NON-RECURSIVE (which is the prefix) is t, don't mark its subtopics."
(interactive
@@ -1450,8 +1450,13 @@ If NON-RECURSIVE (which is the prefix) is t, don't mark its subtopics."
(let ((groups (gnus-topic-find-groups topic gnus-level-killed t nil
(not non-recursive))))
(while groups
- (funcall (if unmark 'gnus-group-remove-mark 'gnus-group-set-mark)
- (gnus-info-group (nth 1 (pop groups)))))))))
+ (let ((group (gnus-info-group (nth 1 (pop groups)))))
+ (if (and gnus-process-mark-toggle (not no-toggle))
+ (if (memq group gnus-group-marked)
+ (gnus-group-remove-mark group )
+ (gnus-group-set-mark group))
+ (if unmark (gnus-group-remove-mark group)
+ (gnus-group-set-mark group)))))))))
(defun gnus-topic-unmark-topic (topic &optional _dummy non-recursive)
"Remove the process mark from all groups in the TOPIC.
@@ -1462,7 +1467,7 @@ If NON-RECURSIVE (which is the prefix) is t, don't unmark its subtopics."
gnus-topic-mode)
(if (not topic)
(call-interactively 'gnus-group-unmark-group)
- (gnus-topic-mark-topic topic t non-recursive)))
+ (gnus-topic-mark-topic topic t non-recursive t)))
(defun gnus-topic-get-new-news-this-topic (&optional n)
"Check for new news in the current topic."