1

With emacs how can I easily go from this:

enter image description here

to this (has nice indentation and fill-paragraph):

enter image description here

american-ninja-warrior
  • 3,903
  • 2
  • 24
  • 44

1 Answers1

1

Wrapping the paragraphs is simple: C-x h M-q (mark the whole buffer, fill paragraphs).

Adding the bullets is not a built-in capability in text-mode, but can be accomplished a few ways. You could record a macro to add the bullet and format the paragraph, then apply that to each line. Or you could use query/replace to add the bullet to the beginning of every paragraph, then fill the whole buffer.

Here's a custom function that implements that last approach:

(defun bullet-and-fill ()
  (interactive)
  (goto-char (point-min))
  (replace-regexp "^\\(\\w\\)" "* \\1") ; add bullet to lines with text
  (mark-whole-buffer)
  (fill-paragraph nil t))
glucas
  • 20,563
  • 1
  • 54
  • 84