[-- Attachment #1: Type: text/plain, Size: 351 bytes --] I'm still slowly chewing on making more use of log items, and found a small bug in org-log-beginning. It contains a partial re-implementation of something we already have a function for: org-log-into-drawer. It was causing me occasional bugs, but I only just looked into it. I'm not sure the commit message makes a whole lot of sense, but... Eric [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-Use-org-log-into-drawer-in-org-log-beginning.patch --] [-- Type: text/x-diff, Size: 910 bytes --] From ac1a4eb4b153f18d8766fdbe6ba4e2168f80ec16 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen <eric@ericabrahamsen.net> Date: Sun, 14 Dec 2014 14:38:34 +0800 Subject: [PATCH] Use org-log-into-drawer in org-log-beginning * lisp/org.el (org-log-beginning): Use existing function for discovering the log specification. --- lisp/org.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index bed5cb9..4aa7988 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -13609,8 +13609,7 @@ narrowing." (forward-line)) (if (org-at-heading-p) (point) (let ((end (save-excursion (outline-next-heading) (point))) - (drawer (cond ((stringp org-log-into-drawer) org-log-into-drawer) - (org-log-into-drawer "LOGBOOK")))) + (drawer (org-log-into-drawer))) (cond (drawer (let ((regexp (concat "^[ \t]*:" (regexp-quote drawer) ":[ \t]*$")) -- 2.1.3
Hello,
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> I'm still slowly chewing on making more use of log items, and found a
> small bug in org-log-beginning. It contains a partial re-implementation
> of something we already have a function for: org-log-into-drawer. It was
> causing me occasional bugs, but I only just looked into it.
Applied. Thank you.
Regards,
--
Nicolas Goaziou
Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
> Hello,
>
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> I'm still slowly chewing on making more use of log items, and found a
>> small bug in org-log-beginning. It contains a partial re-implementation
>> of something we already have a function for: org-log-into-drawer. It was
>> causing me occasional bugs, but I only just looked into it.
>
> Applied. Thank you.
>
>
> Regards,
Ack, wait! I think that was a bad patch. If org-log-into-drawer is
simply set to t, the t falls through into the drawer regexp and causes
and error. I'm sorry -- I was sure I'd tested all the variants.
The question is, should `org-log-into-drawer' always return the string
name of the drawer or nil, or should `org-log-beginning' check if the
return value isn't a string, and substitute the "LOGBOOK" default? I
guess I'm leaning towards the first...
Eric