* Fix for clocking in when org-clock-into-drawer is not a string
@ 2015-08-12 11:55 Tom Hinton
2015-08-16 14:17 ` Bastien Guerry
0 siblings, 1 reply; 4+ messages in thread
From: Tom Hinton @ 2015-08-12 11:55 UTC (permalink / raw)
To: emacs-orgmode
[-- 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: 53 bytes --]
--
http://www.cse.org.uk/about-us/staff#Tom-Hinton
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Fix for clocking in when org-clock-into-drawer is not a string
@ 2015-08-13 14:32 Tom Hinton
2015-08-13 21:00 ` Nicolas Goaziou
0 siblings, 1 reply; 4+ messages in thread
From: Tom Hinton @ 2015-08-13 14:32 UTC (permalink / raw)
To: emacs-orgmode
[-- 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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: Fix for clocking in when org-clock-into-drawer is not a string
2015-08-13 14:32 Fix for clocking in when org-clock-into-drawer is not a string Tom Hinton
@ 2015-08-13 21:00 ` Nicolas Goaziou
0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2015-08-13 21:00 UTC (permalink / raw)
To: Tom Hinton; +Cc: emacs-orgmode
Hello,
Tom Hinton <tom.hinton@cse.org.uk> writes:
> 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.
Applied. Thank you.
> This is a TINYCHANGE, although I am happy to assign copyright to the
> FSF.
It will help for future patches. See
http://orgmode.org/worg/org-contribute.html if you need directions.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Fix for clocking in when org-clock-into-drawer is not a string
2015-08-12 11:55 Tom Hinton
@ 2015-08-16 14:17 ` Bastien Guerry
0 siblings, 0 replies; 4+ messages in thread
From: Bastien Guerry @ 2015-08-16 14:17 UTC (permalink / raw)
To: Tom Hinton; +Cc: emacs-orgmode
Hi Tom,
I see this has been committed, thanks!
--
Bastien
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-08-16 14:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-13 14:32 Fix for clocking in when org-clock-into-drawer is not a string Tom Hinton
2015-08-13 21:00 ` 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
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.