Execute #emacs commands repeatedly.
Running org-attach-url
numerous times could be a bit tedious. C-c C-a u S-INSERT RET
for each URL. There’s a repeat
command under C-x z
but it’s a bit fragile while copy-pasting all the time.
I wrote some #elisp to automate this, not specific to org-attach-url
but for any command that accepts a single argument. The function my/execute-command-repeat
will:
- Ask you which command to execute.
- Then it will gather your inputs one by one.
- The chosen command is executed once for each input you gave.
Actually I was thinking of a solution with #Embark (select region, act on each line). But I couldn’t find something that worked.
Here’s the code I came up with.