GNU bug report logs - #59539
29.0.50; Commands created with `insert-kbd-macro` are NOT getting repeated.

Previous Next

Package: emacs;

Reported by: Ramesh Nedunchezian <rameshnedunchezian <at> outlook.com>

Date: Thu, 24 Nov 2022 11:00:02 UTC

Severity: wishlist

Found in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ramesh Nedunchezian <rameshnedunchezian <at> outlook.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; Commands created with `insert-kbd-macro` are NOT getting
 repeated.
Date: Thu, 24 Nov 2022 16:28:47 +0530
Commands created  with `insert-kbd-macro` are NOT getting repeated. Can this limitation be lifted?


For example, down below `my-cmd-a' and `my-cmd-b' are kbd macro commands bound to `<f12> a' and `<f12> b' respectively. 

With `repeat-mode' ON, I would expect that `a' and `b' keys to be repeatable . 

That is I am expecting that

<f12> a a

<f12> a b

will move the cursor and NOT modify the buffer.

Can `repeat-mode' be enhanced to make `a' and `b' keys repeatable.

Sometimes I do complex edits, and it is fairly common in my case to alternate between MANY kbd macro commands to quickly "fixup" things that I am editing.  F


WIW, the text files that I edit are txt files created with pdftotext, and the PDF files are usually books, or handouts which I want to read in epub format. 

So, I have multiple kbd macros in my init file that remove headers, and footers, removes indentation, changes bullets, remove hyphenation, linearize columnar text etc. It would be convenient if these kbd macro commands are repeatable.



(defalias 'my-cmd-a
  (kmacro "C-f C-f"))

(defalias 'my-cmd-b
  (kmacro "C-b C-b"))

(define-prefix-command 'my-kmacro-keymap)

(define-key my-kmacro-keymap (kbd "a") #'my-cmd-a)
(define-key my-kmacro-keymap (kbd "b") #'my-cmd-b)

(put 'my-cmd-a 'repeat-map 'my-kmacro-keymap)
(put 'my-cmd-b 'repeat-map 'my-kmacro-keymap)

(global-set-key (kbd "<f12>")
        my-kmacro-keymap)

(repeat-mode -1)
(repeat-mode +1)


In GNU Emacs 29.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version
 3.24.34, cairo version 1.16.0) of 2022-11-19 built on debian
Repository revision: a6ae13af42ede6618c326855ea4c95e0298fb75b
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Debian GNU/Linux bookworm/sid





This bug report was last modified 2 years and 224 days ago.

Previous Next


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