From 2bc99f0e850a8fcb3d2ef120fb2802c597accb53 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 22 Jul 2021 21:16:23 -0500 Subject: Further configure org-mode Especially `kill-ring-save-unfilled', though it doesn't quite work in a really weird way. --- lisp/acdw.el | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lisp/acdw.el') diff --git a/lisp/acdw.el b/lisp/acdw.el index 2f878a9..15756c2 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -87,6 +87,16 @@ 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") + (save-excursion + (save-restriction + (unfill-region start end) + (kill-ring-save start end region) + (fill-region start end)))) + (defmacro when-unfocused (name &rest forms) "Define a function NAME, executing FORMS, that fires when Emacs is unfocused." -- cgit 1.4.1-21-gabe81