New answers tagged

1

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 ...


0

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) (col (current-column)) (input-list (split-string input "\n")) (input-lengths (mapcar 'length input-list)) (max-len (+ 2 (seq-max input-lengths))) (...


0

Here's one way: (defun doit () (interactive) (while (not (eobp)) (beginning-of-line) (when (looking-at "[A-Z]") (insert "export ")) (next-line))) 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 ...


0

I would try with sed (unix utility) and regular expressions.


0

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 ...


0

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-x ( C-SPC C-n C-n C-n M-% C-q C-j RET SPC RET ! C-n C-a C-x ) Transform the rest by calling the macro until it fails. C-u 0 C-x e


2

Use M-x sort-lines for the first example. For the second example, change it into z, a, c, g, then use M-x sort-regexp-fields ., \&.


2

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.


Top 50 recent answers are included