emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 67c89a675df: Add repeat-map for Python indentation commands


From: Juri Linkov
Subject: master 67c89a675df: Add repeat-map for Python indentation commands
Date: Fri, 4 Apr 2025 02:44:02 -0400 (EDT)

branch: master
commit 67c89a675df936abbd2b3925adda8d21b31ae59a
Author: Paul Nelson <ultrono@gmail.com>
Commit: Juri Linkov <juri@linkov.net>

    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' (bug#77417).
---
 etc/NEWS                 | 6 ++++++
 lisp/progmodes/python.el | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index 016b6c590d3..dc77aff7ef2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1347,6 +1347,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 de3745a036c..6fbabe99cb0 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -373,6 +373,13 @@ effect."
   ;; 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]