emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: pmlists@free.fr (Peter Münster)
To: emacs-orgmode@gnu.org
Subject: Re: How to say "I did that yesterday?"
Date: Tue, 22 Nov 2011 21:03:53 +0100	[thread overview]
Message-ID: <87r50z7wly.fsf@micropit.couberia.bzh> (raw)
In-Reply-To: m2y5v8lzd8.fsf@pluto.luannocracy.com

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

  reply	other threads:[~2011-11-22 20:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-22 19:40 How to say "I did that yesterday?" Dave Abrahams
2011-11-22 20:03 ` Peter Münster [this message]
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

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=87r50z7wly.fsf@micropit.couberia.bzh \
    --to=pmlists@free.fr \
    --cc=emacs-orgmode@gnu.org \
    /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).