From afa3013927ece91871a18f689cef3366e690f802 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 2 Jun 2021 23:38:43 -0500 Subject: Add unfill-region TODO: unfill-buffer, etc. Possibly a whole 'filler.el' ... --- lisp/acdw.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lisp') diff --git a/lisp/acdw.el b/lisp/acdw.el index d048fc0..48e754d 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -73,6 +73,20 @@ ARG). When called with multiple arguments or a list, it returns (kill-region (region-beginning) (region-end)) (backward-kill-word arg))) +;; https://www.emacswiki.org/emacs/UnfillRegion +(defun unfill-region (start end) + "Unfill a region defined by START and END positions." + (interactive "*r") + (let ((fill-column (point-max)) + (emacs-lisp-docstring-fill-column t)) + (fill-region start end))) + +(defun unfill-buffer (&optional buffer-or-name) + (with-current-buffer (or buffer-or-name (current-buffer)) + (save-excursion + (save-restriction + (unfill-region (point-min) (point-max)))))) + (defmacro when-unfocused (name &rest forms) "Define a function NAME, executing FORMS, that fires when Emacs is unfocused." -- cgit 1.4.1-21-gabe81