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. --- init.el | 6 ++++-- lisp/acdw.el | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index 98b64ab..aaecee4 100644 --- a/init.el +++ b/init.el @@ -1131,6 +1131,7 @@ if ripgrep is installed, otherwise `consult-grep'." (require 'acdw-org) ; so I don't clutter up init.el (:option org-adapt-indentation nil org-catch-invisible-edits 'smart + org-clock-clocked-in-display 'mode-line org-confirm-babel-evaluate nil org-ellipsis " …" org-export-coding-system 'utf-8-unix @@ -1152,13 +1153,14 @@ if ripgrep is installed, otherwise `consult-grep'." org-src-tab-acts-natively t org-src-window-setup 'current-window org-startup-truncated nil - org-tags-column (- 0 fill-column -3) + org-tags-column 0 ; (- 0 fill-column -3) org-directory "~/org") (:bind "RET" acdw-org/return-dwim "" acdw-org/org-table-copy-down "M-SPC M-SPC" insert-zero-width-space - "C-c C-l" org-insert-link-dwim) + "C-c C-l" org-insert-link-dwim + "M-w" kill-ring-save-unfilled) (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 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