GNU bug report logs - #77417
[PATCH] Add repeat-map for Python indentation commands

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: "Paul D. Nelson" <ultrono@HIDDEN>; Keywords: patch; dated Mon, 31 Mar 2025 20:46:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 31 Mar 2025 20:45:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 31 16:45:31 2025
Received: from localhost ([127.0.0.1]:43132 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tzM0g-0003Ct-MZ
	for submit <at> debbugs.gnu.org; Mon, 31 Mar 2025 16:45:31 -0400
Received: from lists.gnu.org ([2001:470:142::17]:35176)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ultrono@HIDDEN>) id 1tzM0d-0002XD-VR
 for submit <at> debbugs.gnu.org; Mon, 31 Mar 2025 16:45:28 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ultrono@HIDDEN>) id 1tzM0L-00037l-QL
 for bug-gnu-emacs@HIDDEN; Mon, 31 Mar 2025 16:45:10 -0400
Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ultrono@HIDDEN>) id 1tzM0J-0004gH-Ja
 for bug-gnu-emacs@HIDDEN; Mon, 31 Mar 2025 16:45:09 -0400
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5e5e22e6ed2so7306234a12.3
 for <bug-gnu-emacs@HIDDEN>; Mon, 31 Mar 2025 13:45:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743453904; x=1744058704; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=uzfLZfVhIPmP9FQcuwdURh5VAkp/JFhmPAo/DnZ0nlo=;
 b=gsSqM7GKne+W1VjpkE5lzg925sdsVrc/WgFHSPvGN3ggMIk8wrj3QtyYoZ/tpn4GV/
 MOQcrBG7FlSaGlsGvTQjKwYCBg5OwALXIsirg2b3VN+9XOJ8triVT9bur6FmBfL+5T5K
 hTIHBXm+eA5lahdDaLG998LlvGFvLI5ksR9YgMPkg+bKNTaMPPQUyaorLKvIg84oQXZo
 MLQB4jL7rebsJiK5Xl4OiqZgHQxkXgS1paPqwwhDrIL7GD2B3GRLLDWfY7tA/5aAZF7D
 Tt0EHR4dGvNpnVZ5DkbrcYmIMmFiPGKV5MxNnlf3ucVcHLw+mu0L9YXK1KR4Eps9ccMj
 cacQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743453904; x=1744058704;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=uzfLZfVhIPmP9FQcuwdURh5VAkp/JFhmPAo/DnZ0nlo=;
 b=J72XszFKgsI7DwNZSp1dgc78u+CJgiI9rKXeqsSwpZEnsAG3Qc0BPBM0xmC8E0u57W
 ANv69IuTVQCkLhWKgPrCXXht2VwBkO46tlTQbcoRTEx5vdhYkDVBukLJCJdzR9L9acbD
 ZLjX/JRdgILgSuWfPEHDHDJ4b6t218MVvxblJ7WAaG9A2e6a+WAIkYG0jnTjsyko8c+o
 5srDHgP4dWHbwKypoW5pPnHvpnHpXfnUmxSfiaRQYzCuAQ3IuShCbWNGPKRUiirFD8U2
 8GJAHm0UaE+Brul1iJNIg4rAI33xmgeIenjdIS6yeNAHHiz18TviJTJhOuhAmodRzrXR
 jBuA==
X-Gm-Message-State: AOJu0YzKq1kT85JWWcue8/54sXw7aFmxWoiv5NQfi6yn5T6DrJYxr2Zt
 8v7tk/9pKPeQdPKGflHejvv5tIjr120N6HTEyU9UHYCf+15xReuvuVMmr2M9
X-Gm-Gg: ASbGncvPBUzOChJ+5epLHap0mBwFTxJdOFJxRnViGeJ9vP72s+kXLXkLDEF7ejXSjIy
 rTC+cTtREWtC8hpa/w5julKn/TQFcnVtIZ3GajGQu4XHd/DOEzfwaiSuN4AJfhpXuUenM32F5Ss
 037Jbc/1LDwsJ2ntYh+LiAijii9tMMC7ryPgjDJ3JutNltWjusQbQQW6dvo66xhk/ZA9iJuTxAy
 maI8n9GDAncQ00rov7Ok079GDy7phK8w0AoeFZ8zMZh7j5a7wmIwFBN0WnmQ1f21ewsp0Yq0d4D
 e5Hx0nUI+55C9ihaNJ6MBgVV0n2AsyySRkqPdhC6VIuKofO8f/YTh13XZCCL2PFjBXKid9kEiY7
 w3WJJlRy8lA==
X-Google-Smtp-Source: AGHT+IFNboXKkrxrQQwHf5aqTM54cami+Qetp56mofIji5sXQsxj9mJRBvBu7S7s7Yprbn0eDU6xBA==
X-Received: by 2002:a05:6402:35d1:b0:5e6:bc68:8a34 with SMTP id
 4fb4d7f45d1cf-5edfcc1fbd8mr9836918a12.7.1743453903618; 
 Mon, 31 Mar 2025 13:45:03 -0700 (PDT)
Received: from localhost (0x573d6713.static.cust.fastspeed.dk. [87.61.103.19])
 by smtp.gmail.com with UTF8SMTPSA id
 4fb4d7f45d1cf-5edc17b21dcsm6063212a12.56.2025.03.31.13.45.02
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 31 Mar 2025 13:45:02 -0700 (PDT)
From: "Paul D. Nelson" <ultrono@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Add repeat-map for Python indentation commands
Date: Mon, 31 Mar 2025 22:45:00 +0200
Message-ID: <uxsg7t4iz9j5f7.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2a00:1450:4864:20::534;
 envelope-from=ultrono@HIDDEN; helo=mail-ed1-x534.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--=-=-=
Content-Type: text/plain

With this patch and with repeat-mode active, one can repeatedly indent
using 'C-c > >' rather than 'C-c > C-c >', for instance.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Add-repeat-map-for-Python-indentation-commands.patch

From 9d2ab6651df1a068ad2e43d0f8b5e0df86210f25 Mon Sep 17 00:00:00 2001
From: Paul Nelson <ultrono@HIDDEN>
Date: Mon, 31 Mar 2025 12:12:01 +0200
Subject: [PATCH] Add repeat-map for Python indentation commands

* lisp/progmodes/python.el (python-indent-repeat-map): New
keymap for repeating Python indentation commands when using
'repeat-mode'.
---
 etc/NEWS                 | 6 ++++++
 lisp/progmodes/python.el | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index 1bd2fd6d486..439bf400b4a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1334,6 +1334,12 @@ mode.  Now, one needs to say '(midnight-mode +1)' instead.
 
 ** Python mode
 
+*** New repeat-map for Python indentation commands.
+The commands 'python-indent-shift-left' and 'python-indent-shift-right'
+can now be repeated using 'repeat-mode'.  With 'repeat-mode' enabled,
+after invoking one of these commands via 'C-c <' or 'C-c >', you can
+press '<' or '>' to repeat the command.
+
 ---
 *** Prefer "python" for 'python-interpreter' and 'python-shell-interpreter'.
 On recent versions of mainstream GNU/Linux distributions, "python"
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index b6db6097d9f..ca62beb5929 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -373,6 +373,13 @@ python-base-mode-map
   ;; Utilities
   "<remap> <complete-symbol>" #'completion-at-point)
 
+(defvar-keymap python-indent-repeat-map
+  :doc "Keymap to repeat Python indentation commands.
+Used in `repeat-mode'."
+  :repeat t
+  "<" #'python-indent-shift-left
+  ">" #'python-indent-shift-right)
+
 (defvar subword-mode nil)
 
 (easy-menu-define python-menu python-base-mode-map
-- 
2.39.3 (Apple Git-145)


--=-=-=--




Acknowledgement sent to "Paul D. Nelson" <ultrono@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#77417; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 31 Mar 2025 21:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.