Check whether org-clock-into-string is a string

This commit is contained in:
John Wiegley 2009-11-12 02:04:24 -05:00
parent 2b52834355
commit 1affd3bbb6
2 changed files with 22 additions and 13 deletions

View File

@ -1,3 +1,8 @@
2009-11-12 John Wiegley <jwiegley@gmail.com>
* org-clock.el (org-clock-resolve): If `org-clock-into-string' is
a string, use that to find the LOGBOOK drawer.
2009-11-12 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-clone-subtree-with-time-shift): Make it work at the

View File

@ -678,22 +678,26 @@ was started."
(save-window-excursion
(save-excursion
(unless org-clock-resolving-clocks-due-to-idleness
(org-with-clock clock
(org-clock-goto))
(org-with-clock clock (org-clock-goto))
(with-current-buffer (marker-buffer (car clock))
(goto-char (car clock))
(if org-clock-into-drawer
(ignore-errors
(outline-flag-region (save-excursion
(outline-back-to-heading t)
(search-forward ":LOGBOOK:")
(goto-char (match-beginning 0)))
(save-excursion
(outline-back-to-heading t)
(search-forward ":LOGBOOK:")
(search-forward ":END:")
(goto-char (match-end 0)))
nil)))))
(let ((logbook
(if (stringp org-clock-into-drawer)
(concat ":" org-clock-into-drawer ":")
":LOGBOOK:")))
(ignore-errors
(outline-flag-region
(save-excursion
(outline-back-to-heading t)
(search-forward logbook)
(goto-char (match-beginning 0)))
(save-excursion
(outline-back-to-heading t)
(search-forward logbook)
(search-forward ":END:")
(goto-char (match-end 0)))
nil))))))
(let (char-pressed)
(while (null char-pressed)
(setq char-pressed