emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: torys.anderson@gmail.com (Tory S. Anderson)
To: emacs-orgmode@gnu.org
Subject: Re: feature request: agenda time stamp manipulation
Date: Sun, 09 Mar 2014 22:46:06 -0400	[thread overview]
Message-ID: <87y50ihitt.fsf@gmail.com> (raw)

I've written the following code/function which seems to fulfill my needs in the agenda to be able to manipulate plain time stamps in the same way we can manipulate deadlines and schedules, so that entries added with "i" can then be customized to a particular hour, or be otherwise altered. Hopefully it will be of use to others. 

(defun org-agenda-time-stamp (arg &optional time)
  "Schedule the item at point.
ARG is passed through to `org-time-stamp'."
  (interactive "P")
  (org-agenda-check-type t 'agenda 'timeline 'todo 'tags 'search)
  (org-agenda-check-no-diary)
  (let* ((marker (or (org-get-at-bol 'org-marker)
		     (org-agenda-error)))
	 (buffer (marker-buffer marker))
	 (pos (marker-position marker))
	 (org-insert-labeled-timestamps-at-point nil)
	 ts)
    (org-with-remote-undo buffer
      (with-current-buffer buffer
	(widen)
	(goto-char pos)
	(setq ts (org-time-stamp arg)))
      (org-agenda-show-new-time marker ts " Ts"))
    (message "%s" ts)))

(org-defkey org-agenda-mode-map "\C-c\." 'org-agenda-time-stamp)

             reply	other threads:[~2014-03-10  2:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-10  2:46 Tory S. Anderson [this message]
2014-03-13 14:52 ` feature request: agenda time stamp manipulation Bastien

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=87y50ihitt.fsf@gmail.com \
    --to=torys.anderson@gmail.com \
    --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).