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: Wed, 26 May 2021 12:57:06 -0700 Message-ID: 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="13897"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) To: 48683@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 26 22:16:30 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 1llzx6-0003Pi-G8 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 May 2021 22:16:28 +0200 Original-Received: from localhost ([::1]:39134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llzx5-0002RD-IP for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 May 2021 16:16:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llzfL-0004ou-BV for bug-gnu-emacs@gnu.org; Wed, 26 May 2021 15:58:11 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llzfG-0006iB-HL for bug-gnu-emacs@gnu.org; Wed, 26 May 2021 15:58:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1llzfG-000214-Eh for bug-gnu-emacs@gnu.org; Wed, 26 May 2021 15:58: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: Wed, 26 May 2021 19:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48683 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16220590717727 (code B ref -1); Wed, 26 May 2021 19:58:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 May 2021 19:57:51 +0000 Original-Received: from localhost ([127.0.0.1]:49978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llzf4-00020Y-WA for submit@debbugs.gnu.org; Wed, 26 May 2021 15:57:51 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:33566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llzf3-00020R-HP for submit@debbugs.gnu.org; Wed, 26 May 2021 15:57:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llzf3-0004Cn-6f for bug-gnu-emacs@gnu.org; Wed, 26 May 2021 15:57:49 -0400 Original-Received: from ns.lapseofthought.com ([50.0.39.240]:8261 helo=mail.lapseofthought.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llzex-0006UK-UM for bug-gnu-emacs@gnu.org; Wed, 26 May 2021 15:57:48 -0400 Original-Received: from awb-mbp.local (unknown [IPv6:2601:646:4200:b470:e5ba:e8b3:f6eb:a5ab]) (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 4Fr1tq4pyqz3pdqX for ; Wed, 26 May 2021 12:57:07 -0700 (PDT) Authentication-Results: ORIGINATING; auth=pass smtp.auth=alex smtp.mailfrom=alex@bochannek.com Received-SPF: pass client-ip=50.0.39.240; envelope-from=alex@bochannek.com; helo=mail.lapseofthought.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:207315 Archived-At: --=-=-= Content-Type: text/plain (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. --=-=-= Content-Type: text/x-patch Content-Disposition: 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) --=-=-= Content-Type: text/plain -- Alex. --=-=-=--