From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: Org-todo-yesterday broken? Date: Sun, 07 Dec 2014 19:49:04 -0500 Message-ID: <87h9x7c6f3.fsf@kmlap.domain.org> References: <2014-09-13T17-23-40@devnull.Karl-Voit.at> <5484DF0D.6020209@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxmSz-0003b8-L2 for emacs-orgmode@gnu.org; Sun, 07 Dec 2014 19:46:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XxmSv-0000Bj-Bl for emacs-orgmode@gnu.org; Sun, 07 Dec 2014 19:46:21 -0500 Received: from mail-qc0-f177.google.com ([209.85.216.177]:58190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxmSv-0000BW-6b for emacs-orgmode@gnu.org; Sun, 07 Dec 2014 19:46:17 -0500 Received: by mail-qc0-f177.google.com with SMTP id x3so2812760qcv.8 for ; Sun, 07 Dec 2014 16:46:16 -0800 (PST) In-Reply-To: <5484DF0D.6020209@gmail.com> (Nikolay Kudryavtsev's message of "Mon, 08 Dec 2014 02:13:17 +0300") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nikolay Kudryavtsev Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Nikolay Kudryavtsev wrote: > org-todo-yesterday and org-agenda-todo-yesterday do not seem to work > in all recent versions of org that I've tried. I'd guess this is because org-use-effective-time is set to nil (based on this previous issue [1]). Setting it to non-nil should work, but I think org-todo-yesterday and org-agenda-todo-yesterday should override this, as in the attached patch. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org-todo-yesterday-Ignore-org-use-effective-time.patch >From 10e5dfb5854473fa97b8299a0f059c233c349ef1 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 7 Dec 2014 19:21:42 -0500 Subject: [PATCH 1/1] org-todo-yesterday: Ignore org-use-effective-time * lisp/org.el (org-todo-yesterday): Ignore global org-use-effective-time value. * lisp/org-agenda.el (org-agenda-todo-yesterday): Ignore global org-use-effective-time value. Otherwise, if org-use-effective-time being nil, org-extend-today-until will not be considered, resulting in the current time being used instead of 23:59 yesterday. Reported-by: Nikolay Kudryavtsev --- lisp/org-agenda.el | 3 ++- lisp/org.el | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index b2e54e6..5990bbb 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -10143,7 +10143,8 @@ (defun org-agenda-todayp (date) (defun org-agenda-todo-yesterday (&optional arg) "Like `org-agenda-todo' but the time of change will be 23:59 of yesterday." (interactive "P") - (let* ((hour (third (decode-time + (let* ((org-use-effective-time t) + (hour (third (decode-time (org-current-time)))) (org-extend-today-until (1+ hour))) (org-agenda-todo arg))) diff --git a/lisp/org.el b/lisp/org.el index 142407c..22a0c17 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -12469,7 +12469,8 @@ (defun org-todo-yesterday (&optional arg) (interactive "P") (if (eq major-mode 'org-agenda-mode) (apply 'org-agenda-todo-yesterday arg) - (let* ((hour (third (decode-time + (let* ((org-use-effective-time t) + (hour (third (decode-time (org-current-time)))) (org-extend-today-until (1+ hour))) (org-todo arg)))) -- 2.1.3 --=-=-= Content-Type: text/plain [1] https://lists.gnu.org/archive/html/emacs-orgmode/2011-11/msg00320.html -- Kyle --=-=-=--