diff options
author | Case Duckworth | 2021-06-02 23:38:43 -0500 |
---|---|---|
committer | Case Duckworth | 2021-06-02 23:38:43 -0500 |
commit | afa3013927ece91871a18f689cef3366e690f802 (patch) | |
tree | 74abbd6870fbca0d674e6f0844d66c8e767e7a46 /lisp | |
parent | Remove commented block (diff) | |
download | emacs-afa3013927ece91871a18f689cef3366e690f802.tar.gz emacs-afa3013927ece91871a18f689cef3366e690f802.zip |
Add unfill-region
TODO: unfill-buffer, etc. Possibly a whole 'filler.el' ...
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/acdw.el | 14 |
1 files changed, 14 insertions, 0 deletions
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 | |||
73 | (kill-region (region-beginning) (region-end)) | 73 | (kill-region (region-beginning) (region-end)) |
74 | (backward-kill-word arg))) | 74 | (backward-kill-word arg))) |
75 | 75 | ||
76 | ;; https://www.emacswiki.org/emacs/UnfillRegion | ||
77 | (defun unfill-region (start end) | ||
78 | "Unfill a region defined by START and END positions." | ||
79 | (interactive "*r") | ||
80 | (let ((fill-column (point-max)) | ||
81 | (emacs-lisp-docstring-fill-column t)) | ||
82 | (fill-region start end))) | ||
83 | |||
84 | (defun unfill-buffer (&optional buffer-or-name) | ||
85 | (with-current-buffer (or buffer-or-name (current-buffer)) | ||
86 | (save-excursion | ||
87 | (save-restriction | ||
88 | (unfill-region (point-min) (point-max)))))) | ||
89 | |||
76 | (defmacro when-unfocused (name &rest forms) | 90 | (defmacro when-unfocused (name &rest forms) |
77 | "Define a function NAME, executing FORMS, that fires when Emacs | 91 | "Define a function NAME, executing FORMS, that fires when Emacs |
78 | is unfocused." | 92 | is unfocused." |