summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-08-12 21:06:07 -0500
committerCase Duckworth2021-08-12 21:07:47 -0500
commitfe2f9241d2911d61cb1a8da0d97f41ade8e56c1a (patch)
treeaace0e0f41851236587b630deaa8ca800dfa2741
parentOnly show wc mode-line in wc-mode (diff)
downloademacs-fe2f9241d2911d61cb1a8da0d97f41ade8e56c1a.tar.gz
emacs-fe2f9241d2911d61cb1a8da0d97f41ade8e56c1a.zip
Add acdw/copy-region-plain
This is finally the thing I was looking for
-rw-r--r--init.el3
-rw-r--r--lisp/acdw.el10
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'."
1334 "<S-return>" acdw-org/org-table-copy-down 1334 "<S-return>" acdw-org/org-table-copy-down
1335 "M-SPC M-SPC" insert-zero-width-space 1335 "M-SPC M-SPC" insert-zero-width-space
1336 "C-c C-l" org-insert-link-dwim 1336 "C-c C-l" org-insert-link-dwim
1337 "M-w" kill-ring-save-unfilled 1337 "M-w" acdw/copy-region-plain)
1338 "M-=" acdw-org/count-words-stupidly)
1339 1338
1340 (with-eval-after-load 'org-export 1339 (with-eval-after-load 'org-export
1341 (add-to-list 'org-export-filter-final-output-functions 1340 (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."
309 309
310;;; Specialized functions 310;;; Specialized functions
311 311
312(defun acdw/copy-region-plain (start end)
313 "Copy a region to clipboard, removing all Org formatting."
314 (interactive "*r")
315 (let ((s (buffer-substring-no-properties start end)))
316 (with-temp-buffer
317 (insert s)
318 (let ((sentence-end-double-space nil))
319 (unfill-region (point-min) (point-max)))
320 (copy-region-as-kill (point-min) (point-max)))))
321
312(defun acdw/dir (&optional file make-directory) 322(defun acdw/dir (&optional file make-directory)
313 "Place Emacs files in one place. 323 "Place Emacs files in one place.
314 324