From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [PATCH] Fix org-clock-load Date: Mon, 19 Dec 2016 17:32:26 -0600 Message-ID: <8760mfcx6d.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJ7Q0-00080W-8o for emacs-orgmode@gnu.org; Mon, 19 Dec 2016 18:32:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJ7Px-0000Vk-2z for emacs-orgmode@gnu.org; Mon, 19 Dec 2016 18:32:32 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:59262) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cJ7Pw-0000V4-Uy for emacs-orgmode@gnu.org; Mon, 19 Dec 2016 18:32:29 -0500 Received: from archpad (c-24-14-63-242.hsd1.il.comcast.net [24.14.63.242]) by mail.messagingengine.com (Postfix) with ESMTPA id 1D0AD24428 for ; Mon, 19 Dec 2016 18:32:27 -0500 (EST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Org Mode --=-=-= Content-Type: text/plain Since commit fda64f1ae2110175662b52daa3a5ec0f967f0c0d on November 6, org-clock-load no longer restores clocks in org-clock-persist-file. The contents of the file look like this: --8<---------------cut here---------------start------------->8--- (setq org-clock-stored-history '(("/home/matt/org/inbox.org" . 39479) ("/home/matt/org/reading.org" . 63478))) --8<---------------cut here---------------end--------------->8--- The files both exist; the position information is correct; and org-clock-persist is t. And yet after calling org-clock-load, org-clock-history, org-clock-loaded, and org-clock-stored-history remain nil. The problem, it seems, is that the logic/order of the if statement was reversed in the commit above. The attached patch should fix the issue. Best, Matt --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org-clock-Fix-org-clock-load.patch >From 6d649016fbbfaa28c902ee1e71c20ecf332f8a14 Mon Sep 17 00:00:00 2001 From: Matt Lundin Date: Mon, 19 Dec 2016 17:24:10 -0600 Subject: [PATCH] org-clock: Fix org-clock-load * lisp/org-clock.el: (org-clock-load): Fix incorrect order in if statement that was preventing org-load from loading stored data and populating org-clock-history. --- lisp/org-clock.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 65c13fdf2..6e58ce91a 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -2962,9 +2962,9 @@ The details of what will be saved are regulated by the variable (defun org-clock-load () "Load clock-related data from disk, maybe resuming a stored clock." (when (and org-clock-persist (not org-clock-loaded)) - (if (file-readable-p org-clock-persist-file) - (message "Restoring clock data") - (message "Not restoring clock data; %S not found" org-clock-persist-file) + (if (not (file-readable-p org-clock-persist-file)) + (message "Not restoring clock data; %S not found" org-clock-persist-file) + (message "Restoring clock data") ;; Load history. (load-file org-clock-persist-file) (setq org-clock-loaded t) -- 2.11.0 --=-=-=--