Use `calendar-buffer' constant to refer to calendar buffers

* lisp/org-agenda.el (org-agenda-diary-entry-in-org-file):
* lisp/org.el (org-read-date):
(org-eval-in-calendar):
(org-timestamp-change):
(org-recenter-calendar):
(org-get-date-from-calendar): Use `calendar-buffer' instead of
hard-coded "*Calendar*".

Reported-by: Thuna <thuna.cing@gmail.com>
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61546
This commit is contained in:
Ihor Radchenko 2023-05-02 13:33:34 +02:00
parent 05c3e59de1
commit 9ea50ca211
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
2 changed files with 7 additions and 7 deletions

View File

@ -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))

View File

@ -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))))