emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* clock-in clock-out problems
@ 2014-08-18 15:40 hymie!
  2014-08-18 18:26 ` Joost Helberg
  0 siblings, 1 reply; 16+ messages in thread
From: hymie! @ 2014-08-18 15:40 UTC (permalink / raw)
  To: emacs-orgmode

Greetings.

I've discovered a problem with clocking-in and clocking-out.  I think
this used to work in the past (when I ran 8.2.7a and/or 8.2.7b), but
I've had the same problem twice (both with 8.2.7c) .

I have a TODO scheduled for today:
* TODO run clamav on machine
  SCHEDULED: <2014-08-18 Mon 09:00>

I get to work and start it with C-c C-x C-i
* TODO run clamav on machine
  SCHEDULED: <2014-08-18 Mon 09:00>
  CLOCK: [2014-08-18 Mon 08:55]

I save the file, exit emacs, and go off to do other things that may or
may not include playing larn.  This seems to be the important part
(saving and exiting the file, not playing larn).

I get back to my desk, run emacs, and try to clock out of the task
with C-c C-x C-o.  I get an error "No active clock".  I get this same
error whether my cursor is on the "TODO" line or the "CLOCK" line.

Now it gets weird.  I try to clock in again with C-c C-x C-i.
I get a warning of a "Dangling clock started 60 minutes ago" and
I'm asked to "Select a Clock Resolution Command".  So clearly it
sees that there is an open clock that needs to be resolved somehow,
except C-c C-x C-o still maintains "No active clock."

I don't have the self-confidence to ask "How do I file a bug report?"
Instead I will ask "What did I do wrong?"

--hymie!    http://lactose.homelinux.net/~hymie    hymie@lactose.homelinux.net

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-18 15:40 clock-in clock-out problems hymie!
@ 2014-08-18 18:26 ` Joost Helberg
  2014-08-18 19:02   ` hymie!
  0 siblings, 1 reply; 16+ messages in thread
From: Joost Helberg @ 2014-08-18 18:26 UTC (permalink / raw)
  To: hymie!; +Cc: emacs-orgmode

Dear Hymie,

The customizable variable: 
 org-clock-persist

is used for solving this.

regards,

Joost

BTW: why do you leave emacs?

>>>>> "hymie!" == hymie!  <hymie@lactose.homelinux.net> writes:
 > From: hymie! <hymie@lactose.homelinux.net>
 > To: emacs-orgmode@gnu.org
 > Subject: [O] clock-in clock-out problems
 > Date: 2014-08-18T17:40:19+0200

 > Greetings.

 > I've discovered a problem with clocking-in and clocking-out.  I think
 > this used to work in the past (when I ran 8.2.7a and/or 8.2.7b), but
 > I've had the same problem twice (both with 8.2.7c) .

 > I have a TODO scheduled for today:
 > * TODO run clamav on machine
 >   SCHEDULED: <2014-08-18 Mon 09:00>

 > I get to work and start it with C-c C-x C-i
 > * TODO run clamav on machine
 >   SCHEDULED: <2014-08-18 Mon 09:00>
 >   CLOCK: [2014-08-18 Mon 08:55]

 > I save the file, exit emacs, and go off to do other things that may or
 > may not include playing larn.  This seems to be the important part
 > (saving and exiting the file, not playing larn).

 > I get back to my desk, run emacs, and try to clock out of the task
 > with C-c C-x C-o.  I get an error "No active clock".  I get this same
 > error whether my cursor is on the "TODO" line or the "CLOCK" line.

 > Now it gets weird.  I try to clock in again with C-c C-x C-i.
 > I get a warning of a "Dangling clock started 60 minutes ago" and
 > I'm asked to "Select a Clock Resolution Command".  So clearly it
 > sees that there is an open clock that needs to be resolved somehow,
 > except C-c C-x C-o still maintains "No active clock."

 > I don't have the self-confidence to ask "How do I file a bug report?"
 > Instead I will ask "What did I do wrong?"

 > --hymie!    http://lactose.homelinux.net/~hymie    hymie@lactose.homelinux.net



-- 
Snow B.V.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-18 18:26 ` Joost Helberg
@ 2014-08-18 19:02   ` hymie!
  2014-08-18 20:10     ` Nick Dokos
  0 siblings, 1 reply; 16+ messages in thread
From: hymie! @ 2014-08-18 19:02 UTC (permalink / raw)
  To: emacs-orgmode

In our last episode, the evil Dr. Lacto had captured our hero,
  Joost Helberg <joost@snow.nl>, who said:
>Dear Hymie,
>
>The customizable variable: 
> org-clock-persist
>
>is used for solving this.

Thanks for the info.  However, when I tried it out, I get asked
"Resume clock (test) (y or n)"  If I answer "n" then the problem recurs
(as I would expect).  If I answer "y", then I get an error
(lines cut to 75-ish, but I can try to send the full entire error message
if needed)

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  goto-char(nil)
  (cond ((and org-clock-in-resume (looking-at (concat "^[       ]*" org-cloc
  (save-restriction (widen) (goto-char target-pos) (org-back-to-heading t) (
  (save-excursion (save-restriction (widen) (goto-char target-pos) (org-back
  (save-excursion (if (and selected-task (marker-buffer selected-task)) (pro
  (let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness) 
  (catch (quote abort) (let ((interrupting (and (not org-clock-resolving-clo
  org-clock-in()
[...]

In either case, "No active clock."

I'm honestly not sure in what circumstances I would **not** want the
clock to be persistent, but oh well.

>BTW: why do you leave emacs?

There is a certain flame war that I do not wish to invoke.  Let's just
say that I've been using a different editor for xxVIi years and I've
grown accustomed to it.  The only thing I currently use emacs for is
org-mode.

But sometimes I have to log out. Sometimes my work network drops and it
logs me out for me.  Sometimes I move from machine to machine and have
to edit my files from elsewhere.  There are tons of reasons why I can't
just leave emacs running.

--hymie!    http://lactose.homelinux.net/~hymie    hymie@lactose.homelinux.net

>
> > I've discovered a problem with clocking-in and clocking-out.  I think
> > this used to work in the past (when I ran 8.2.7a and/or 8.2.7b), but
> > I've had the same problem twice (both with 8.2.7c) .
>
> > I have a TODO scheduled for today:
> > * TODO run clamav on machine
> >   SCHEDULED: <2014-08-18 Mon 09:00>
>
> > I get to work and start it with C-c C-x C-i
> > * TODO run clamav on machine
> >   SCHEDULED: <2014-08-18 Mon 09:00>
> >   CLOCK: [2014-08-18 Mon 08:55]
>
> > I save the file, exit emacs, and go off to do other things that may or
> > may not include playing larn.  This seems to be the important part
> > (saving and exiting the file, not playing larn).
>
> > I get back to my desk, run emacs, and try to clock out of the task
> > with C-c C-x C-o.  I get an error "No active clock".  I get this same
> > error whether my cursor is on the "TODO" line or the "CLOCK" line.
>
> > Now it gets weird.  I try to clock in again with C-c C-x C-i.
> > I get a warning of a "Dangling clock started 60 minutes ago" and
> > I'm asked to "Select a Clock Resolution Command".  So clearly it
> > sees that there is an open clock that needs to be resolved somehow,
> > except C-c C-x C-o still maintains "No active clock."
>
> > I don't have the self-confidence to ask "How do I file a bug report?"
> > Instead I will ask "What did I do wrong?"
>
> > --hymie!    http://lactose.homelinux.net/~hymie   

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-18 19:02   ` hymie!
@ 2014-08-18 20:10     ` Nick Dokos
  2014-08-18 20:18       ` Nick Dokos
                         ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Nick Dokos @ 2014-08-18 20:10 UTC (permalink / raw)
  To: emacs-orgmode

hymie@lactose.homelinux.net (hymie!) writes:

> In our last episode, the evil Dr. Lacto had captured our hero,
>   Joost Helberg <joost@snow.nl>, who said:
>>Dear Hymie,
>>
>>The customizable variable: 
>> org-clock-persist
>>
>>is used for solving this.
>
> Thanks for the info.  However, when I tried it out, I get asked
> "Resume clock (test) (y or n)"  If I answer "n" then the problem recurs
> (as I would expect).  If I answer "y", then I get an error
> (lines cut to 75-ish, but I can try to send the full entire error message
> if needed)
>
> Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
>   goto-char(nil)
>   (cond ((and org-clock-in-resume (looking-at (concat "^[       ]*" org-cloc
>   (save-restriction (widen) (goto-char target-pos) (org-back-to-heading t) (
>   (save-excursion (save-restriction (widen) (goto-char target-pos) (org-back
>   (save-excursion (if (and selected-task (marker-buffer selected-task)) (pro
>   (let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness) 
>   (catch (quote abort) (let ((interrupting (and (not org-clock-resolving-clo
>   org-clock-in()
> [...]
>
> In either case, "No active clock."
>

I added the following to my .emacs

--8<---------------cut here---------------start------------->8---
(require 'org-clock)
(setq org-clock-persist t)
(org-clock-persistence-insinuate)
--8<---------------cut here---------------end--------------->8---

I then start a clock, exit, restart emacs, get asked the "Resume
clock" question, say "y", work for a while, stop the clock and
everything seems OK.

Org-mode version 8.3beta (release_8.3beta-245-g3a1fff)

If you get an error, then it might be a bug in your version. Post the
version along with the complete backtrace (preferably using
org-submit-bug-report). Also, include the entry that you are clocking -
the error above seems to come from an inability to match the entry:

--8<---------------cut here---------------start------------->8---
	    (cond
	     ((and org-clock-in-resume
		   (looking-at
		    (concat "^[ \t]*" org-clock-string
			    " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}"
			    " *\\sw+\.? +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$")))
	      (message "Matched %s" (match-string 1))
	      (setq ts (concat "[" (match-string 1) "]"))
	      (goto-char (match-end 1))    <<<<<<<<<<<<<<< apparently (match-end 1) returned nil
	      (setq org-clock-start-time
		    (apply 'encode-time
			   (org-parse-time-string (match-string 1))))
	      (setq org-clock-effort (org-entry-get (point) org-effort-property))
	      (setq org-clock-total-time (org-clock-sum-current-item
					  (org-clock-get-sum-start))))
--8<---------------cut here---------------end--------------->8---

--
Nick

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-18 20:10     ` Nick Dokos
@ 2014-08-18 20:18       ` Nick Dokos
  2014-08-18 20:55       ` hymie!
  2014-08-19  7:55       ` Sebastien Vauban
  2 siblings, 0 replies; 16+ messages in thread
From: Nick Dokos @ 2014-08-18 20:18 UTC (permalink / raw)
  To: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:


> 	      (message "Matched %s" (match-string 1))

Also check your *Messages* buffer to see what matched.

> 	      (setq ts (concat "[" (match-string 1) "]"))
> 	      (goto-char (match-end 1))    <<<<<<<<<<<<<<< apparently (match-end 1) returned nil

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-18 20:10     ` Nick Dokos
  2014-08-18 20:18       ` Nick Dokos
@ 2014-08-18 20:55       ` hymie!
  2014-08-18 21:39         ` Nick Dokos
  2014-08-19  7:55       ` Sebastien Vauban
  2 siblings, 1 reply; 16+ messages in thread
From: hymie! @ 2014-08-18 20:55 UTC (permalink / raw)
  To: emacs-orgmode

In our last episode, the evil Dr. Lacto had captured our hero,
  Nick Dokos <ndokos@gmail.com>, who said:
>hymie@lactose.homelinux.net (hymie!) writes:
>
>> In our last episode, the evil Dr. Lacto had captured our hero,
>>   Joost Helberg <joost@snow.nl>, who said:
>>>Dear Hymie,
>>>
>>>The customizable variable: 
>>> org-clock-persist
>>>
>>>is used for solving this.
>>
>> Thanks for the info.  However, when I tried it out, I get asked
>> "Resume clock (test) (y or n)"  If I answer "n" then the problem recurs
>> (as I would expect).  If I answer "y", then I get an error
>> (lines cut to 75-ish, but I can try to send the full entire error message
>> if needed)
>>
>> Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
>>   goto-char(nil)
>>   (cond ((and org-clock-in-resume (looking-at (concat "^[       ]*" org-cloc
>>   (save-restriction (widen) (goto-char target-pos) (org-back-to-heading t) (
>>   (save-excursion (save-restriction (widen) (goto-char target-pos) (org-back
>>   (save-excursion (if (and selected-task (marker-buffer selected-task)) (pro
>>   (let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness) 
>>   (catch (quote abort) (let ((interrupting (and (not org-clock-resolving-clo
>>   org-clock-in()
>> [...]
>
>I added the following to my .emacs
>
>--8<---------------cut here---------------start------------->8---
>(require 'org-clock)
>(setq org-clock-persist t)
>(org-clock-persistence-insinuate)
>--8<---------------cut here---------------end--------------->8---

I didn't have (require 'org-clock) ; just added it; no help.

>If you get an error, then it might be a bug in your version. Post the
>version along with the complete backtrace (preferably using
>org-submit-bug-report).

The entry that I'm using is just

* TODO clock test
  CLOCK: [2014-08-18 Mon 16:20]

(This is the "Messages" that you asked for in the other post)

("emacs" "zz.org")
For information about GNU Emacs and the GNU system, type C-x h C-a.
Restoring clock data
Loading /home/hymie/.emacs.d/org-clock-save.el (source)...done
Resume clock (clock test) (y or n)  y
Matched 2014-08-18 Mon 16:20
Entering debugger...
Quit

(This is the org-submit-bug-report)

Emacs  : GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.13)
 of 2014-06-17 on herman
Package: Org-mode version 8.2.7c (8.2.7c-dist @ /home/hymie/org-mode/lisp/)

current state:
==============
(setq
 org-agenda-log-mode-items '(closed clock state)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
                          org-babel-execute-safely-maybe)
 org-clock-in-resume 'auto-restart
 org-agenda-skip-scheduled-if-done t
 org-clock-persist t
 org-tab-first-hook '(org-hide-block-toggle-maybe
                      org-src-native-tab-command-maybe
                      org-babel-hide-result-toggle-maybe
                      org-babel-header-arg-expand)
 org-modules '(org-bbdb org-bibtex org-docview org-gnus org-habit org-info
               org-irc org-mhe org-rmail org-w3m)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
                  org-cycle-hide-inline-tasks org-cycle-show-empty-lines
                  org-optimize-window-after-visibility-change)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-speed-command-hook '(org-speed-command-default-hook
                          org-babel-speed-command-hook)
 org-babel-pre-tangle-hook '(save-buffer)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-clock-auto-clock-resolution nil
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-agenda-skip-deadline-if-done t
 org-mode-hook '(org-clock-load
                 (lambda nil
                  (org-add-hook (quote change-major-mode-hook)
                   (quote org-show-block-all) (quote append) (quote local))
                  )
                 (lambda nil
                  (org-add-hook (quote change-major-mode-hook)
                   (quote org-babel-show-result-all) (quote append)
                   (quote local))
                  )
                 org-babel-result-hide-spec org-babel-hide-all-hashes
                 turn-on-font-lock)
 org-directory "~"
 org-from-is-user-regexp "\\<hymie!\\>"
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" "|" "DONE(d!)"
                      "CANCELED(c@)")
                     )
 org-agenda-files '("~/org/")
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
                     org-src-mode-configure-edit-buffer)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-confirm-shell-link-function 'yes-or-no-p
 )

--hymie!    http://lactose.homelinux.net/~hymie    hymie@lactose.homelinux.net

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-18 20:55       ` hymie!
@ 2014-08-18 21:39         ` Nick Dokos
  2014-08-19  3:23           ` hymie!
  0 siblings, 1 reply; 16+ messages in thread
From: Nick Dokos @ 2014-08-18 21:39 UTC (permalink / raw)
  To: emacs-orgmode

hymie@lactose.homelinux.net (hymie!) writes:

>>> (lines cut to 75-ish, but I can try to send the full entire error message
>>> if needed)
>>>
>>> Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
>>>   goto-char(nil)
>>>   (cond ((and org-clock-in-resume (looking-at (concat "^[       ]*" org-cloc
>>>   (save-restriction (widen) (goto-char target-pos) (org-back-to-heading t) (
>>>   (save-excursion (save-restriction (widen) (goto-char target-pos) (org-back
>>>   (save-excursion (if (and selected-task (marker-buffer selected-task)) (pro
>>>   (let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness) 
>>>   (catch (quote abort) (let ((interrupting (and (not org-clock-resolving-clo
>>>   org-clock-in()
>>> [...]
>>
>>I added the following to my .emacs
>>
>>--8<---------------cut here---------------start------------->8---
>>(require 'org-clock)
>>(setq org-clock-persist t)
>>(org-clock-persistence-insinuate)
>>--8<---------------cut here---------------end--------------->8---
>
> I didn't have (require 'org-clock) ; just added it; no help.
>
>>If you get an error, then it might be a bug in your version. Post the
>>version along with the complete backtrace (preferably using
>>org-submit-bug-report).
>
> The entry that I'm using is just
>
> * TODO clock test
>   CLOCK: [2014-08-18 Mon 16:20]
>
> (This is the "Messages" that you asked for in the other post)
>
> ("emacs" "zz.org")
> For information about GNU Emacs and the GNU system, type C-x h C-a.
> Restoring clock data
> Loading /home/hymie/.emacs.d/org-clock-save.el (source)...done
> Resume clock (clock test) (y or n)  y
> Matched 2014-08-18 Mon 16:20
> Entering debugger...
> Quit
>

... and the complete backtrace? Does it look like the partial one
you posted before? In particular, is the argument to goto-char nil?

If that's the case, and assuming I'm in the right place in the source
code, *Messages* shows the correct value for the matched string but the
backtrace shows that match-end returned nil which means that the regexp
*did not match*.  Both of these two cannot be right (unless there is a bug
in the emacs regexp matching code, which for now at least, I'm
discounting).

--
Nick

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-18 21:39         ` Nick Dokos
@ 2014-08-19  3:23           ` hymie!
  2014-08-19 15:01             ` hymie!
  0 siblings, 1 reply; 16+ messages in thread
From: hymie! @ 2014-08-19  3:23 UTC (permalink / raw)
  To: emacs-orgmode

In our last episode, the evil Dr. Lacto had captured our hero,
  Nick Dokos <ndokos@gmail.com>, who said:
>hymie@lactose.homelinux.net (hymie!) writes:
>
>> (This is the "Messages" that you asked for in the other post)
>>
>> ("emacs" "zz.org")
>> For information about GNU Emacs and the GNU system, type C-x h C-a.
>> Restoring clock data
>> Loading /home/hymie/.emacs.d/org-clock-save.el (source)...done
>> Resume clock (clock test) (y or n)  y
>> Matched 2014-08-18 Mon 16:20
>> Entering debugger...
>> Quit
>>

Sorry.  I missed the "backtrace".  I hope this works, the lines are
longer than the permitted 78 characters.

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  goto-char(nil)
  (cond ((and org-clock-in-resume (looking-at (concat "^[ 	]*" org-clock-string " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}" " *\\sw+.? +[012][0-9]:[0-5][0-9]\\)\\][ 	]*$"))) (message "Matched %s" (match-string 1)) (setq ts (concat "[" (match-string 1) "]")) (goto-char (match-end 1)) (setq org-clock-start-time (apply (quote encode-time) (org-parse-time-string (match-string 1)))) (setq org-clock-effort (org-entry-get (point) org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-sum-start)))) ((eq org-clock-in-resume (quote auto-restart)) (message "Cannot restart clock because task does not contain unfinished clock") (ding) (sit-for 2) (throw (quote abort) nil)) (t (insert-before-markers "\n") (backward-char 1) (org-indent-line) (if (and (save-excursi
 on (end-of-line 0) (org-in-item-p))) (progn (beginning-of-line 1) (org-indent-line-to (- (org-get-indentation) 2)))) (insert org-clock-string " ") (setq org-clock-effort (org-entry-get (point) org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-sum-start))) (setq org-clock-start-time (or (and org-clock-continuously org-clock-out-time) (and leftover (y-or-n-p (format "You stopped another clock %d mins ago; start this one from then? " (/ ... 60))) leftover) start-time (org-current-time org-clock-rounding-minutes t))) (setq ts (org-insert-time-stamp org-clock-start-time (quote with-hm) (quote inactive)))))
  (save-restriction (widen) (goto-char target-pos) (org-back-to-heading t) (or interrupting (move-marker org-clock-interrupted-task nil)) (run-hooks (quote org-clock-in-prepare-hook)) (org-clock-history-push) (setq org-clock-current-task (nth 4 (org-heading-components))) (cond ((functionp org-clock-in-switch-to-state) (looking-at org-complex-heading-regexp) (let ((newstate (funcall org-clock-in-switch-to-state (match-string 2)))) (if newstate (org-todo newstate)))) ((and org-clock-in-switch-to-state (not (looking-at (concat org-outline-regexp "[ 	]*" org-clock-in-switch-to-state "\\>")))) (org-todo org-clock-in-switch-to-state))) (setq org-clock-heading (cond ((and org-clock-heading-function (functionp org-clock-heading-function)) (funcall org-clock-heading-function)) ((nth 4 (org-heading-
 components)) (replace-regexp-in-string "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1" (match-string-no-properties 4))) (t "???"))) (org-clock-find-position org-clock-in-resume) (cond ((and org-clock-in-resume (looking-at (concat "^[ 	]*" org-clock-string " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}" " *\\sw+.? +[012][0-9]:[0-5][0-9]\\)\\][ 	]*$"))) (message "Matched %s" (match-string 1)) (setq ts (concat "[" (match-string 1) "]")) (goto-char (match-end 1)) (setq org-clock-start-time (apply (quote encode-time) (org-parse-time-string (match-string 1)))) (setq org-clock-effort (org-entry-get (point) org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-sum-start)))) ((eq org-clock-in-resume (quote auto-restart)) (message "Cannot restart clock because task doe
 s not contain unfinished clock") (ding) (sit-for 2) (throw (quote abort) nil)) (t (insert-before-markers "\n") (backward-char 1) (org-indent-line) (if (and (save-excursion (end-of-line 0) (org-in-item-p))) (progn (beginning-of-line 1) (org-indent-line-to (- (org-get-indentation) 2)))) (insert org-clock-string " ") (setq org-clock-effort (org-entry-get (point) org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-sum-start))) (setq org-clock-start-time (or (and org-clock-continuously org-clock-out-time) (and leftover (y-or-n-p (format "You stopped another clock %d mins ago; start this one from then? " ...)) leftover) start-time (org-current-time org-clock-rounding-minutes t))) (setq ts (org-insert-time-stamp org-clock-start-time (quote with-hm) (quote
  inactive))))) (move-marker org-clock-marker (point) (buffer-base-buffer)) (move-marker org-clock-hd-marker (save-excursion (org-back-to-heading t) (point)) (buffer-base-buffer)) (setq org-clock-has-been-used t) (if (or (eq org-clock-clocked-in-display (quote mode-line)) (eq org-clock-clocked-in-display (quote both))) (progn (or global-mode-string (setq global-mode-string (quote ("")))) (or (memq (quote org-mode-line-string) global-mode-string) (setq global-mode-string (append global-mode-string (quote (org-mode-line-string))))))) (if (or (eq org-clock-clocked-in-display (quote frame-title)) (eq org-clock-clocked-in-display (quote both))) (progn (setq frame-title-format org-clock-frame-title-format))) (org-clock-update-mode-line) (if org-clock-mode-line-timer (progn (cancel-timer org-clo
 ck-mode-line-timer) (setq org-clock-mode-line-timer nil))) (if org-clock-clocked-in-display (progn (setq org-clock-mode-line-timer (run-with-timer org-clock-update-period org-clock-update-period (quote org-clock-update-mode-line))))) (if org-clock-idle-timer (progn (cancel-timer org-clock-idle-timer) (setq org-clock-idle-timer nil))) (setq org-clock-idle-timer (run-with-timer 60 60 (quote org-resolve-clocks-if-idle))) (message "Clock starts at %s - %s" ts org--msg-extra) (run-hooks (quote org-clock-in-hook)))
  (save-excursion (save-restriction (widen) (goto-char target-pos) (org-back-to-heading t) (or interrupting (move-marker org-clock-interrupted-task nil)) (run-hooks (quote org-clock-in-prepare-hook)) (org-clock-history-push) (setq org-clock-current-task (nth 4 (org-heading-components))) (cond ((functionp org-clock-in-switch-to-state) (looking-at org-complex-heading-regexp) (let ((newstate (funcall org-clock-in-switch-to-state ...))) (if newstate (org-todo newstate)))) ((and org-clock-in-switch-to-state (not (looking-at (concat org-outline-regexp "[ 	]*" org-clock-in-switch-to-state "\\>")))) (org-todo org-clock-in-switch-to-state))) (setq org-clock-heading (cond ((and org-clock-heading-function (functionp org-clock-heading-function)) (funcall org-clock-heading-function)) ((nth 4 (org-headi
 ng-components)) (replace-regexp-in-string "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1" (match-string-no-properties 4))) (t "???"))) (org-clock-find-position org-clock-in-resume) (cond ((and org-clock-in-resume (looking-at (concat "^[ 	]*" org-clock-string " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}" " *\\sw+.? +[012][0-9]:[0-5][0-9]\\)\\][ 	]*$"))) (message "Matched %s" (match-string 1)) (setq ts (concat "[" (match-string 1) "]")) (goto-char (match-end 1)) (setq org-clock-start-time (apply (quote encode-time) (org-parse-time-string (match-string 1)))) (setq org-clock-effort (org-entry-get (point) org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-sum-start)))) ((eq org-clock-in-resume (quote auto-restart)) (message "Cannot restart clock because task 
 does not contain unfinished clock") (ding) (sit-for 2) (throw (quote abort) nil)) (t (insert-before-markers "\n") (backward-char 1) (org-indent-line) (if (and (save-excursion (end-of-line 0) (org-in-item-p))) (progn (beginning-of-line 1) (org-indent-line-to (- ... 2)))) (insert org-clock-string " ") (setq org-clock-effort (org-entry-get (point) org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-sum-start))) (setq org-clock-start-time (or (and org-clock-continuously org-clock-out-time) (and leftover (y-or-n-p ...) leftover) start-time (org-current-time org-clock-rounding-minutes t))) (setq ts (org-insert-time-stamp org-clock-start-time (quote with-hm) (quote inactive))))) (move-marker org-clock-marker (point) (buffer-base-buffer)) (move-marker org-
 clock-hd-marker (save-excursion (org-back-to-heading t) (point)) (buffer-base-buffer)) (setq org-clock-has-been-used t) (if (or (eq org-clock-clocked-in-display (quote mode-line)) (eq org-clock-clocked-in-display (quote both))) (progn (or global-mode-string (setq global-mode-string (quote ("")))) (or (memq (quote org-mode-line-string) global-mode-string) (setq global-mode-string (append global-mode-string (quote ...)))))) (if (or (eq org-clock-clocked-in-display (quote frame-title)) (eq org-clock-clocked-in-display (quote both))) (progn (setq frame-title-format org-clock-frame-title-format))) (org-clock-update-mode-line) (if org-clock-mode-line-timer (progn (cancel-timer org-clock-mode-line-timer) (setq org-clock-mode-line-timer nil))) (if org-clock-clocked-in-display (progn (setq org-cl
 ock-mode-line-timer (run-with-timer org-clock-update-period org-clock-update-period (quote org-clock-update-mode-line))))) (if org-clock-idle-timer (progn (cancel-timer org-clock-idle-timer) (setq org-clock-idle-timer nil))) (setq org-clock-idle-timer (run-with-timer 60 60 (quote org-resolve-clocks-if-idle))) (message "Clock starts at %s - %s" ts org--msg-extra) (run-hooks (quote org-clock-in-hook))))
  (save-excursion (if (and selected-task (marker-buffer selected-task)) (progn (set-buffer (org-base-buffer (marker-buffer selected-task))) (setq target-pos (marker-position selected-task)) (move-marker selected-task nil))) (save-excursion (save-restriction (widen) (goto-char target-pos) (org-back-to-heading t) (or interrupting (move-marker org-clock-interrupted-task nil)) (run-hooks (quote org-clock-in-prepare-hook)) (org-clock-history-push) (setq org-clock-current-task (nth 4 (org-heading-components))) (cond ((functionp org-clock-in-switch-to-state) (looking-at org-complex-heading-regexp) (let ((newstate ...)) (if newstate (org-todo newstate)))) ((and org-clock-in-switch-to-state (not (looking-at ...))) (org-todo org-clock-in-switch-to-state))) (setq org-clock-heading (cond ((and org-clo
 ck-heading-function (functionp org-clock-heading-function)) (funcall org-clock-heading-function)) ((nth 4 (org-heading-components)) (replace-regexp-in-string "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1" (match-string-no-properties 4))) (t "???"))) (org-clock-find-position org-clock-in-resume) (cond ((and org-clock-in-resume (looking-at (concat "^[ 	]*" org-clock-string " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}" " *\\sw+.? +[012][0-9]:[0-5][0-9]\\)\\][ 	]*$"))) (message "Matched %s" (match-string 1)) (setq ts (concat "[" (match-string 1) "]")) (goto-char (match-end 1)) (setq org-clock-start-time (apply (quote encode-time) (org-parse-time-string ...))) (setq org-clock-effort (org-entry-get (point) org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-su
 m-start)))) ((eq org-clock-in-resume (quote auto-restart)) (message "Cannot restart clock because task does not contain unfinished clock") (ding) (sit-for 2) (throw (quote abort) nil)) (t (insert-before-markers "\n") (backward-char 1) (org-indent-line) (if (and (save-excursion ... ...)) (progn (beginning-of-line 1) (org-indent-line-to ...))) (insert org-clock-string " ") (setq org-clock-effort (org-entry-get (point) org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item (org-clock-get-sum-start))) (setq org-clock-start-time (or (and org-clock-continuously org-clock-out-time) (and leftover ... leftover) start-time (org-current-time org-clock-rounding-minutes t))) (setq ts (org-insert-time-stamp org-clock-start-time (quote with-hm) (quote inactive))))) (move-marker or
 g-clock-marker (point) (buffer-base-buffer)) (move-marker org-clock-hd-marker (save-excursion (org-back-to-heading t) (point)) (buffer-base-buffer)) (setq org-clock-has-been-used t) (if (or (eq org-clock-clocked-in-display (quote mode-line)) (eq org-clock-clocked-in-display (quote both))) (progn (or global-mode-string (setq global-mode-string (quote ...))) (or (memq (quote org-mode-line-string) global-mode-string) (setq global-mode-string (append global-mode-string ...))))) (if (or (eq org-clock-clocked-in-display (quote frame-title)) (eq org-clock-clocked-in-display (quote both))) (progn (setq frame-title-format org-clock-frame-title-format))) (org-clock-update-mode-line) (if org-clock-mode-line-timer (progn (cancel-timer org-clock-mode-line-timer) (setq org-clock-mode-line-timer nil)))
  (if org-clock-clocked-in-display (progn (setq org-clock-mode-line-timer (run-with-timer org-clock-update-period org-clock-update-period (quote org-clock-update-mode-line))))) (if org-clock-idle-timer (progn (cancel-timer org-clock-idle-timer) (setq org-clock-idle-timer nil))) (setq org-clock-idle-timer (run-with-timer 60 60 (quote org-resolve-clocks-if-idle))) (message "Clock starts at %s - %s" ts org--msg-extra) (run-hooks (quote org-clock-in-hook)))))
  (let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness) (org-clocking-p))) ts selected-task target-pos (org--msg-extra "") (leftover (and (not org-clock-resolving-clocks) org-clock-leftover-time))) (if (and org-clock-auto-clock-resolution (or (not interrupting) (eq t org-clock-auto-clock-resolution)) (not org-clock-clocking-in) (not org-clock-resolving-clocks)) (progn (setq org-clock-leftover-time nil) (let ((org-clock-clocking-in t)) (org-resolve-clocks)))) (if (equal select (quote (64))) (progn (let ((org-clock-continuously t)) (org-clock-in nil org-clock-out-time)))) (if (equal select (quote (4))) (progn (setq selected-task (org-clock-select-task "Clock-in on task: ")) (if selected-task (setq selected-task (copy-marker selected-task)) (error "Abort")))) (if (equal se
 lect (quote (16))) (progn (org-clock-mark-default-task))) (if interrupting (progn (if (save-excursion (if selected-task nil (org-back-to-heading t)) (and (equal (marker-buffer org-clock-hd-marker) (if selected-task ... ...)) (= (marker-position org-clock-hd-marker) (if selected-task ... ...)) (equal org-clock-current-task (nth 4 ...)))) (progn (message "Clock continues in \"%s\"" org-clock-heading) (throw (quote abort) nil))) (move-marker org-clock-interrupted-task (marker-position org-clock-marker) (marker-buffer org-clock-marker)) (let ((org-clock-clocking-in t)) (org-clock-out nil t)))) (setq target-pos (if (and (eobp) (not (org-at-heading-p))) (point-at-bol 0) (point))) (save-excursion (if (and selected-task (marker-buffer selected-task)) (progn (set-buffer (org-base-buffer (marker-b
 uffer selected-task))) (setq target-pos (marker-position selected-task)) (move-marker selected-task nil))) (save-excursion (save-restriction (widen) (goto-char target-pos) (org-back-to-heading t) (or interrupting (move-marker org-clock-interrupted-task nil)) (run-hooks (quote org-clock-in-prepare-hook)) (org-clock-history-push) (setq org-clock-current-task (nth 4 (org-heading-components))) (cond ((functionp org-clock-in-switch-to-state) (looking-at org-complex-heading-regexp) (let (...) (if newstate ...))) ((and org-clock-in-switch-to-state (not ...)) (org-todo org-clock-in-switch-to-state))) (setq org-clock-heading (cond ((and org-clock-heading-function ...) (funcall org-clock-heading-function)) ((nth 4 ...) (replace-regexp-in-string "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1" ...)) (t "???"
 ))) (org-clock-find-position org-clock-in-resume) (cond ((and org-clock-in-resume (looking-at ...)) (message "Matched %s" (match-string 1)) (setq ts (concat "[" ... "]")) (goto-char (match-end 1)) (setq org-clock-start-time (apply ... ...)) (setq org-clock-effort (org-entry-get ... org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item ...))) ((eq org-clock-in-resume (quote auto-restart)) (message "Cannot restart clock because task does not contain unfinished clock") (ding) (sit-for 2) (throw (quote abort) nil)) (t (insert-before-markers "\n") (backward-char 1) (org-indent-line) (if (and ...) (progn ... ...)) (insert org-clock-string " ") (setq org-clock-effort (org-entry-get ... org-effort-property)) (setq org-clock-total-time (org-clock-sum-current-item ...)) (set
 q org-clock-start-time (or ... ... start-time ...)) (setq ts (org-insert-time-stamp org-clock-start-time ... ...)))) (move-marker org-clock-marker (point) (buffer-base-buffer)) (move-marker org-clock-hd-marker (save-excursion (org-back-to-heading t) (point)) (buffer-base-buffer)) (setq org-clock-has-been-used t) (if (or (eq org-clock-clocked-in-display (quote mode-line)) (eq org-clock-clocked-in-display (quote both))) (progn (or global-mode-string (setq global-mode-string ...)) (or (memq ... global-mode-string) (setq global-mode-string ...)))) (if (or (eq org-clock-clocked-in-display (quote frame-title)) (eq org-clock-clocked-in-display (quote both))) (progn (setq frame-title-format org-clock-frame-title-format))) (org-clock-update-mode-line) (if org-clock-mode-line-timer (progn (cancel-
 timer org-clock-mode-line-timer) (setq org-clock-mode-line-timer nil))) (if org-clock-clocked-in-display (progn (setq org-clock-mode-line-timer (run-with-timer org-clock-update-period org-clock-update-period ...)))) (if org-clock-idle-timer (progn (cancel-timer org-clock-idle-timer) (setq org-clock-idle-timer nil))) (setq org-clock-idle-timer (run-with-timer 60 60 (quote org-resolve-clocks-if-idle))) (message "Clock starts at %s - %s" ts org--msg-extra) (run-hooks (quote org-clock-in-hook))))))
  (catch (quote abort) (let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness) (org-clocking-p))) ts selected-task target-pos (org--msg-extra "") (leftover (and (not org-clock-resolving-clocks) org-clock-leftover-time))) (if (and org-clock-auto-clock-resolution (or (not interrupting) (eq t org-clock-auto-clock-resolution)) (not org-clock-clocking-in) (not org-clock-resolving-clocks)) (progn (setq org-clock-leftover-time nil) (let ((org-clock-clocking-in t)) (org-resolve-clocks)))) (if (equal select (quote (64))) (progn (let ((org-clock-continuously t)) (org-clock-in nil org-clock-out-time)))) (if (equal select (quote (4))) (progn (setq selected-task (org-clock-select-task "Clock-in on task: ")) (if selected-task (setq selected-task (copy-marker selected-task)) (error "Abo
 rt")))) (if (equal select (quote (16))) (progn (org-clock-mark-default-task))) (if interrupting (progn (if (save-excursion (if selected-task nil (org-back-to-heading t)) (and (equal ... ...) (= ... ...) (equal org-clock-current-task ...))) (progn (message "Clock continues in \"%s\"" org-clock-heading) (throw (quote abort) nil))) (move-marker org-clock-interrupted-task (marker-position org-clock-marker) (marker-buffer org-clock-marker)) (let ((org-clock-clocking-in t)) (org-clock-out nil t)))) (setq target-pos (if (and (eobp) (not (org-at-heading-p))) (point-at-bol 0) (point))) (save-excursion (if (and selected-task (marker-buffer selected-task)) (progn (set-buffer (org-base-buffer (marker-buffer selected-task))) (setq target-pos (marker-position selected-task)) (move-marker selected-task
  nil))) (save-excursion (save-restriction (widen) (goto-char target-pos) (org-back-to-heading t) (or interrupting (move-marker org-clock-interrupted-task nil)) (run-hooks (quote org-clock-in-prepare-hook)) (org-clock-history-push) (setq org-clock-current-task (nth 4 (org-heading-components))) (cond ((functionp org-clock-in-switch-to-state) (looking-at org-complex-heading-regexp) (let ... ...)) ((and org-clock-in-switch-to-state ...) (org-todo org-clock-in-switch-to-state))) (setq org-clock-heading (cond (... ...) (... ...) (t "???"))) (org-clock-find-position org-clock-in-resume) (cond ((and org-clock-in-resume ...) (message "Matched %s" ...) (setq ts ...) (goto-char ...) (setq org-clock-start-time ...) (setq org-clock-effort ...) (setq org-clock-total-time ...)) ((eq org-clock-in-resume
  ...) (message "Cannot restart clock because task does not contain unfinished clock") (ding) (sit-for 2) (throw ... nil)) (t (insert-before-markers "\n") (backward-char 1) (org-indent-line) (if ... ...) (insert org-clock-string " ") (setq org-clock-effort ...) (setq org-clock-total-time ...) (setq org-clock-start-time ...) (setq ts ...))) (move-marker org-clock-marker (point) (buffer-base-buffer)) (move-marker org-clock-hd-marker (save-excursion (org-back-to-heading t) (point)) (buffer-base-buffer)) (setq org-clock-has-been-used t) (if (or (eq org-clock-clocked-in-display ...) (eq org-clock-clocked-in-display ...)) (progn (or global-mode-string ...) (or ... ...))) (if (or (eq org-clock-clocked-in-display ...) (eq org-clock-clocked-in-display ...)) (progn (setq frame-title-format org-cloc
 k-frame-title-format))) (org-clock-update-mode-line) (if org-clock-mode-line-timer (progn (cancel-timer org-clock-mode-line-timer) (setq org-clock-mode-line-timer nil))) (if org-clock-clocked-in-display (progn (setq org-clock-mode-line-timer ...))) (if org-clock-idle-timer (progn (cancel-timer org-clock-idle-timer) (setq org-clock-idle-timer nil))) (setq org-clock-idle-timer (run-with-timer 60 60 (quote org-resolve-clocks-if-idle))) (message "Clock starts at %s - %s" ts org--msg-extra) (run-hooks (quote org-clock-in-hook)))))))
  org-clock-in()
  (let ((org-clock-auto-clock-resolution nil)) (org-clock-in) (if (outline-invisible-p) (org-show-context)))
  (save-current-buffer (set-buffer (find-file (car resume-clock))) (goto-char (cdr resume-clock)) (let ((org-clock-auto-clock-resolution nil)) (org-clock-in) (if (outline-invisible-p) (org-show-context))))
  (progn (save-current-buffer (set-buffer (find-file (car resume-clock))) (goto-char (cdr resume-clock)) (let ((org-clock-auto-clock-resolution nil)) (org-clock-in) (if (outline-invisible-p) (org-show-context)))))
  (if (file-exists-p (car resume-clock)) (progn (save-current-buffer (set-buffer (find-file (car resume-clock))) (goto-char (cdr resume-clock)) (let ((org-clock-auto-clock-resolution nil)) (org-clock-in) (if (outline-invisible-p) (org-show-context))))))
  (progn (if (file-exists-p (car resume-clock)) (progn (save-current-buffer (set-buffer (find-file (car resume-clock))) (goto-char (cdr resume-clock)) (let ((org-clock-auto-clock-resolution nil)) (org-clock-in) (if (outline-invisible-p) (org-show-context)))))))
  (if (and resume-clock org-clock-persist (file-exists-p (car resume-clock)) (or (not org-clock-persist-query-resume) (y-or-n-p (concat "Resume clock (" (save-current-buffer (set-buffer (find-file ...)) (save-excursion (goto-char ...) (org-back-to-heading t) (and ... ...))) ") ")))) (progn (if (file-exists-p (car resume-clock)) (progn (save-current-buffer (set-buffer (find-file (car resume-clock))) (goto-char (cdr resume-clock)) (let ((org-clock-auto-clock-resolution nil)) (org-clock-in) (if (outline-invisible-p) (org-show-context))))))))
  (if (not (file-readable-p filename)) (message "Not restoring clock data; %s not found" org-clock-persist-file) (message "%s" "Restoring clock data") (setq org-clock-loaded t) (load-file filename) (if stored-clock-history (progn (let ((wconfig (current-window-configuration))) (unwind-protect (progn (mapc (function ...) stored-clock-history)) (set-window-configuration wconfig))))) (if (and resume-clock org-clock-persist (file-exists-p (car resume-clock)) (or (not org-clock-persist-query-resume) (y-or-n-p (concat "Resume clock (" (save-current-buffer (set-buffer ...) (save-excursion ... ... ...)) ") ")))) (progn (if (file-exists-p (car resume-clock)) (progn (save-current-buffer (set-buffer (find-file ...)) (goto-char (cdr resume-clock)) (let (...) (org-clock-in) (if ... ...))))))))
  (let ((filename (expand-file-name org-clock-persist-file)) (org-clock-in-resume (quote auto-restart)) resume-clock stored-clock-history) (if (not (file-readable-p filename)) (message "Not restoring clock data; %s not found" org-clock-persist-file) (message "%s" "Restoring clock data") (setq org-clock-loaded t) (load-file filename) (if stored-clock-history (progn (let ((wconfig (current-window-configuration))) (unwind-protect (progn (mapc ... stored-clock-history)) (set-window-configuration wconfig))))) (if (and resume-clock org-clock-persist (file-exists-p (car resume-clock)) (or (not org-clock-persist-query-resume) (y-or-n-p (concat "Resume clock (" (save-current-buffer ... ...) ") ")))) (progn (if (file-exists-p (car resume-clock)) (progn (save-current-buffer (set-buffer ...) (goto-cha
 r ...) (let ... ... ...))))))))
  (progn (let ((filename (expand-file-name org-clock-persist-file)) (org-clock-in-resume (quote auto-restart)) resume-clock stored-clock-history) (if (not (file-readable-p filename)) (message "Not restoring clock data; %s not found" org-clock-persist-file) (message "%s" "Restoring clock data") (setq org-clock-loaded t) (load-file filename) (if stored-clock-history (progn (let ((wconfig ...)) (unwind-protect (progn ...) (set-window-configuration wconfig))))) (if (and resume-clock org-clock-persist (file-exists-p (car resume-clock)) (or (not org-clock-persist-query-resume) (y-or-n-p (concat "Resume clock (" ... ") ")))) (progn (if (file-exists-p (car resume-clock)) (progn (save-current-buffer ... ... ...))))))))
  (if (and org-clock-persist (not org-clock-loaded)) (progn (let ((filename (expand-file-name org-clock-persist-file)) (org-clock-in-resume (quote auto-restart)) resume-clock stored-clock-history) (if (not (file-readable-p filename)) (message "Not restoring clock data; %s not found" org-clock-persist-file) (message "%s" "Restoring clock data") (setq org-clock-loaded t) (load-file filename) (if stored-clock-history (progn (let (...) (unwind-protect ... ...)))) (if (and resume-clock org-clock-persist (file-exists-p (car resume-clock)) (or (not org-clock-persist-query-resume) (y-or-n-p ...))) (progn (if (file-exists-p ...) (progn ...))))))))
  org-clock-load()
  run-hooks(change-major-mode-after-body-hook text-mode-hook outline-mode-hook org-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook text-mode-hook outline-mode-hook org-mode-hook))
  run-mode-hooks(org-mode-hook)
  org-mode()
  set-auto-mode-0(org-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer zz.org> "~/org/zz.org" nil nil "~/org/zz.org" (2131490 2056))
  find-file-noselect("/home/hymie/org/zz.org" nil nil nil)
  find-file("/home/hymie/org/zz.org")
  command-line-1(("zz.org"))
  command-line()
  normal-top-level()


>If that's the case, and assuming I'm in the right place in the source
>code, *Messages* shows the correct value for the matched string but the
>backtrace shows that match-end returned nil which means that the regexp
>*did not match*.  Both of these two cannot be right (unless there is a bug
>in the emacs regexp matching code, which for now at least, I'm
>discounting).

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-18 20:10     ` Nick Dokos
  2014-08-18 20:18       ` Nick Dokos
  2014-08-18 20:55       ` hymie!
@ 2014-08-19  7:55       ` Sebastien Vauban
  2014-08-19 12:32         ` Nick Dokos
  2 siblings, 1 reply; 16+ messages in thread
From: Sebastien Vauban @ 2014-08-19  7:55 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Nick Dokos wrote:
> I added the following to my .emacs
>
> (require 'org-clock)
> (setq org-clock-persist t)
> (org-clock-persistence-insinuate)
>
> I then start a clock, exit, restart emacs, get asked the "Resume
> clock" question, say "y", work for a while, stop the clock and
> everything seems OK.

FWIW, what I don't like with this approach is that requiring org-clock
requires the full Org, and that can take a (little) while, depending on
the number of files we do have in `org-agenda-files', a.o.

Remember that Carsten was advocating me to remove the call
`(org-agenda-list)' from my .emacs file, mainly for making Emacs more
usable for command-line usage, etc.

The approach I'd rather like to follow is to call the persistence
functions as soon as the first Org buffer gets opened (in a new Emacs
session).

Maybe the following is enough -- I didn't test it yet:

--8<---------------cut here---------------start------------->8---
(add-hook 'org-mode-hook
          (lambda ()
            (require 'org-clock)
            (setq org-clock-persist t)
            (org-clock-persistence-insinuate)))
--8<---------------cut here---------------end--------------->8---

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-19  7:55       ` Sebastien Vauban
@ 2014-08-19 12:32         ` Nick Dokos
  0 siblings, 0 replies; 16+ messages in thread
From: Nick Dokos @ 2014-08-19 12:32 UTC (permalink / raw)
  To: emacs-orgmode

Sebastien Vauban <sva-news@mygooglest.com>
writes:

> Nick Dokos wrote:
>> I added the following to my .emacs
>>
>> (require 'org-clock)
>> (setq org-clock-persist t)
>> (org-clock-persistence-insinuate)
>>
>> I then start a clock, exit, restart emacs, get asked the "Resume
>> clock" question, say "y", work for a while, stop the clock and
>> everything seems OK.
>
> FWIW, what I don't like with this approach is that requiring org-clock
> requires the full Org, and that can take a (little) while, depending on
> the number of files we do have in `org-agenda-files', a.o.
>
> Remember that Carsten was advocating me to remove the call
> `(org-agenda-list)' from my .emacs file, mainly for making Emacs more
> usable for command-line usage, etc.
>
> The approach I'd rather like to follow is to call the persistence
> functions as soon as the first Org buffer gets opened (in a new Emacs
> session).
>
> Maybe the following is enough -- I didn't test it yet:
>
> (add-hook 'org-mode-hook
>           (lambda ()
>             (require 'org-clock)
>             (setq org-clock-persist t)
>             (org-clock-persistence-insinuate)))
>

There may indeed be cleverer ways of loading it: I didn't worry about that.
I was more interested in seeing whether I could reproduce the OP's
problem (FWIW, I'm not using clocking).

-- 
Nick

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-19  3:23           ` hymie!
@ 2014-08-19 15:01             ` hymie!
  2014-08-19 15:51               ` Nick Dokos
  0 siblings, 1 reply; 16+ messages in thread
From: hymie! @ 2014-08-19 15:01 UTC (permalink / raw)
  To: emacs-orgmode

IMPORTANT NEW DISCOVERY

By default, I use emacs in a terminal window (emacs -nw)

When I use emacs as an X program, the clock persistence works successfully
and I do not get any errors.

Only when I use emacs with the -nw flag do I get the clock persistence
error below.

--hymie!    http://lactose.homelinux.net/~hymie    hymie@lactose.homelinux.net

In our last episode, the evil Dr. Lacto had captured our hero,
  hymie@lactose.homelinux.net (hymie!), who said:

>Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
>  goto-char(nil)
>  (cond ((and org-clock-in-resume (looking-at (concat "^[ 	]*"
>org-clock-string " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}" "
>*\\sw+.? +[012][0-9]:[0-5][0-9]\\)\\][ 	]*$"))) (message "Matched %s"
>(match-string 1)) (setq ts (concat "[" (match-string 1) "]")) (goto-char
>(match-end 1)) (setq org-clock-start-time (apply (quote encode-time)
>(org-parse-time-string (match-string 1)))) (setq org-clock-effort
>(org-entry-get (point) org-effort-property)) (setq org-clock-total-time
>(org-clock-sum-current-item (org-clock-get-sum-start)))) ((eq
>org-clock-in-resume (quote auto-restart)) (message "Cannot restart clock
>because task does not contain unfinished clock") (ding) (sit-for 2)
>(throw (quote abort) nil)) (t (insert-before-markers "\n")
>(backward-char 1) (org-indent-line) (if (and (save-excursi
> on (end-of-line 0) (org-in-item-p))) (progn (beginning-of-line 1)
>(org-indent-line-to (- (org-get-indentation) 2)))) (insert
>org-clock-string " ") (setq org-clock-effort (org-entry-get (point)
>org-effort-property)) (setq org-clock-total-time
>(org-clock-sum-current-item (org-clock-get-sum-start))) (setq
>org-clock-start-time (or (and org-clock-continuously org-clock-out-time)
>(and leftover (y-or-n-p (format "You stopped another clock %d mins ago;
>start this one from then? " (/ ... 60))) leftover) start-time
>(org-current-time org-clock-rounding-minutes t))) (setq ts
>(org-insert-time-stamp org-clock-start-time (quote with-hm) (quote
>inactive)))))

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-19 15:01             ` hymie!
@ 2014-08-19 15:51               ` Nick Dokos
  2014-08-19 18:21                 ` hymie!
  0 siblings, 1 reply; 16+ messages in thread
From: Nick Dokos @ 2014-08-19 15:51 UTC (permalink / raw)
  To: emacs-orgmode

hymie@lactose.homelinux.net (hymie!) writes:

> IMPORTANT NEW DISCOVERY
>
> By default, I use emacs in a terminal window (emacs -nw)
>
> When I use emacs as an X program, the clock persistence works successfully
> and I do not get any errors.
>
> Only when I use emacs with the -nw flag do I get the clock persistence
> error below.
>

Are you sure the two instances run the same version of emacs? And what
version is that?

FWIW, I cannot reproduce the problem either with -nw or without. In
fact, I'm baffled as to what could explain this: as a I pointed out
before, (match-string 1) says one thing and (match-end 1) says another
and AFAICT that's impossible. The only explanation I can come up with
is a bug in emacs's regexp matching code - a very unlikely scenario IMO.

Can anybody else reproduce the problem?

My version info:
GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.9) of
2014-08-18
Org-mode version 8.2.7c (release_8.2.7c @
/home/nick/elisp/org-mode/lisp/)
(the latter only in order to work on this problem - I usually run
the latest).

--
Nick

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-19 15:51               ` Nick Dokos
@ 2014-08-19 18:21                 ` hymie!
  2014-08-19 20:46                   ` hymie!
  0 siblings, 1 reply; 16+ messages in thread
From: hymie! @ 2014-08-19 18:21 UTC (permalink / raw)
  To: emacs-orgmode

In our last episode, the evil Dr. Lacto had captured our hero,
  Nick Dokos <ndokos@gmail.com>, who said:
>hymie@lactose.homelinux.net (hymie!) writes:
>
>> IMPORTANT NEW DISCOVERY
>>
>> When I use emacs as an X program, the clock persistence works successfully
>> and I do not get any errors.
>>
>> Only when I use emacs with the -nw flag do I get the clock persistence
>> error below.
>>
>
>Are you sure the two instances run the same version of emacs? And what
>version is that?

Emacs  : GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.13)
 of 2014-06-17 on herman
Package: Org-mode version 8.2.7c (8.2.7c-dist @ /home/hymie/org-mode/lisp/)

Same version with and without -nw.

I can't run the newer version of GTK at this time.

>FWIW, I cannot reproduce the problem either with -nw or without. In
>fact, I'm baffled as to what could explain this: as a I pointed out
>before, (match-string 1) says one thing and (match-end 1) says another
>and AFAICT that's impossible. The only explanation I can come up with
>is a bug in emacs's regexp matching code - a very unlikely scenario IMO.

Bummer.

>My version info:
>GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.9) of
>2014-08-18

I'm not a developer by trade, so I'm not sure if I can git the dev
versions of emacs.  But maybe that will help.

--hymie!    http://lactose.homelinux.net/~hymie    hymie@lactose.homelinux.net

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-19 18:21                 ` hymie!
@ 2014-08-19 20:46                   ` hymie!
  2014-08-19 22:42                     ` Nick Dokos
  0 siblings, 1 reply; 16+ messages in thread
From: hymie! @ 2014-08-19 20:46 UTC (permalink / raw)
  To: emacs-orgmode

OK.

I downloaded emacs v 24.4.50.1 .

I think I still had the problem the first time I ran it, but now I'm not
sure if maybe I ran the old version by mistake.

Anyway, I commented out my entire .emacs file, run 24.4.50.1, and
the clock persistence worked.  I restored my .emacs a few lines at a
time, and it continued working the entire time.

I restored my .emacs file, 24.4.50.1 was still working correctly.
Then for giggles I tried 24.3, got the error, returned to 24.4.50.1, and
no error.  Then I removed 24.3 completely and installed 24.4.50.1  , and I
haven't had the error since then.

In our last episode, the evil Dr. Lacto had captured our hero,
  hymie@lactose.homelinux.net (hymie!), who said:
>In our last episode, the evil Dr. Lacto had captured our hero,
>  Nick Dokos <ndokos@gmail.com>, who said:
>>hymie@lactose.homelinux.net (hymie!) writes:
>>
>>Are you sure the two instances run the same version of emacs? And what
>>version is that?
>
>Emacs  : GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.13)
> of 2014-06-17 on herman
>Package: Org-mode version 8.2.7c (8.2.7c-dist @ /home/hymie/org-mode/lisp/)
>
>>FWIW, I cannot reproduce the problem either with -nw or without. In
>>fact, I'm baffled as to what could explain this: as a I pointed out
>>before, (match-string 1) says one thing and (match-end 1) says another
>>and AFAICT that's impossible. The only explanation I can come up with
>>is a bug in emacs's regexp matching code - a very unlikely scenario IMO.

Solar flares.

Anyway, thanks very much for all of the help.

--hymie!    http://lactose.homelinux.net/~hymie    hymie@lactose.homelinux.net

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-19 20:46                   ` hymie!
@ 2014-08-19 22:42                     ` Nick Dokos
  2014-08-22 13:55                       ` Bastien
  0 siblings, 1 reply; 16+ messages in thread
From: Nick Dokos @ 2014-08-19 22:42 UTC (permalink / raw)
  To: emacs-orgmode

hymie@lactose.homelinux.net (hymie!) writes:

> OK.
>
> I downloaded emacs v 24.4.50.1 .
>
> I think I still had the problem the first time I ran it, but now I'm not
> sure if maybe I ran the old version by mistake.
>
> Anyway, I commented out my entire .emacs file, run 24.4.50.1, and
> the clock persistence worked.  I restored my .emacs a few lines at a
> time, and it continued working the entire time.
>
> I restored my .emacs file, 24.4.50.1 was still working correctly.
> Then for giggles I tried 24.3, got the error, returned to 24.4.50.1, and
> no error.  Then I removed 24.3 completely and installed 24.4.50.1  , and I
> haven't had the error since then.
>

OK - glad it's working. It was a pretty weird bug.

-- 
Nick

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: clock-in clock-out problems
  2014-08-19 22:42                     ` Nick Dokos
@ 2014-08-22 13:55                       ` Bastien
  0 siblings, 0 replies; 16+ messages in thread
From: Bastien @ 2014-08-22 13:55 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:

> OK - glad it's working. It was a pretty weird bug.

Thanks for taking care of this!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-08-22 13:56 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-18 15:40 clock-in clock-out problems hymie!
2014-08-18 18:26 ` Joost Helberg
2014-08-18 19:02   ` hymie!
2014-08-18 20:10     ` Nick Dokos
2014-08-18 20:18       ` Nick Dokos
2014-08-18 20:55       ` hymie!
2014-08-18 21:39         ` Nick Dokos
2014-08-19  3:23           ` hymie!
2014-08-19 15:01             ` hymie!
2014-08-19 15:51               ` Nick Dokos
2014-08-19 18:21                 ` hymie!
2014-08-19 20:46                   ` hymie!
2014-08-19 22:42                     ` Nick Dokos
2014-08-22 13:55                       ` Bastien
2014-08-19  7:55       ` Sebastien Vauban
2014-08-19 12:32         ` Nick Dokos

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).