diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 2fcb6cf75..bafd8b7f8 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -10571,7 +10571,7 @@ buffer, display it in another window." (defun org-agenda-diary-entry-in-org-file () "Make a diary entry in the file `org-agenda-diary-file'." (let (d1 d2 char (text "") dp1 dp2) - (if (equal (buffer-name) "*Calendar*") + (if (equal (buffer-name) calendar-buffer) (setq d1 (calendar-cursor-to-date t) d2 (car calendar-mark-ring)) (setq dp1 (get-text-property (line-beginning-position) 'day)) diff --git a/lisp/org.el b/lisp/org.el index f5cc51110..4fb2e94c8 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -13753,7 +13753,7 @@ user." (calendar) (when (eq calendar-setup 'calendar-only) (setq cal-frame - (window-frame (get-buffer-window "*Calendar*" 'visible))) + (window-frame (get-buffer-window calendar-buffer 'visible))) (select-frame cal-frame)) (org-eval-in-calendar '(setq cursor-type nil) t) (unwind-protect @@ -13789,7 +13789,7 @@ user." (when org-read-date-overlay (delete-overlay org-read-date-overlay) (setq org-read-date-overlay nil))))) - (bury-buffer "*Calendar*") + (bury-buffer calendar-buffer) (when cal-frame (delete-frame cal-frame) (select-frame-set-input-focus cur-frame)))))) @@ -14146,7 +14146,7 @@ user function argument order change dependent on argument order." 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*" t)) + (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)) @@ -15005,7 +15005,7 @@ When SUPPRESS-TMP-DELAY is non-nil, suppress delays like (org-get-heading t t))))))))) ;; Try to recenter the calendar window, if any. (when (and org-calendar-follow-timestamp-change - (get-buffer-window "*Calendar*" t) + (get-buffer-window calendar-buffer t) (memq timestamp? '(day month year))) (org-recenter-calendar (time-to-days time)))))) @@ -15048,7 +15048,7 @@ When SUPPRESS-TMP-DELAY is non-nil, suppress delays like (defun org-recenter-calendar (d) "If the calendar is visible, recenter it to date D." - (let ((cwin (get-buffer-window "*Calendar*" t))) + (let ((cwin (get-buffer-window calendar-buffer t))) (when cwin (let ((calendar-move-hook nil)) (with-selected-window cwin @@ -15075,7 +15075,7 @@ A prefix ARG can be used to force the current date." (defun org-get-date-from-calendar () "Return a list (month day year) of date at point in calendar." - (with-current-buffer "*Calendar*" + (with-current-buffer calendar-buffer (save-match-data (calendar-cursor-to-date))))