This function maps through all headings with todo state ✔ and inserts the todo state and tags as described (as long as I have understood it correctly):
(defun my-org-prepare-for-markdown-export (&optional _backend)
"Insert a line below all headings with todo state ✔.
The line has the following format: tags: #✔ , #tag1 , #tag2 , ...
Existing org tags ...
You need to find the current column and then insert at column COL (see lm-insert-at-column).
(defun create-ditaa-box (x)
(interactive "sText: ")
(let* ((input x)
(input-list (split-string input "\n"))
(input-lengths (mapcar 'length input-list))
(max-len (+ 2 (seq-max input-lengths)))
Here's one way:
(defun doit ()
(while (not (eobp))
(when (looking-at "[A-Z]")
(insert "export "))
This will walk through the lines starting at the cursor until the end of the buffer, and if the line starts with a capital letter (per the given regular expression range), then it will ...
I ended up writing a function for this. First it reads the region into a list, splitting it by newline character. It then loops over the list, getting the length of the longest line. It loops over the list of lines again, for each line adding enough spaces to reach the max line length, and then adding that padded line to a new list. This new list is then ...
IIUC you could do that with a keyboard macro.
Place the cursor at the beginning i.e. the very first x.
Define the macro (and also transform the first block):
C-q C-j RET
Transform the rest by calling the macro until it fails.
C-u 0 C-x e
ALT-d is normal for delete word, so my guess is that you pressed the d key before releasing the ALT key. Don't forget you can check any keystroke combinations by using C-h c, that is C-h then release the Control key and press c. Enter the key strokes.