0

I have a list like this:

remember to undo:
product 0 discrimination
limit(100)
ENV['MANUAL_...']

When point is at the beginning of line 1, how can I tell org mode to make subsequent lines children of the hierarchy, like this

remember to undo:
  product 0 discrimination
  limit(100)
  ENV['MANUAL_...']

I don't even mind this

remember to undo:
  - product 0 discrimination
  - limit(100)
  - ENV['MANUAL_...']

or this

remember to undo:
  [ ] product 0 discrimination
  [ ] limit(100)
  [ ] ENV['MANUAL_...']

or even asterisks

0
  1. If you only want to modify a part of your text select the relevant region otherwise put point at the beginning of the first line.
  2. Replace the empty string at the line-beginning with the string consisting of one star and one space C-M-% ^ RET *⎵ RET (thereby the char stands for a space).
  3. Select the lines below the first one and demote the headings with M-right.
0

Here's a command that does that until it finds an empty line:

(defun indent-children ()
  (interactive)
  (save-excursion
    (while (looking-at ".*[^\n[:space:]]")
      (forward-line 1)
      (indent-to 2))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.