Is there an inverse for M-q, some kind of unfill-paragraph-function
?
If I have undo data, then it\'s of course easy. What I am asking for is
I was first using @sanityinc's solution for a while until I came accross Stefan Monnier's Unfill Paragraph in EmacsWiki. It seems more robust
;;; Stefan Monnier . 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)
The M-Q
key binding makes the command so much easier.