From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alex Bochannek Newsgroups: gmane.emacs.bugs Subject: bug#48683: 28.0.50; [PATCH] Feature suggestion gnus-summary-toggle-mark-as-processable Date: Mon, 31 May 2021 13:33:08 -0700 Message-ID: References: <87cztb4uzs.fsf@gnus.org> <878s3ywadg.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29833"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) Cc: 48683@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 31 22:34:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lnoc1-0007Wo-Iz for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 May 2021 22:34:13 +0200 Original-Received: from localhost ([::1]:40460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnoc0-0007oF-L8 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 May 2021 16:34:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnobr-0007ip-8C for bug-gnu-emacs@gnu.org; Mon, 31 May 2021 16:34:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51678) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lnobr-0007of-0c for bug-gnu-emacs@gnu.org; Mon, 31 May 2021 16:34:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lnobq-000727-US for bug-gnu-emacs@gnu.org; Mon, 31 May 2021 16:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Bochannek Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 May 2021 20:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48683 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 48683-submit@debbugs.gnu.org id=B48683.162249319626953 (code B ref 48683); Mon, 31 May 2021 20:34:02 +0000 Original-Received: (at 48683) by debbugs.gnu.org; 31 May 2021 20:33:16 +0000 Original-Received: from localhost ([127.0.0.1]:34985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnob6-00070f-0V for submit@debbugs.gnu.org; Mon, 31 May 2021 16:33:16 -0400 Original-Received: from ns.lapseofthought.com ([50.0.39.240]:7137 helo=mail.lapseofthought.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnob3-00070U-SJ for 48683@debbugs.gnu.org; Mon, 31 May 2021 16:33:15 -0400 Original-Received: from awb-mbp.local (unknown [IPv6:2601:646:4200:b470:d4ed:23a2:4a34:7e85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lapseofthought.com (Postfix) with ESMTPSA id 4Fv6S60sGnz3pfWJ; Mon, 31 May 2021 13:33:10 -0700 (PDT) In-Reply-To: <878s3ywadg.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 29 May 2021 04:18:35 +0200") Authentication-Results: ORIGINATING; auth=pass smtp.auth=alex smtp.mailfrom=alex@bochannek.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:207733 Archived-At: --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Alex Bochannek 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? --=-=-= Content-Type: text/x-patch Content-Disposition: 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) --=-=-= Content-Type: text/plain -- Alex. --=-=-=--