Function: org-agenda-date-later

org-agenda-date-later is an interactive and byte-compiled function defined in org-agenda.el.gz.

Signature

(org-agenda-date-later ARG &optional WHAT)

Documentation

Change the date of this item to ARG day(s) later.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-agenda.el.gz
(defun org-agenda-date-later (arg &optional what)
  "Change the date of this item to ARG day(s) later."
  (interactive "p")
  (org-agenda-check-type t 'agenda)
  (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))
	 cdate today)
    (org-with-remote-undo buffer
      (with-current-buffer buffer
	(widen)
	(goto-char pos)
	(unless (org-at-timestamp-p 'lax) (error "Cannot find time stamp"))
	(when (and org-agenda-move-date-from-past-immediately-to-today
		   (equal arg 1)
		   (or (not what) (eq what 'day))
		   (not (save-match-data (org-at-date-range-p))))
	  (setq cdate (org-parse-time-string (match-string 0) 'nodefault)
		cdate (calendar-absolute-from-gregorian
		       (list (nth 4 cdate) (nth 3 cdate) (nth 5 cdate)))
		today (org-today))
	  (when (> today cdate)
	    ;; immediately shift to today
	    (setq arg (- today cdate))))
	(org-timestamp-change arg (or what 'day))
	(when (and (org-at-date-range-p)
                   (re-search-backward org-tr-regexp-both
                                       (line-beginning-position)))
	  (let ((end org-last-changed-timestamp))
	    (org-timestamp-change arg (or what 'day))
	    (setq org-last-changed-timestamp
		  (concat org-last-changed-timestamp "--" end)))))
      (org-agenda-show-new-time marker org-last-changed-timestamp))
    (message "Time stamp changed to %s" org-last-changed-timestamp)))