bram85's Blog

bram85's Avatar Image
Tooting mostly about #emacs.
← All posts

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:

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.

https://apps.bram85.nl/git/bram/gists/src/commit/971c6e93ed435195d77ec7112da0a2766a128b80/gists/execute-command-repeatedly.el

To like or reply, open original post on Emacs.ch