about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-08-14 12:39:31 -0500
committerCase Duckworth2021-08-14 12:39:31 -0500
commit8d8e56272eded6abff514ab08a8b515e63672561 (patch)
tree6b16e98740d1e36936c79762683b5b47819ae08f
parentRemove <F1> for consult-buffer (diff)
downloademacs-8d8e56272eded6abff514ab08a8b515e63672561.tar.gz
emacs-8d8e56272eded6abff514ab08a8b515e63672561.zip
Use `unfill' package and delete `kill-ring-save-unfilled'
`acdw/copy-region-plain' takes care of what I want it to.
-rw-r--r--init.el2
-rw-r--r--lisp/acdw.el15
2 files changed, 2 insertions, 15 deletions
diff --git a/init.el b/init.el index 5e27421..703dc56 100644 --- a/init.el +++ b/init.el
@@ -1466,6 +1466,8 @@ if ripgrep is installed, otherwise `consult-grep'."
1466 1466
1467 (global-undo-fu-session-mode +1)) 1467 (global-undo-fu-session-mode +1))
1468 1468
1469(setup (:straight unfill))
1470
1469(setup (:straight (unfocused 1471(setup (:straight (unfocused
1470 :host github 1472 :host github
1471 :repo "duckwork/unfocused")) 1473 :repo "duckwork/unfocused"))
diff --git a/lisp/acdw.el b/lisp/acdw.el index eab0719..4c17bcb 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -87,21 +87,6 @@ ARG). When called with multiple arguments or a list, it returns
87 (save-restriction 87 (save-restriction
88 (unfill-region (point-min) (point-max)))))) 88 (unfill-region (point-min) (point-max))))))
89 89
90(defun kill-ring-save-unfilled (start end &optional region)
91 "Unfill, kill, then re-fill the region defined by START and END positions.
92REGION is passed straight to `kill-ring-save'."
93 (interactive "*r")
94 (let ((sentence-end-double-space nil))
95 (unfill-region start end)
96 (kill-ring-save
97 ;; A quick hack to try and ameliorate the "Args out of range" error when
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))
104
105(defmacro when-unfocused (name &rest forms) 90(defmacro when-unfocused (name &rest forms)
106 "Define a function NAME, executing FORMS, that fires when Emacs 91 "Define a function NAME, executing FORMS, that fires when Emacs
107is unfocused." 92is unfocused."