emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to say "I did that yesterday?"
@ 2011-11-22 19:40 Dave Abrahams
  2011-11-22 20:03 ` Peter Münster
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Dave Abrahams @ 2011-11-22 19:40 UTC (permalink / raw)
  To: emacs-orgmode


I often discover that I completed something a few days ago and I would
like to mark it done with the appropriate date as though I had marked it
done in the past.  That means, e.g., for a repeating event it might
repeat sooner than if it had been done today.  Is there a way?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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

* Re: How to say "I did that yesterday?"
  2011-11-22 19:40 How to say "I did that yesterday?" Dave Abrahams
@ 2011-11-22 20:03 ` Peter Münster
  2011-11-22 20:16 ` Greg Troxel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Peter Münster @ 2011-11-22 20:03 UTC (permalink / raw)
  To: emacs-orgmode

On Tue, Nov 22 2011, Dave Abrahams wrote:

> I often discover that I completed something a few days ago and I would
> like to mark it done with the appropriate date as though I had marked it
> done in the past.  That means, e.g., for a repeating event it might
> repeat sooner than if it had been done today.  Is there a way?

Not exactly what you want, but it might help. Some code for easy
modifying time stamps with C-left, C-right, M-left and M-right:

--8<---------------cut here---------------start------------->8---
(defvar pm/org-ctrlleft-hook nil
  "Hook for functions attaching themselves to `C-left'.")

(defvar pm/org-ctrlright-hook nil
  "Hook for functions attaching themselves to `C-right'.")

(defun pm/org-meta-left ()
  "Decrease the date in the time stamp by one hour."
  (when (org-at-timestamp-p) (org-timestamp-change -60 'minute) t))

(defun pm/org-meta-right ()
  "Increase the date in the time stamp by one hour."
  (when (org-at-timestamp-p) (org-timestamp-change 60 'minute) t))

(defun pm/org-ctrl-left ()
  "Decrease the date in the time stamp by one day."
  (when (org-at-timestamp-p) (org-timestamp-down-day) t))

(defun pm/org-ctrl-right ()
  "Increase the date in the time stamp by one day."
  (when (org-at-timestamp-p) (org-timestamp-up-day) t))

(defun pm/org-ctrlleft ()
  "Run the functions in `pm/org-ctrlleft-hook'."
  (interactive)
  (run-hook-with-args-until-success 'pm/org-ctrlleft-hook))

(defun pm/org-ctrlright ()
  "Run the functions in `pm/org-ctrlright-hook'."
  (interactive)
  (run-hook-with-args-until-success 'pm/org-ctrlright-hook))

(add-hook 'org-metaleft-hook     'pm/org-meta-left)
(add-hook 'org-metaright-hook    'pm/org-meta-right)
(add-hook 'pm/org-ctrlleft-hook  'pm/org-ctrl-left)
(add-hook 'pm/org-ctrlright-hook 'pm/org-ctrl-right)

(org-defkey org-mode-map [(control left)]  'pm/org-ctrlleft)
(org-defkey org-mode-map [(control right)] 'pm/org-ctrlright)
--8<---------------cut here---------------end--------------->8---

-- 
           Peter

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

* Re: How to say "I did that yesterday?"
  2011-11-22 19:40 How to say "I did that yesterday?" Dave Abrahams
  2011-11-22 20:03 ` Peter Münster
@ 2011-11-22 20:16 ` Greg Troxel
  2011-11-22 20:27 ` Michael Brand
  2011-11-22 22:13 ` Erik Hetzner
  3 siblings, 0 replies; 9+ messages in thread
From: Greg Troxel @ 2011-11-22 20:16 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: emacs-orgmode

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


  I often discover that I completed something a few days ago and I would
  like to mark it done with the appropriate date as though I had marked it
  done in the past.  That means, e.g., for a repeating event it might
  repeat sooner than if it had been done today.  Is there a way?

I also want to to that, basically binding 'now' to a particular time in
the past and then executing a todo state change (to effect the log, and
also the next scheduled time).
I wonder if replacing the calls to get now with a function that looks at
a variable and doing

  (setq now-var (now))
  (do-whatever)

would be enough to get it to do what I want.


[-- Attachment #2: Type: application/pgp-signature, Size: 194 bytes --]

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

* Re: How to say "I did that yesterday?"
  2011-11-22 19:40 How to say "I did that yesterday?" Dave Abrahams
  2011-11-22 20:03 ` Peter Münster
  2011-11-22 20:16 ` Greg Troxel
@ 2011-11-22 20:27 ` Michael Brand
  2011-11-22 22:48   ` Dave Abrahams
  2011-11-22 22:13 ` Erik Hetzner
  3 siblings, 1 reply; 9+ messages in thread
From: Michael Brand @ 2011-11-22 20:27 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: emacs-orgmode

Hi Dave

On Tue, Nov 22, 2011 at 20:40, Dave Abrahams <dave@boostpro.com> wrote:
> [...] for a repeating event it might
> repeat sooner than if it had been done today. [...]

Are you looking for habits?
http://orgmode.org/manual/Tracking-your-habits.html#Tracking-your-habits

Michael

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

* Re: How to say "I did that yesterday?"
  2011-11-22 19:40 How to say "I did that yesterday?" Dave Abrahams
                   ` (2 preceding siblings ...)
  2011-11-22 20:27 ` Michael Brand
@ 2011-11-22 22:13 ` Erik Hetzner
  2011-11-23  0:01   ` Dave Abrahams
  2011-11-23  5:02   ` Dave Abrahams
  3 siblings, 2 replies; 9+ messages in thread
From: Erik Hetzner @ 2011-11-22 22:13 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: emacs-orgmode

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

At Tue, 22 Nov 2011 11:40:35 -0800,
Dave Abrahams wrote:
> 
> 
> I often discover that I completed something a few days ago and I would
> like to mark it done with the appropriate date as though I had marked it
> done in the past.  That means, e.g., for a repeating event it might
> repeat sooner than if it had been done today.  Is there a way?

M-x org-todo-yesterday ?

If there is a way to do this for days further in the past, I would
welcome it! I also find myself wanting to do this often. Right now I
just mark it done, then manually adjust the log entries.

best, Erik

[-- Attachment #2: Type: text/plain, Size: 53 bytes --]

Sent from my free software system <http://fsf.org/>.

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

* Re: How to say "I did that yesterday?"
  2011-11-22 20:27 ` Michael Brand
@ 2011-11-22 22:48   ` Dave Abrahams
  0 siblings, 0 replies; 9+ messages in thread
From: Dave Abrahams @ 2011-11-22 22:48 UTC (permalink / raw)
  To: Michael Brand; +Cc: emacs-orgmode


on Tue Nov 22 2011, Michael Brand <michael.ch.brand-AT-gmail.com> wrote:

> Hi Dave
>
> On Tue, Nov 22, 2011 at 20:40, Dave Abrahams <dave@boostpro.com> wrote:
>> [...] for a repeating event it might
>> repeat sooner than if it had been done today. [...]
>
> Are you looking for habits?
> http://orgmode.org/manual/Tracking-your-habits.html#Tracking-your-habits

No, I'm alreay using habits!  But if I have a habit to shave every three
days and sometime in the past two days I forgot to mark that I shaved, I
need a way to record that fact without habits letting me slide for a day
and a half past the time I should shave next.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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

* Re: How to say "I did that yesterday?"
  2011-11-22 22:13 ` Erik Hetzner
@ 2011-11-23  0:01   ` Dave Abrahams
  2011-11-23  5:02   ` Dave Abrahams
  1 sibling, 0 replies; 9+ messages in thread
From: Dave Abrahams @ 2011-11-23  0:01 UTC (permalink / raw)
  To: Erik Hetzner; +Cc: emacs-orgmode


on Tue Nov 22 2011, Erik Hetzner <egh-AT-e6h.org> wrote:

> At Tue, 22 Nov 2011 11:40:35 -0800,
> Dave Abrahams wrote:
>> 
>
>> 
>> I often discover that I completed something a few days ago and I would
>> like to mark it done with the appropriate date as though I had marked it
>> done in the past.  That means, e.g., for a repeating event it might
>> repeat sooner than if it had been done today.  Is there a way?
>
> M-x org-todo-yesterday ?
>
> If there is a way to do this for days further in the past, I would
> welcome it! I also find myself wanting to do this often. Right now I
> just mark it done, then manually adjust the log entries.
>
> best, Erik
> Sent from my free software system <http://fsf.org/>.


org-todo-yesterday clearly shows how it could be done.  Heh, we could
have org-todo respond to negative prefix args by shifting the date back
that many days and then prompting for state as though `C-u' had been
pressed.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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

* Re: How to say "I did that yesterday?"
  2011-11-22 22:13 ` Erik Hetzner
  2011-11-23  0:01   ` Dave Abrahams
@ 2011-11-23  5:02   ` Dave Abrahams
  2011-11-23  7:28     ` Tom Prince
  1 sibling, 1 reply; 9+ messages in thread
From: Dave Abrahams @ 2011-11-23  5:02 UTC (permalink / raw)
  To: emacs-orgmode


on Tue Nov 22 2011, Erik Hetzner <egh-AT-e6h.org> wrote:

> At Tue, 22 Nov 2011 11:40:35 -0800,
> Dave Abrahams wrote:
>> 
>
>> 
>> I often discover that I completed something a few days ago and I would
>> like to mark it done with the appropriate date as though I had marked it
>> done in the past.  That means, e.g., for a repeating event it might
>> repeat sooner than if it had been done today.  Is there a way?
>
> M-x org-todo-yesterday ?

Heh, that doesn't seem to work from the agenda, though :(

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (error "Before first headline at position 1142 in buffer *Org Agenda*")
  signal(error ("Before first headline at position 1142 in buffer *Org Agenda*"))
  error("Before first headline at position %d in buffer %s" 1142 #<buffer *Org Agenda*>)
  (condition-case nil (outline-back-to-heading invisible-ok) (error (error "Before first headline at position %d in buffer %s" ... ...)))
  org-back-to-heading(t)
  (catch (quote exit) (org-back-to-heading t) (if (looking-at org-outline-regexp) (goto-char ...)) (or (looking-at ...) (looking-at "\\(?: *\\|[ 	]*$\\)")) (let* (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... dolog now-done-p) (when org-blocker-hook ... ...) (store-match-data match-data) (replace-match next t t) (unless ... ...) (unless head ...) (when ... ...) (setq org-last-todo-state-is-todo ...) (setq now-done-p ...) (and logging ...) (when ... ... ... ... ... ...) (org-todo-trigger-tag-changes state) (and org-auto-align-tags ... ...) (when org-provide-todo-statistics ...) (run-hooks ...) (if ... ...) (put-text-property ... ... ... head) (when now-done-p ... ...) (if ... ...) (when org-trigger-hook ...)))
  (save-excursion (catch (quote exit) (org-back-to-heading t) (if ... ...) (or ... ...) (let* ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...)))
  (let ((org-blocker-hook org-blocker-hook) (case-fold-search nil)) (when (equal arg ...) (setq arg nil org-blocker-hook nil)) (when (and org-blocker-hook ...) (setq org-blocker-hook nil)) (save-excursion (catch ... ... ... ... ...)))
  org-todo((4))
  (let* ((hour ...) (org-extend-today-until ...)) (org-todo arg))
  org-todo-yesterday((4))
  call-interactively(org-todo-yesterday t nil)
  execute-extended-command((4))
  call-interactively(execute-extended-command nil nil)
--8<---------------cut here---------------end--------------->8---

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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

* Re: How to say "I did that yesterday?"
  2011-11-23  5:02   ` Dave Abrahams
@ 2011-11-23  7:28     ` Tom Prince
  0 siblings, 0 replies; 9+ messages in thread
From: Tom Prince @ 2011-11-23  7:28 UTC (permalink / raw)
  To: Dave Abrahams, emacs-orgmode

On Tue, 22 Nov 2011 21:02:48 -0800, Dave Abrahams <dave@boostpro.com> wrote:
> 
> on Tue Nov 22 2011, Erik Hetzner <egh-AT-e6h.org> wrote:
> 
> > At Tue, 22 Nov 2011 11:40:35 -0800,
> > Dave Abrahams wrote:
> >> 
> >
> >> 
> >> I often discover that I completed something a few days ago and I would
> >> like to mark it done with the appropriate date as though I had marked it
> >> done in the past.  That means, e.g., for a repeating event it might
> >> repeat sooner than if it had been done today.  Is there a way?
> >
> > M-x org-todo-yesterday ?
> 
> Heh, that doesn't seem to work from the agenda, though :(
> 

M-x org-agenda-todo-yesteday

:)

Although, it should in princple, be possible to detect running in tha
agenda, and handle that automatically. I guess there are probably issues
with that.

  Tom

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

end of thread, other threads:[~2011-11-23  7:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-22 19:40 How to say "I did that yesterday?" Dave Abrahams
2011-11-22 20:03 ` Peter Münster
2011-11-22 20:16 ` Greg Troxel
2011-11-22 20:27 ` Michael Brand
2011-11-22 22:48   ` Dave Abrahams
2011-11-22 22:13 ` Erik Hetzner
2011-11-23  0:01   ` Dave Abrahams
2011-11-23  5:02   ` Dave Abrahams
2011-11-23  7:28     ` Tom Prince

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