Use `unfill' package and delete `kill-ring-save-unfilled'
`acdw/copy-region-plain' takes care of what I want it to.
This commit is contained in:
parent
f5e6987d8e
commit
8d8e56272e
2
init.el
2
init.el
|
@ -1466,6 +1466,8 @@ if ripgrep is installed, otherwise `consult-grep'."
|
|||
|
||||
(global-undo-fu-session-mode +1))
|
||||
|
||||
(setup (:straight unfill))
|
||||
|
||||
(setup (:straight (unfocused
|
||||
:host github
|
||||
:repo "duckwork/unfocused"))
|
||||
|
|
15
lisp/acdw.el
15
lisp/acdw.el
|
@ -87,21 +87,6 @@ ARG). When called with multiple arguments or a list, it returns
|
|||
(save-restriction
|
||||
(unfill-region (point-min) (point-max))))))
|
||||
|
||||
(defun kill-ring-save-unfilled (start end &optional region)
|
||||
"Unfill, kill, then re-fill the region defined by START and END positions.
|
||||
REGION is passed straight to `kill-ring-save'."
|
||||
(interactive "*r")
|
||||
(let ((sentence-end-double-space nil))
|
||||
(unfill-region start end)
|
||||
(kill-ring-save
|
||||
;; A quick hack to try and ameliorate the "Args out of range" error when
|
||||
;; `unfill-region' removes some newlines. I'm not sure if this will work
|
||||
;; if calling from Lisp or other such nonsense.
|
||||
(max start (point-min))
|
||||
(min end (point-max))
|
||||
region))
|
||||
(fill-region start end))
|
||||
|
||||
(defmacro when-unfocused (name &rest forms)
|
||||
"Define a function NAME, executing FORMS, that fires when Emacs
|
||||
is unfocused."
|
||||
|
|
Loading…
Reference in New Issue