Questions tagged [keyboard-macros]

A "keyboard macro" is a command defined by an Emacs user which represents a sequence of keys. Calling a keyboard macro is equivalent to typing that key sequence.

21 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
48 views

Emacs keyboard macros ? all over

I have used keyboard macros for a long time, but moved between companies, systems, and various machines over my career. I used to be able to record macros and insert-kbd-macro into my .emacs file and ...
3
votes
1answer
163 views

Process unread-command-events and redisplay

(defun pretend (keys) (dolist (e (reverse (listify-key-sequence (kbd keys)))) (push e unread-command-events) ;; (mystery-function) (redisplay t) (sleep-for 0.1))) (pretend "M-x my-...
3
votes
0answers
61 views

Replace formula by computed value

I'd like to select a simple formula like 17+5 and replace that by the computed result, 22 in this case. And I need this to work during keyboard macro execution, to quickly process large portions of my ...
2
votes
0answers
30 views

Keyboard macro with occur

In a keyboard macro, there is an occur command. While recording the macro, I switched to the occur window, did some editing, closed occur buffer reverted back to original buffer to continue editing. ...
2
votes
0answers
36 views

Can the kmacro internal format contain literal commands?

I'm trying to modify key-chord.el so that you can have key-combination specific timeouts and I noticed that key-chord uses heuristics to decide when two keys pressed sequentially in a kmacro are ...
1
vote
0answers
16 views

keyboard macro with input-method inserts characters twice

When I define keyboard macro with some input method enabled (lets say, english-dvorak), self-insert commands are repeated twice. For example, if I define macro like this: F3insert chars asdfF4 and ...
1
vote
0answers
71 views

Associate (and save) macro with current file (+/- evil spacemacs)

After edit : I am using evil-mode. I often record macros very specific to the file I am editing with qq or qw. Is there a way to autosave those macros and the key associated to them when saving the ...
1
vote
0answers
34 views

Simple regexp inside emacs keyboard macro

Newbie question: I'm trying to record a keyboard macro with a simple regexp inside (search-backward-regexp ^[0-9]). This works well when recording the macro, but as soon as I try to execute it, the ...
1
vote
0answers
42 views

execute-kbd-macro apparently not working according to its doc?

The doc of execute-kbd-macro says: (execute-kbd-macro MACRO &optional COUNT LOOPFUNC) ... If MACRO is a symbol, its function definition is used. I tried M-: (execute-kbd-macro 'ignore). ...
1
vote
0answers
53 views

After 0 kbd macro iterations: read-kbd-macro: Variable binding depth exceeds max-specpdl-size

Here my kbd macros in mycustom.el (fset 'keep-tv-channels-names (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([134217848 107 101 return 69 88 84 ...
1
vote
0answers
116 views

key-chord not working with kmacro

When trying to define a macro in emacs and trying to expand key-chord in process its not working - its simply inputs letters instead. I saw explanation of this in key-chord.el but is there any ...
1
vote
0answers
150 views

Evil mode - help with custom prefix key

I had a custom key that I used extensively in Emacs for custom editing actions: C-z. I decided to use evil mode (I came from vim originally so nothing too new) but I don't know how to rebind evil's C-...
0
votes
1answer
54 views

How to overwrite by pasting a string without selecting a region?

I can't figure out how to paste a string, for example 145 characters long, into a text line in a way, that the next 145 characters after the string are overwritten by this string or simply erased. An ...
0
votes
0answers
19 views

How do I disable Swiper while defining a keyboard macro?

I don't like the swiper behavior when interactively defining a macro, it is slow and seems to cause other problems. How can I revert bound keys to isearch-forward and isearch-backward when defining ...
0
votes
0answers
10 views

How to execute a keyboard macro until termination inside another one, without stopping the recording?

I have a buffer with the following content and I need to delete the duplicate lines. 57,04/15/2020 03:02PM,'Weight'='2.478 lb','tare'='0.918 lb' 57,04/15/2020 03:02PM,'Weight'='2.478 lb','tare'='0....
0
votes
0answers
15 views

isearch in kmacro-step-edit-macro

I'm trying to edit a keyboard macro using kmacro-step-edit-macro. The macro starts by isearching for a word. C-s ;; isearch-forward binary_function ;; self-insert-command * 15 RET ...
0
votes
0answers
125 views

Record a keyboard macro in Evil Mode to a register with another keyboard macro inside it

In vim, one can type qw to start recording a macro to register w, then record the macro, then finish recording to w by pressing q again. It is then possible to record another macro by typing qe, ...
0
votes
1answer
151 views

How to insert/dump all keyboard macros at once?

Is there a way to show all keyboard macros (similar to insert-kbd-macro) without having to first name each macro? Using macros with evil-mode in case this makes a difference.
0
votes
0answers
22 views

Recording a keyboard macro with actual character strings

I could not better word the question. So, I have finalized a few M-x commands I want to execute on a buffer. I have also tried and tested a few regexps using C-M-% for search and replace. Now, I ...
0
votes
2answers
255 views

org-sparse-tree on multiple keywords

I currently have a keyboard shortcut bound to C-c t that shows me all of the NEXTACTION items I have, no matter what headline level they're at. It works by using a kbd macro wherein I just typed C-c / ...
0
votes
1answer
151 views

Custom search function for dictionary lookup

I have a plain text dictionary in which each headword is matched by ^# \(† \)?headword, How can I make a custom search function that relieves me of typing the whole regex every time I want to look ...