summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2021-07-31 19:59:09 -0500
committerCase Duckworth2021-07-31 19:59:09 -0500
commite77b950a73e0c6ae4246d4e5f219202df433732f (patch)
tree7927a74de1ed9bd94e446f3b5d785beac803699e /lisp
parentAesthetic and message (diff)
downloademacs-e77b950a73e0c6ae4246d4e5f219202df433732f.tar.gz
emacs-e77b950a73e0c6ae4246d4e5f219202df433732f.zip
Rewrite kill-ring-save-unfilled
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index 2d98833..9d8c489 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -91,11 +91,16 @@ ARG). When called with multiple arguments or a list, it returns
91 "Unfill, kill, then re-fill the region defined by START and END positions. 91 "Unfill, kill, then re-fill the region defined by START and END positions.
92REGION is passed straight to `kill-ring-save'." 92REGION is passed straight to `kill-ring-save'."
93 (interactive "*r") 93 (interactive "*r")
94 (save-excursion 94 (let ((sentence-end-double-space nil))
95 (save-restriction 95 (unfill-region start end)
96 (unfill-region start end) 96 (kill-ring-save
97 (kill-ring-save start end region) 97 ;; A quick hack to try and ameliorate the "Args out of range" error when
98 (fill-region start end)))) 98 ;; `unfill-region' removes some newlines. I'm not sure if this will work
99 ;; if calling from Lisp or other such nonsense.
100 (max start (point-min))
101 (min end (point-max))
102 region))
103 (fill-region start end))
99 104
100(defmacro when-unfocused (name &rest forms) 105(defmacro when-unfocused (name &rest forms)
101 "Define a function NAME, executing FORMS, that fires when Emacs 106 "Define a function NAME, executing FORMS, that fires when Emacs