GNU bug report logs -
#48683
28.0.50; [PATCH] Feature suggestion gnus-summary-toggle-mark-as-processable
Previous Next
Reported by: Alex Bochannek <alex <at> bochannek.com>
Date: Wed, 26 May 2021 19:58:02 UTC
Severity: normal
Tags: patch
Found in version 28.0.50
Fixed in version 28.1
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 48683 in the body.
You can then email your comments to 48683 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Wed, 26 May 2021 19:58:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Alex Bochannek <alex <at> bochannek.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 26 May 2021 19:58:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
(Not sure if bug-gnu-emacs is the right place to send things like this,
please let me know if there is a better list.)
I have been missing a article process mark toggle for a while and would
like to propose the below patch. If "+" is not an appropriate key to use
for this, I am happy to accept an alternative.
[Message part 2 (text/x-patch, inline)]
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 7d6fa4cb5c..2862faadf0 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -6628,6 +6628,13 @@ Setting Process Marks
Remove the process mark, if any, from the current article
(@code{gnus-summary-unmark-as-processable}).
+@item M P +
+@itemx +
+@kindex M P + @r{(Summary)}
+@kindex + @r{(Summary)}
+Toggle the process mark of the current article
+(@code{gnus-summary-toggle-mark-as-processable}).
+
@item M P U
@kindex M P U @r{(Summary)}
@findex gnus-summary-unmark-all-processable
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index aa4c753287..93ea117ff1 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -1948,6 +1948,7 @@ gnus-summary-mode-map
"e" gnus-summary-edit-article
"#" gnus-summary-mark-as-processable
"\M-#" gnus-summary-unmark-as-processable
+ "+" gnus-summary-toggle-mark-as-processable
"\M-\C-t" gnus-summary-toggle-threads
"\M-\C-s" gnus-summary-show-thread
"\M-\C-h" gnus-summary-hide-thread
@@ -2046,6 +2047,7 @@ gnus-summary-mode-map
"B" gnus-summary-remove-bookmark
"#" gnus-summary-mark-as-processable
"\M-#" gnus-summary-unmark-as-processable
+ "+" gnus-summary-toggle-mark-as-processable
"S" gnus-summary-limit-include-expunged
"C" gnus-summary-catchup
"H" gnus-summary-catchup-to-here
@@ -2336,6 +2338,7 @@ gnus-summary-mode-map
(gnus-define-keys (gnus-uu-mark-map "P" gnus-summary-mark-map)
"p" gnus-summary-mark-as-processable
"u" gnus-summary-unmark-as-processable
+ "+" gnus-summary-toggle-mark-as-processable
"U" gnus-summary-unmark-all-processable
"v" gnus-uu-mark-over
"s" gnus-uu-mark-series
@@ -2776,6 +2779,7 @@ gnus-summary-make-menu-bar
("Process Mark"
["Set mark" gnus-summary-mark-as-processable t]
["Remove mark" gnus-summary-unmark-as-processable t]
+ ["Toggle mark" gnus-summary-toggle-mark-as-processable t]
["Remove all marks" gnus-summary-unmark-all-processable t]
["Invert marks" gnus-uu-invert-processable t]
["Mark above" gnus-uu-mark-over t]
@@ -10951,10 +10955,15 @@ gnus-summary-mark-as-processable
(n (abs n)))
(while (and
(> n 0)
- (if unmark
- (gnus-summary-remove-process-mark
- (gnus-summary-article-number))
- (gnus-summary-set-process-mark (gnus-summary-article-number)))
+ (let ((article (gnus-summary-article-number)))
+ (cond ((eq nil unmark)
+ (gnus-summary-set-process-mark article))
+ ((eq t unmark)
+ (gnus-summary-remove-process-mark article))
+ ((eq 'toggle unmark)
+ (if (memq article gnus-newsgroup-processable)
+ (gnus-summary-remove-process-mark article)
+ (gnus-summary-set-process-mark article)))))
(zerop (gnus-summary-next-subject (if backward -1 1) nil t)))
(setq n (1- n)))
(when (/= 0 n)
@@ -10970,6 +10979,13 @@ gnus-summary-unmark-as-processable
(interactive "P" gnus-summary-mode)
(gnus-summary-mark-as-processable n t))
+(defun gnus-summary-toggle-mark-as-processable (n)
+ "Toggle the process mark from the next N articles.
+If N is negative, toggle mark backward instead. The difference between
+N and the actual number of articles with their mark toggled is returned."
+ (interactive "P" gnus-summary-mode)
+ (gnus-summary-mark-as-processable n 'toggle))
+
(defun gnus-summary-unmark-all-processable ()
"Remove the process mark from all articles."
(interactive nil gnus-summary-mode)
[Message part 3 (text/plain, inline)]
--
Alex.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Thu, 27 May 2021 23:29:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 48683 <at> debbugs.gnu.org (full text, mbox):
Alex Bochannek <alex <at> bochannek.com> writes:
> I have been missing a article process mark toggle for a while and would
> like to propose the below patch. If "+" is not an appropriate key to use
> for this, I am happy to accept an alternative.
Hm. A toggle command for the process mark? I'm not quite sure I see
the utility, and it's unusual in a Gnus marking context -- none of the
other marking commands toggle (like setting the tick mark).
And the `+' key isn't very mnemonic for a command that toggles the `#'
mark.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Fri, 28 May 2021 01:09:01 GMT)
Full text and
rfc822 format available.
Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):
On Fri, May 28 2021, Lars Ingebrigtsen wrote:
> Alex Bochannek <alex <at> bochannek.com> writes:
>
>> I have been missing a article process mark toggle for a while and would
>> like to propose the below patch. If "+" is not an appropriate key to use
>> for this, I am happy to accept an alternative.
>
> Hm. A toggle command for the process mark? I'm not quite sure I see
> the utility, and it's unusual in a Gnus marking context -- none of the
> other marking commands toggle (like setting the tick mark).
i for one would use it. in my case, it's very common that i've marked
an article by mistake (for instance when marking several for deletion).
> And the `+' key isn't very mnemonic for a command that toggles the `#'
> mark.
i always forget it doesn't work, but my expectation is always that # on
an already marked article would unmark it...
just my 2cs
jao
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Fri, 28 May 2021 02:05:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 48683 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Alex Bochannek <alex <at> bochannek.com> writes:
>
>> I have been missing a article process mark toggle for a while and would
>> like to propose the below patch. If "+" is not an appropriate key to use
>> for this, I am happy to accept an alternative.
>
> Hm. A toggle command for the process mark? I'm not quite sure I see
> the utility, and it's unusual in a Gnus marking context -- none of the
> other marking commands toggle (like setting the tick mark).
The downloadable mark is a toggle and because `@' is right next to `#'
(at least on the US keyboard), I frequently mistyped it and noticed that
the behavior is different.
Let me explain how I use the process mark and why a toggle is useful to
me. When processing a large number of messages, I sometimes mark a
region (or multiple regions) and then want to remove the process mark
from some messages in the region and add it to some other ones outside
the region. I can absolutely use `#' and `M-#`, but switching between
the two quickly when going through dozens of messages requires a fair
amount of dexterity. That's why I would rather mark the largest region
with the most messages and then pick out the ones to add/remove with a
single key that toggles the process mark.
I considered if this also makes sense for group and topic marking, but
it's an optimization for processing a large number of items, which is
why it is probably primarily useful in summary mode.
> And the `+' key isn't very mnemonic for a command that toggles the `#'
> mark.
I saw the `+' glyph as a piece of a `#', which is why I suggested it.
--
Alex.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Fri, 28 May 2021 02:08:02 GMT)
Full text and
rfc822 format available.
Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):
"Jose A. Ortega Ruiz" <jao <at> gnu.org> writes:
> On Fri, May 28 2021, Lars Ingebrigtsen wrote:
>
>> Alex Bochannek <alex <at> bochannek.com> writes:
>>
>>> I have been missing a article process mark toggle for a while and would
>>> like to propose the below patch. If "+" is not an appropriate key to use
>>> for this, I am happy to accept an alternative.
>>
>> Hm. A toggle command for the process mark? I'm not quite sure I see
>> the utility, and it's unusual in a Gnus marking context -- none of the
>> other marking commands toggle (like setting the tick mark).
>
> i for one would use it. in my case, it's very common that i've marked
> an article by mistake (for instance when marking several for deletion).
>
>> And the `+' key isn't very mnemonic for a command that toggles the `#'
>> mark.
>
> i always forget it doesn't work, but my expectation is always that # on
> an already marked article would unmark it...
Same here. My hands keep doing this, despite the fact that it never
works. Given that "add mark" on an already-marked article is a no-op, it
seems like it wouldn't hurt to have it toggle.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Fri, 28 May 2021 02:17:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 48683 <at> debbugs.gnu.org (full text, mbox):
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
> Same here. My hands keep doing this, despite the fact that it never
> works. Given that "add mark" on an already-marked article is a no-op, it
> seems like it wouldn't hurt to have it toggle.
That'd be highly surprising if you say `C-u 10 #' and you have some
already-marked articles, etc.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Fri, 28 May 2021 02:31:02 GMT)
Full text and
rfc822 format available.
Message #23 received at submit <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> Same here. My hands keep doing this, despite the fact that it never
>> works. Given that "add mark" on an already-marked article is a no-op, it
>> seems like it wouldn't hurt to have it toggle.
>
> That'd be highly surprising if you say `C-u 10 #' and you have some
> already-marked articles, etc.
Dired already works like this, and it is already highly surprising :)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Fri, 28 May 2021 18:09:01 GMT)
Full text and
rfc822 format available.
Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):
On Fri, May 28 2021, Lars Ingebrigtsen wrote:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> Same here. My hands keep doing this, despite the fact that it never
>> works. Given that "add mark" on an already-marked article is a no-op, it
>> seems like it wouldn't hurt to have it toggle.
>
> That'd be highly surprising if you say `C-u 10 #' and you have some
> already-marked articles, etc.
i guess suprise is in the eye of the beholder :) i think that, in my
case, it'd do exactly what i expect (for the very little that's worth).
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Sat, 29 May 2021 02:19:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 48683 <at> debbugs.gnu.org (full text, mbox):
Alex Bochannek <alex <at> bochannek.com> writes:
> I can absolutely use `#' and `M-#`, but switching between
> the two quickly when going through dozens of messages requires a fair
> amount of dexterity.
It seems like many people would prefer to have the `#' command be a
toggle. Perhaps we should just add a user option to have `#' toggle or
not? (Defaulting to "not toggle" for backwards compatibility.)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Sat, 29 May 2021 17:00:02 GMT)
Full text and
rfc822 format available.
Message #32 received at submit <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Alex Bochannek <alex <at> bochannek.com> writes:
>
>> I can absolutely use `#' and `M-#`, but switching between
>> the two quickly when going through dozens of messages requires a fair
>> amount of dexterity.
>
> It seems like many people would prefer to have the `#' command be a
> toggle. Perhaps we should just add a user option to have `#' toggle or
> not? (Defaulting to "not toggle" for backwards compatibility.)
Would it be too confusing to have it behave as a toggle with no prefix,
but "always mark multiple articles" when used with a numeric prefix?
To complicate things further, I think it would be worth making sure that
group marking in *Group* and article marking in *Summary* work the same.
This stuff is super prone to muscle memory, that consistency would be
nice.
2ยข...
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Sun, 30 May 2021 04:33:01 GMT)
Full text and
rfc822 format available.
Message #35 received at 48683 <at> debbugs.gnu.org (full text, mbox):
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
> Would it be too confusing to have it behave as a toggle with no prefix,
> but "always mark multiple articles" when used with a numeric prefix?
Some people in this thread said they wanted mass marking also to work as
a toggle.
> To complicate things further, I think it would be worth making sure that
> group marking in *Group* and article marking in *Summary* work the same.
> This stuff is super prone to muscle memory, that consistency would be
> nice.
Indeed.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Mon, 31 May 2021 20:34:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 48683 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Alex Bochannek <alex <at> bochannek.com> writes:
>
>> I can absolutely use `#' and `M-#`, but switching between
>> the two quickly when going through dozens of messages requires a fair
>> amount of dexterity.
>
> It seems like many people would prefer to have the `#' command be a
> toggle. Perhaps we should just add a user option to have `#' toggle or
> not? (Defaulting to "not toggle" for backwards compatibility.)
How about something like this?
[Message part 2 (text/x-patch, inline)]
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 7d6fa4cb5c..b9c6952d60 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -6618,13 +6618,15 @@ Setting Process Marks
@kindex M P p @r{(Summary)}
@findex gnus-summary-mark-as-processable
Mark the current article with the process mark
-(@code{gnus-summary-mark-as-processable}).
-@findex gnus-summary-unmark-as-processable
+(@code{gnus-summary-mark-as-processable}).@*
+If @code{gnus-summary-process-mark-toggle} is non-nil, toggle the
+existing process mark for the current article.
@item M P u
@itemx M-#
@kindex M P u @r{(Summary)}
@kindex M-# @r{(Summary)}
+@findex gnus-summary-unmark-as-processable
Remove the process mark, if any, from the current article
(@code{gnus-summary-unmark-as-processable}).
@@ -10569,6 +10571,8 @@ Pick and Read
it selects just the article. If given a numerical prefix, go to that
thread or article and pick it. (The line number is normally displayed
at the beginning of the summary pick lines.)
+If @code{gnus-summary-process-mark-toggle} is non-nil, this key will
+unpick an already picked article.
@item @key{SPC}
@kindex SPC @r{(Pick)}
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index aa4c753287..941cbaa7d1 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -562,6 +562,12 @@ gnus-move-group-prefix-function
:group 'gnus-summary-mail
:type 'function)
+(defcustom gnus-summary-process-mark-toggle nil
+ "If non-nil the process mark command toggles the article's mark."
+ :version "28.1"
+ :group 'gnus-summary
+ :type 'boolean)
+
;; FIXME: Although the custom type is `character' for the following variables,
;; using multibyte characters (Latin-1, UTF-8) doesn't work. -- rs
@@ -2774,7 +2780,7 @@ gnus-summary-make-menu-bar
["Hide marked" gnus-summary-limit-exclude-marks t]
["Show expunged" gnus-summary-limit-include-expunged t])
("Process Mark"
- ["Set mark" gnus-summary-mark-as-processable t]
+ ["Set/Toggle mark" gnus-summary-mark-as-processable t]
["Remove mark" gnus-summary-unmark-as-processable t]
["Remove all marks" gnus-summary-unmark-all-processable t]
["Invert marks" gnus-uu-invert-processable t]
@@ -10951,10 +10957,14 @@ gnus-summary-mark-as-processable
(n (abs n)))
(while (and
(> n 0)
- (if unmark
- (gnus-summary-remove-process-mark
- (gnus-summary-article-number))
- (gnus-summary-set-process-mark (gnus-summary-article-number)))
+ (let ((article (gnus-summary-article-number)))
+ (if (eq t unmark)
+ (gnus-summary-remove-process-mark article)
+ (if (eq t gnus-summary-process-mark-toggle)
+ (if (memq article gnus-newsgroup-processable)
+ (gnus-summary-remove-process-mark article)
+ (gnus-summary-set-process-mark article))
+ (gnus-summary-set-process-mark article))))
(zerop (gnus-summary-next-subject (if backward -1 1) nil t)))
(setq n (1- n)))
(when (/= 0 n)
[Message part 3 (text/plain, inline)]
--
Alex.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Tue, 01 Jun 2021 06:24:01 GMT)
Full text and
rfc822 format available.
Message #41 received at 48683 <at> debbugs.gnu.org (full text, mbox):
Alex Bochannek <alex <at> bochannek.com> writes:
>> It seems like many people would prefer to have the `#' command be a
>> toggle. Perhaps we should just add a user option to have `#' toggle or
>> not? (Defaulting to "not toggle" for backwards compatibility.)
>
> How about something like this?
Looks good. Some small comments:
> +(defcustom gnus-summary-process-mark-toggle nil
Perhaps this should be gnus-process-mark-toggle and also work in the
Group buffer?
> + (if (eq t unmark)
> + (gnus-summary-remove-process-mark article)
> + (if (eq t gnus-summary-process-mark-toggle)
We shouldn't check against t in either of these cases -- any non-nil
value is valid.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Tue, 01 Jun 2021 15:58:02 GMT)
Full text and
rfc822 format available.
Message #44 received at 48683 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Alex Bochannek <alex <at> bochannek.com> writes:
>
>>> It seems like many people would prefer to have the `#' command be a
>>> toggle. Perhaps we should just add a user option to have `#' toggle or
>>> not? (Defaulting to "not toggle" for backwards compatibility.)
>>
>> How about something like this?
>
> Looks good. Some small comments:
>
>> +(defcustom gnus-summary-process-mark-toggle nil
>
> Perhaps this should be gnus-process-mark-toggle and also work in the
> Group buffer?
That makes sense and I can look at that. I have not dug into the
differences between group and topic mode, but I hope they are similar
enough.
>> + (if (eq t unmark)
>> + (gnus-summary-remove-process-mark article)
>> + (if (eq t gnus-summary-process-mark-toggle)
>
> We shouldn't check against t in either of these cases -- any non-nil
> value is valid.
Good point, thank you!
--
Alex.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Tue, 01 Jun 2021 20:46:01 GMT)
Full text and
rfc822 format available.
Message #47 received at 48683 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Alex Bochannek <alex <at> bochannek.com> writes:
>
>>> It seems like many people would prefer to have the `#' command be a
>>> toggle. Perhaps we should just add a user option to have `#' toggle or
>>> not? (Defaulting to "not toggle" for backwards compatibility.)
>>
>> How about something like this?
>
> Looks good. Some small comments:
>
>> +(defcustom gnus-summary-process-mark-toggle nil
>
> Perhaps this should be gnus-process-mark-toggle and also work in the
> Group buffer?
See below. I tried to make sure that only `#' changes behavior and not
`M-#' (this is why there is a `no-toggle' variable for some of the
functions.) Have a look and let me know what you think.
[Message part 2 (text/x-patch, inline)]
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 7d6fa4cb5c..ebb1df5552 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -2583,7 +2583,9 @@ Marking Groups
@itemx M m
@kindex M m @r{(Group)}
@findex gnus-group-mark-group
-Set the mark on the current group (@code{gnus-group-mark-group}).
+Set the mark on the current group (@code{gnus-group-mark-group}).@*
+If @code{gnus-process-mark-toggle} is non-nil, toggle the
+existing process mark for the current group.
@item M-#
@kindex M-# @r{(Group)}
@@ -4043,7 +4045,9 @@ Topic Commands
@findex gnus-topic-mark-topic
Mark all groups in the current topic with the process mark
(@code{gnus-topic-mark-topic}). This command works recursively on
-sub-topics unless given a prefix.
+sub-topics unless given a prefix.@*
+If @code{gnus-process-mark-toggle} is non-nil, toggle the
+existing process mark for the current topic.
@item T M-#
@kindex T M-# @r{(Topic)}
@@ -6618,13 +6622,15 @@ Setting Process Marks
@kindex M P p @r{(Summary)}
@findex gnus-summary-mark-as-processable
Mark the current article with the process mark
-(@code{gnus-summary-mark-as-processable}).
-@findex gnus-summary-unmark-as-processable
+(@code{gnus-summary-mark-as-processable}).@*
+If @code{gnus-process-mark-toggle} is non-nil, toggle the
+existing process mark for the current article.
@item M P u
@itemx M-#
@kindex M P u @r{(Summary)}
@kindex M-# @r{(Summary)}
+@findex gnus-summary-unmark-as-processable
Remove the process mark, if any, from the current article
(@code{gnus-summary-unmark-as-processable}).
@@ -10569,6 +10575,8 @@ Pick and Read
it selects just the article. If given a numerical prefix, go to that
thread or article and pick it. (The line number is normally displayed
at the beginning of the summary pick lines.)
+If @code{gnus-process-mark-toggle} is non-nil, this key will unpick an
+already picked article.
@item @key{SPC}
@kindex SPC @r{(Pick)}
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 8c62c9424d..06d1313d37 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -894,14 +894,14 @@ gnus-group-make-menu-bar
["Sort by real name" gnus-group-sort-selected-groups-by-real-name
(not (gnus-topic-mode-p))])
("Mark"
- ["Mark group" gnus-group-mark-group
+ ["Set/Toggle mark" gnus-group-mark-group
(and (gnus-group-group-name)
(not (memq (gnus-group-group-name) gnus-group-marked)))]
- ["Unmark group" gnus-group-unmark-group
+ ["Remove mark" gnus-group-unmark-group
(and (gnus-group-group-name)
(memq (gnus-group-group-name) gnus-group-marked))]
- ["Unmark all" gnus-group-unmark-all-groups gnus-group-marked]
- ["Mark regexp..." gnus-group-mark-regexp t]
+ ["Remove all marks" gnus-group-unmark-all-groups gnus-group-marked]
+ ["Mark by regexp..." gnus-group-mark-regexp t]
["Mark region" gnus-group-mark-region :active mark-active]
["Mark buffer" gnus-group-mark-buffer t]
["Execute command" gnus-group-universal-argument
@@ -1865,7 +1865,7 @@ gnus-group-mark-line-p
(forward-char (or (cdr (assq 'process gnus-group-mark-positions)) 2))
(eq (char-after) gnus-process-mark)))
-(defun gnus-group-mark-group (n &optional unmark no-advance)
+(defun gnus-group-mark-group (n &optional unmark no-advance no-toggle)
"Mark the current group."
(interactive "p" gnus-group-mode)
(let ((buffer-read-only nil)
@@ -1877,23 +1877,33 @@ gnus-group-mark-group
(beginning-of-line)
(forward-char (or (cdr (assq 'process gnus-group-mark-positions)) 2))
(delete-char 1)
- (if unmark
- (progn
- (setq gnus-group-marked (delete group gnus-group-marked))
- (insert-char ?\s 1 t))
- (setq gnus-group-marked
- (cons group (delete group gnus-group-marked)))
- (insert-char gnus-process-mark 1 t)))
+ (if (and gnus-process-mark-toggle (not no-toggle))
+ (if (memq group gnus-group-marked)
+ (gnus-group-mark-update group t)
+ (gnus-group-mark-update group))
+ (gnus-group-mark-update group unmark)))
(unless no-advance
(gnus-group-next-group 1))
(cl-decf n))
(gnus-group-position-point)
n))
+(defun gnus-group-mark-update (n &optional unmark)
+ "Set the process mark on current group and update the group line."
+ (if unmark
+ (progn
+ (setq gnus-group-marked
+ (delete n gnus-group-marked))
+ (insert-char ?\s 1 t))
+ (progn
+ (setq gnus-group-marked
+ (cons n (delete n gnus-group-marked)))
+ (insert-char gnus-process-mark 1 t))))
+
(defun gnus-group-unmark-group (n)
"Remove the mark from the current group."
(interactive "p" gnus-group-mode)
- (gnus-group-mark-group n 'unmark)
+ (gnus-group-mark-group n 'unmark nil t)
(gnus-group-position-point))
(defun gnus-group-unmark-all-groups ()
@@ -1910,7 +1920,7 @@ gnus-group-mark-region
(let ((num (count-lines beg end)))
(save-excursion
(goto-char beg)
- (- num (gnus-group-mark-group num unmark)))))
+ (- num (gnus-group-mark-group num unmark nil t)))))
(defun gnus-group-mark-buffer (&optional unmark)
"Mark all groups in the buffer.
@@ -1935,7 +1945,7 @@ gnus-group-remove-mark
Return nil if the group isn't displayed."
(if (gnus-group-goto-group group nil test-marked)
(save-excursion
- (gnus-group-mark-group 1 'unmark t)
+ (gnus-group-mark-group 1 'unmark t t)
t)
(setq gnus-group-marked
(delete group gnus-group-marked))
@@ -1945,7 +1955,7 @@ gnus-group-set-mark
"Set the process mark on GROUP."
(if (gnus-group-goto-group group)
(save-excursion
- (gnus-group-mark-group 1 nil t))
+ (gnus-group-mark-group 1 nil t t))
(setq gnus-group-marked (cons group (delete group gnus-group-marked)))))
(defun gnus-group-universal-argument (arg &optional _groups func)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index aa4c753287..48794ceb3f 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -2774,7 +2774,7 @@ gnus-summary-make-menu-bar
["Hide marked" gnus-summary-limit-exclude-marks t]
["Show expunged" gnus-summary-limit-include-expunged t])
("Process Mark"
- ["Set mark" gnus-summary-mark-as-processable t]
+ ["Set/Toggle mark" gnus-summary-mark-as-processable t]
["Remove mark" gnus-summary-unmark-as-processable t]
["Remove all marks" gnus-summary-unmark-all-processable t]
["Invert marks" gnus-uu-invert-processable t]
@@ -10951,10 +10951,14 @@ gnus-summary-mark-as-processable
(n (abs n)))
(while (and
(> n 0)
- (if unmark
- (gnus-summary-remove-process-mark
- (gnus-summary-article-number))
- (gnus-summary-set-process-mark (gnus-summary-article-number)))
+ (let ((article (gnus-summary-article-number)))
+ (if unmark
+ (gnus-summary-remove-process-mark article)
+ (if gnus-process-mark-toggle
+ (if (memq article gnus-newsgroup-processable)
+ (gnus-summary-remove-process-mark article)
+ (gnus-summary-set-process-mark article))
+ (gnus-summary-set-process-mark article))))
(zerop (gnus-summary-next-subject (if backward -1 1) nil t)))
(setq n (1- n)))
(when (/= 0 n)
diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el
index b3d17bc03f..c0484622f4 100644
--- a/lisp/gnus/gnus-topic.el
+++ b/lisp/gnus/gnus-topic.el
@@ -1112,7 +1112,7 @@ gnus-topic-make-menu-bar
["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 @@ gnus-topic-show-topic
(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 @@ gnus-topic-mark-topic
(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 @@ gnus-topic-unmark-topic
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."
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 7de1cd1ddb..21b5f31c14 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -1183,6 +1183,14 @@ gnus-process-mark
:group 'gnus-summary-marks
:type 'character)
+(defcustom gnus-process-mark-toggle nil
+ "If non-nil the process mark command toggles the process mark."
+ :version "28.1"
+ :group 'gnus-summary
+ :group 'gnus-group-various
+ :group 'gnus-group-topic
+ :type 'boolean)
+
(defcustom gnus-large-newsgroup 200
"The number of articles which indicates a large newsgroup.
If the number of articles in a newsgroup is greater than this value,
[Message part 3 (text/plain, inline)]
--
Alex.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Wed, 02 Jun 2021 05:43:01 GMT)
Full text and
rfc822 format available.
Message #50 received at 48683 <at> debbugs.gnu.org (full text, mbox):
Alex Bochannek <alex <at> bochannek.com> writes:
> See below. I tried to make sure that only `#' changes behavior and not
> `M-#' (this is why there is a `no-toggle' variable for some of the
> functions.) Have a look and let me know what you think.
Thanks! Pushed to Emacs 28 now with some tiny changes to the .texi files.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug marked as fixed in version 28.1, send any further explanations to
48683 <at> debbugs.gnu.org and Alex Bochannek <alex <at> bochannek.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 02 Jun 2021 05:43:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Wed, 02 Jun 2021 06:36:01 GMT)
Full text and
rfc822 format available.
Message #55 received at 48683 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Alex Bochannek <alex <at> bochannek.com> writes:
>
>> See below. I tried to make sure that only `#' changes behavior and not
>> `M-#' (this is why there is a `no-toggle' variable for some of the
>> functions.) Have a look and let me know what you think.
>
> Thanks! Pushed to Emacs 28 now with some tiny changes to the .texi files.
Great, thank you!
--
Alex.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Sun, 06 Jun 2021 00:11:02 GMT)
Full text and
rfc822 format available.
Message #58 received at 48683 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Alex Bochannek <alex <at> bochannek.com> writes:
>
>>> (And it's not just `#' itself, but the commands to mark regions and such
>>> that are also affected.)
>>
>> That shouldn't be the case. In summary, the gnus-uu-mark functions call
>> the set/remove process mark functions directly and in group/topic I
>> introduced the no-toggle flag to avoid toggling for anything other than
>> `#'.
>
> Ah, OK, then that should be less of a worry... Perhaps we should try to
> default it to t on the trunk and see whether anybody complains?
Below is the patch to enable it by default.
Change the Gnus default to use `#' to toggle the process mark
* lisp/gnus/gnus.el (gnus-process-mark-toggle): Change default.
* lisp/gnus/gnus-topic.el (gnus-topic-make-menu-bar): Update menu.
* lisp/gnus/gnus-sum.el (gnus-summary-make-menu-bar): Update menu.
* lisp/gnus/gnus-group.el (gnus-group-make-menu-bar): Update menu.
* doc/misc/gnus.texi (Marking Groups, Topic Commands):
(Setting Process Marks, Pick and Read): Document the new default.
[Message part 2 (text/x-patch, inline)]
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 11bcfc16ae..0ab2aa5b82 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -2583,27 +2583,28 @@ Marking Groups
@itemx M m
@kindex M m @r{(Group)}
@findex gnus-group-mark-group
-Set the mark on the current group (@code{gnus-group-mark-group}).@*
-If @code{gnus-process-mark-toggle} is non-@code{nil}, toggle the
-existing process mark for the current group.
+Toggle the process mark for the current group
+(@code{gnus-group-mark-group}).@*
+If @code{gnus-process-mark-toggle} is @code{nil}, set the process mark
+for the current group.
@item M-#
@kindex M-# @r{(Group)}
@itemx M u
@kindex M u @r{(Group)}
@findex gnus-group-unmark-group
-Remove the mark from the current group
+Remove the process mark, if any, from the current group
(@code{gnus-group-unmark-group}).
@item M U
@kindex M U @r{(Group)}
@findex gnus-group-unmark-all-groups
-Remove the mark from all groups (@code{gnus-group-unmark-all-groups}).
+Remove the process mark from all groups (@code{gnus-group-unmark-all-groups}).
@item M w
@kindex M w @r{(Group)}
@findex gnus-group-mark-region
-Mark all groups between point and mark (@code{gnus-group-mark-region}).
+Mark groups in region (@code{gnus-group-mark-region}).
@item M b
@kindex M b @r{(Group)}
@@ -4043,11 +4044,11 @@ Topic Commands
@item T #
@kindex T # @r{(Topic)}
@findex gnus-topic-mark-topic
-Mark all groups in the current topic with the process mark
+Toggle the process mark for all groups in the current topic
(@code{gnus-topic-mark-topic}). This command works recursively on
sub-topics unless given a prefix.@*
-If @code{gnus-process-mark-toggle} is non-@code{nil}, toggle the
-existing process mark for the current topic.
+If @code{gnus-process-mark-toggle} is @code{nil}, set the process mark
+for the current topic.
@item T M-#
@kindex T M-# @r{(Topic)}
@@ -6621,10 +6622,10 @@ Setting Process Marks
@kindex # @r{(Summary)}
@kindex M P p @r{(Summary)}
@findex gnus-summary-mark-as-processable
-Mark the current article with the process mark
+Toggle the process mark for the current article
(@code{gnus-summary-mark-as-processable}).@*
-If @code{gnus-process-mark-toggle} is non-@code{nil}, toggle the
-existing process mark for the current article.
+If @code{gnus-process-mark-toggle} is @code{nil}, set the process mark
+for the current article.
@item M P u
@itemx M-#
@@ -10568,15 +10569,15 @@ Pick and Read
@item .
@kindex . @r{(Pick)}
@findex gnus-pick-article-or-thread
-Pick the article or thread on the current line
-(@code{gnus-pick-article-or-thread}). If the variable
+Pick the article or thread on the current line or unpick it if is
+already picked (@code{gnus-pick-article-or-thread}). If the variable
@code{gnus-thread-hide-subtree} is true, then this key selects the
entire thread when used at the first article of the thread. Otherwise,
it selects just the article. If given a numerical prefix, go to that
thread or article and pick it. (The line number is normally displayed
at the beginning of the summary pick lines.) If
-@code{gnus-process-mark-toggle} is non-@code{nil}, this key will
-unpick an already picked article.
+@code{gnus-process-mark-toggle} is @code{nil}, this key will pick an
+article or thread.
@item @key{SPC}
@kindex SPC @r{(Pick)}
diff --git a/etc/NEWS b/etc/NEWS
index 7d53eafbae..e44feff6bb 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -871,10 +871,15 @@ tags to be considered as well.
** Gnus
++++
+*** The '#' command in the Group and Summary buffer now toggles,
+instead of sets, the process mark.
+
+++
*** New user option 'gnus-process-mark-toggle'.
-If non-nil, the `#' command in the Group and Summary buffers will
-toggle instead of setting the process mark.
+If non-nil (the default), the `#' command in the Group and Summary
+buffers will toggle, instead of set, the process mark.
+
+++
*** New user option 'gnus-registry-register-all'.
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 06d1313d37..c8b95d9185 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -894,7 +894,7 @@ gnus-group-make-menu-bar
["Sort by real name" gnus-group-sort-selected-groups-by-real-name
(not (gnus-topic-mode-p))])
("Mark"
- ["Set/Toggle mark" gnus-group-mark-group
+ ["Toggle/Set mark" gnus-group-mark-group
(and (gnus-group-group-name)
(not (memq (gnus-group-group-name) gnus-group-marked)))]
["Remove mark" gnus-group-unmark-group
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 3279c3221e..bcd76dda29 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -2774,7 +2774,7 @@ gnus-summary-make-menu-bar
["Hide marked" gnus-summary-limit-exclude-marks t]
["Show expunged" gnus-summary-limit-include-expunged t])
("Process Mark"
- ["Set/Toggle mark" gnus-summary-mark-as-processable t]
+ ["Toggle/Set mark" gnus-summary-mark-as-processable t]
["Remove mark" gnus-summary-unmark-as-processable t]
["Remove all marks" gnus-summary-unmark-all-processable t]
["Invert marks" gnus-uu-invert-processable t]
diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el
index c0484622f4..b974dff372 100644
--- a/lisp/gnus/gnus-topic.el
+++ b/lisp/gnus/gnus-topic.el
@@ -1112,7 +1112,7 @@ gnus-topic-make-menu-bar
["Delete" gnus-topic-delete t]
["Rename..." gnus-topic-rename t]
["Create..." gnus-topic-create-topic t]
- ["Set/Toggle mark" gnus-topic-mark-topic t]
+ ["Toggle/Set 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]
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 21b5f31c14..7dde799a5b 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -1183,8 +1183,8 @@ gnus-process-mark
:group 'gnus-summary-marks
:type 'character)
-(defcustom gnus-process-mark-toggle nil
- "If non-nil the process mark command toggles the process mark."
+(defcustom gnus-process-mark-toggle t
+ "If nil the process mark command only sets the process mark."
:version "28.1"
:group 'gnus-summary
:group 'gnus-group-various
[Message part 3 (text/plain, inline)]
--
Alex.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#48683
; Package
emacs
.
(Tue, 08 Jun 2021 11:36:02 GMT)
Full text and
rfc822 format available.
Message #61 received at 48683 <at> debbugs.gnu.org (full text, mbox):
Alex Bochannek <alex <at> bochannek.com> writes:
>> Ah, OK, then that should be less of a worry... Perhaps we should try to
>> default it to t on the trunk and see whether anybody complains?
>
> Below is the patch to enable it by default.
Thanks; applied to Emacs 28.
--
(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
.
(Wed, 07 Jul 2021 11:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 352 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.