From fe2f9241d2911d61cb1a8da0d97f41ade8e56c1a Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 12 Aug 2021 21:06:07 -0500 Subject: Add acdw/copy-region-plain This is finally the thing I was looking for --- init.el | 3 +-- lisp/acdw.el | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index 7e2c1ea..63a327c 100644 --- a/init.el +++ b/init.el @@ -1334,8 +1334,7 @@ if ripgrep is installed, otherwise `consult-grep'." "" acdw-org/org-table-copy-down "M-SPC M-SPC" insert-zero-width-space "C-c C-l" org-insert-link-dwim - "M-w" kill-ring-save-unfilled - "M-=" acdw-org/count-words-stupidly) + "M-w" acdw/copy-region-plain) (with-eval-after-load 'org-export (add-to-list 'org-export-filter-final-output-functions diff --git a/lisp/acdw.el b/lisp/acdw.el index be12dd6..eab0719 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -309,6 +309,16 @@ With a prefix argument, run git pull on the repo first." ;;; Specialized functions +(defun acdw/copy-region-plain (start end) + "Copy a region to clipboard, removing all Org formatting." + (interactive "*r") + (let ((s (buffer-substring-no-properties start end))) + (with-temp-buffer + (insert s) + (let ((sentence-end-double-space nil)) + (unfill-region (point-min) (point-max))) + (copy-region-as-kill (point-min) (point-max))))) + (defun acdw/dir (&optional file make-directory) "Place Emacs files in one place. -- cgit 1.4.1-21-gabe81