emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Org-todo-yesterday broken?
Date: Sun, 07 Dec 2014 19:49:04 -0500	[thread overview]
Message-ID: <87h9x7c6f3.fsf@kmlap.domain.org> (raw)
In-Reply-To: <5484DF0D.6020209@gmail.com> (Nikolay Kudryavtsev's message of "Mon, 08 Dec 2014 02:13:17 +0300")

[-- Attachment #1: Type: text/plain, Size: 425 bytes --]

Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-todo-yesterday-Ignore-org-use-effective-time.patch --]
[-- Type: text/x-diff, Size: 1839 bytes --]

From 10e5dfb5854473fa97b8299a0f059c233c349ef1 Mon Sep 17 00:00:00 2001
From: Kyle Meyer <kyle@kyleam.com>
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 <nikolay.kudryavtsev@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/93224>
---
 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


[-- Attachment #3: Type: text/plain, Size: 86 bytes --]


[1] https://lists.gnu.org/archive/html/emacs-orgmode/2011-11/msg00320.html

-- 
Kyle

  reply	other threads:[~2014-12-08  0:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-18  0:52 Marking items done in the past Noah Slater
2014-08-21 22:40 ` Noah Slater
2014-09-02 20:42   ` Fletcher Charest
2014-09-02 23:11     ` Jorge A. Alfaro-Murillo
2014-09-13 15:24 ` Karl Voit
2014-12-07 23:13   ` Org-todo-yesterday broken? Nikolay Kudryavtsev
2014-12-08  0:49     ` Kyle Meyer [this message]
2014-12-09  9:27       ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h9x7c6f3.fsf@kmlap.domain.org \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=nikolay.kudryavtsev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).