aboutsummaryrefslogtreecommitdiffstats
path: root/oni-org
diff options
context:
space:
mode:
authorGravatar Tom Willemse2021-09-12 03:09:18 -0700
committerGravatar Tom Willemse2021-09-12 03:09:18 -0700
commita82ee89a23733ed8f7960e659192309b007831ac (patch)
treec156be41c494249d846a397ea27c5359d4631018 /oni-org
parent6993a3f7afd3d734a79784de968caadaca3233a5 (diff)
downloademacs-config-a82ee89a23733ed8f7960e659192309b007831ac.tar.gz
emacs-config-a82ee89a23733ed8f7960e659192309b007831ac.zip
[oni-org] Log non-state notes into the task, outside a drawer
Diffstat (limited to 'oni-org')
-rw-r--r--oni-org/oni-org.el18
1 files changed, 16 insertions, 2 deletions
diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el
index 8e0a86a..b5d94d0 100644
--- a/oni-org/oni-org.el
+++ b/oni-org/oni-org.el
@@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2021.0911.024748
+;; Version: 2021.0912.030631
;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org org-contrib org-bullets org-edna diminish all-the-icons olivetti mixed-pitch)
;; This program is free software; you can redistribute it and/or modify
@@ -374,7 +374,6 @@ _di_: Add inlineimages STARTUP
(setq org-habit-graph-column 60)
(setq org-hide-emphasis-markers t)
(setq org-hide-macro-markers t)
-(setq org-log-into-drawer t)
(setq org-pretty-entities t)
(setq org-return-follows-link t)
(setq org-return-follows-link t)
@@ -385,6 +384,21 @@ _di_: Add inlineimages STARTUP
(setq org-use-fast-todo-selection t)
(setq org-use-sub-superscripts '{})
+;; Generally, for state updates and such, I like to have all of the notes added
+;; into the logbook, but when I want to add a note manually I definitely want it
+;; to show up easily seen in the buffer.
+(setq org-log-into-drawer t)
+
+(defun oni-org-logging-outside-drawer (func &rest args)
+ "Call FUNC with ARGS.
+Set ‘org-log-into-drawer’ to nil if we’re trying to take a note,
+and not a state update."
+ (let ((org-log-into-drawer (not (eql org-log-note-purpose 'note))))
+ (apply func args)))
+
+(add-function :around (symbol-function 'org-store-log-note)
+ #'oni-org-logging-outside-drawer)
+
;; Set the maximum indentation level for description lists to 5 (which is the
;; seemingly hardcoded value of the indentation it gets when it goes over
;; ‘org-list-description-max-indent’) so that I don’t get dangling descriptions