emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tom Hinton <tom.hinton@cse.org.uk>
To: emacs-orgmode@gnu.org
Subject: Fix for clocking in when org-clock-into-drawer is not a string
Date: Thu, 13 Aug 2015 15:32:51 +0100	[thread overview]
Message-ID: <87oaib9s30.fsf@turnpike.cse.org.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 459 bytes --]

Hello,

I have encountered a fault in recent versions of org when clocking into a task with a dangling clock when
org-clock-into-drawer is an integer rather than a string. It appears the error was a presumption that
org-clock-into-drawer would be a string for the construction of a regex. Attached is a trivial single line patch
which seems to fix this for me. make test reports no additional test failures with the patch applied.

All the best,

Tom Hinton


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-clock-in-when-org-clock-into-drawer-is-integer.patch --]
[-- Type: text/x-diff, Size: 1104 bytes --]

From 498b0ae295453e1ce5ef42d54cb8dfb9f930809e Mon Sep 17 00:00:00 2001
From: Tom Hinton <tom.hinton@cse.org.uk>
Date: Wed, 12 Aug 2015 12:46:47 +0100
Subject: [PATCH] Fix clock in when org-clock-into-drawer is integer

* org-clock.el (org-clock-jump-to-current-clock):
  fixed a bug wherein org-clock-jump-to-current-clock did not work if org-clock-into-drawer
  was not either a string or nil.

This is a TINYCHANGE, although I am happy to assign copyright to the FSF.
---
 lisp/org-clock.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index e44da73..6de093f 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -950,7 +950,7 @@ If necessary, clock-out of the currently active clock."
       (when drawer
 	(org-with-wide-buffer
 	 (let ((drawer-re (format "^[ \t]*:%s:[ \t]*$"
-				  (regexp-quote (or drawer "LOGBOOK"))))
+				  (regexp-quote (if (stringp drawer) drawer "LOGBOOK"))))
 	       (beg (save-excursion (outline-back-to-heading t) (point))))
 	   (catch 'exit
 	     (while (re-search-backward drawer-re beg t)
-- 
2.1.4


[-- Attachment #3: Type: text/plain, Size: 52 bytes --]

-- 
http://www.cse.org.uk/about-us/staff#Tom-Hinton

             reply	other threads:[~2015-08-13 14:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13 14:32 Tom Hinton [this message]
2015-08-13 21:00 ` Fix for clocking in when org-clock-into-drawer is not a string Nicolas Goaziou
  -- strict thread matches above, loose matches on Subject: below --
2015-08-12 11:55 Tom Hinton
2015-08-16 14:17 ` Bastien Guerry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oaib9s30.fsf@turnpike.cse.org.uk \
    --to=tom.hinton@cse.org.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).