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:
Case Duckworth 2021-08-14 12:39:31 -05:00
parent f5e6987d8e
commit 8d8e56272e
2 changed files with 2 additions and 15 deletions

View File

@ -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"))

View File

@ -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."