changeset 107:0126fee1787e

Define unfill-paragraph and bind it to M-Q
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Fri, 09 Jan 2015 10:47:09 -0500
parents 7dff3c5cc118
children 046b82e29041
files dotemacs.el
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dotemacs.el
+++ b/dotemacs.el
@@ -70,6 +70,15 @@
 (global-unset-key (kbd "C-x C-z"))
 (global-set-key (kbd "C-x C-z") 'gud-stop-subjob)
 
+;;; H/T Stefan Monnier
+(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)))
+    (fill-paragraph nil region)))
+
+(global-set-key (kbd "M-Q") 'unfill-paragraph)
+
 ;; Only killing the current buffer is useful (thanks to madpickle of #emacs)
 (global-set-key (kbd "C-x k")
 		(lambda () (interactive) (kill-buffer (current-buffer))))