all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: feature request: agenda time stamp manipulation
@ 2014-03-10  2:46 Tory S. Anderson
  2014-03-13 14:52 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Tory S. Anderson @ 2014-03-10  2:46 UTC (permalink / raw
  To: emacs-orgmode

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)

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

end of thread, other threads:[~2014-03-13 14:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-10  2:46 feature request: agenda time stamp manipulation Tory S. Anderson
2014-03-13 14:52 ` Bastien

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.