emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] org clock history no longer loaded from org-clock-persist-file
@ 2016-01-04 15:32 Matt Lundin
  2016-01-06 14:10 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Lundin @ 2016-01-04 15:32 UTC (permalink / raw)
  To: Org Mode

With the shift to lexical-binding in org-clock.el (commit
35bc1c8853c5cfe37930e3540a944a328af5198b), the function org-load-clock
fails to load the stored data in org-clock-persist-file.

These are the relevant setting in my .emacs:

(setq org-clock-persist t)
(setq org-clock-persist-file "~/data/org-clock-save.el")
(org-clock-persistence-insinuate)

Expected result: After calling the agenda for the first time, the
variable org-clock-history is populated with data.

Actual result: org-clock-history remains nil.

As far as I can tell, the problem lies with the call to load-file (line
2986). Because of the lexical binding, the (setq stored-clock-history
....) statement stored in the org-clock-persist-file is evaluated but
because of the lexical scoping it has no effect on the
stored-clock-history in org-clock-load.

Ironically, this also means that stored-clock-history is defined as an
irrelevant global variable even while it remains undefined within
org-load-clock as a local variable. (Before lexical binding, the
opposite was the case: the call to load-file bound stored-clock-history
locally, but not globally).

Best,
Matt

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

* Re: [BUG] org clock history no longer loaded from org-clock-persist-file
  2016-01-04 15:32 [BUG] org clock history no longer loaded from org-clock-persist-file Matt Lundin
@ 2016-01-06 14:10 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2016-01-06 14:10 UTC (permalink / raw)
  To: Matt Lundin; +Cc: Org Mode

Hello,

Matt Lundin <mdl@imapmail.org> writes:

> With the shift to lexical-binding in org-clock.el (commit
> 35bc1c8853c5cfe37930e3540a944a328af5198b), the function org-load-clock
> fails to load the stored data in org-clock-persist-file.
>
> These are the relevant setting in my .emacs:
>
> (setq org-clock-persist t)
> (setq org-clock-persist-file "~/data/org-clock-save.el")
> (org-clock-persistence-insinuate)
>
> Expected result: After calling the agenda for the first time, the
> variable org-clock-history is populated with data.
>
> Actual result: org-clock-history remains nil.
>
> As far as I can tell, the problem lies with the call to load-file (line
> 2986). Because of the lexical binding, the (setq stored-clock-history
> ....) statement stored in the org-clock-persist-file is evaluated but
> because of the lexical scoping it has no effect on the
> stored-clock-history in org-clock-load.

Fixed. Thank you for the detailed report.

Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2016-01-06 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-04 15:32 [BUG] org clock history no longer loaded from org-clock-persist-file Matt Lundin
2016-01-06 14:10 ` Nicolas Goaziou

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