dotfiles/emacs-lisp/filling_and_unfilling_paragraphs.org
main 56520667c4
Emacs changes
Signed-off-by: main <magic_rb@redalder.org>
2022-06-07 17:08:42 +02:00

686 B

Filling and unfilling paragraphs

  ;;; Stefan Monnier <foo at acm.org>. It is the opposite of fill-paragraph
  (defun unfill-paragraph (&optional region)
    "Takes a multi-line paragraph and makes it into a single line of text."
    (interactive (progn (barf-if-buffer-read-only) '(t)))
    (let ((fill-column (point-max))
          ;; This would override `fill-column' if it's an integer.
          (emacs-lisp-docstring-fill-column t))
      (fill-paragraph nil region)))

  ;; Handy key definition
  (define-key global-map "\M-Q" 'unfill-paragraph)