Function: org-eval-in-calendar
org-eval-in-calendar is a byte-compiled function defined in org.el.gz.
Signature
(org-eval-in-calendar FORM &optional KEEPDATE)
Documentation
Eval FORM in the calendar window and return to current window.
Unless KEEPDATE is non-nil, update org-ans2 to the cursor date.
Source Code
;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-eval-in-calendar (form &optional keepdate)
"Eval FORM in the calendar window and return to current window.
Unless KEEPDATE is non-nil, update `org-ans2' to the cursor date."
(let ((sf (selected-frame))
(sw (selected-window)))
(select-window (get-buffer-window calendar-buffer t))
(eval form t)
(when (and (not keepdate) (calendar-cursor-to-date))
(let* ((date (calendar-cursor-to-date))
(time (org-encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
(setq org-ans2 (format-time-string "%Y-%m-%d" time))))
(move-overlay org-date-ovl (1- (point)) (1+ (point)) (current-buffer))
(select-window sw)
(select-frame-set-input-focus sf)))