From a82ee89a23733ed8f7960e659192309b007831ac Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 12 Sep 2021 03:09:18 -0700 Subject: [PATCH] [oni-org] Log non-state notes into the task, outside a drawer --- oni-org/oni-org.el | 18 ++++++++++++++++-- 1 file 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 ;; 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