emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a467173: ; Fix warning after last change in cal-julian.el


From: Stefan Kangas
Subject: master a467173: ; Fix warning after last change in cal-julian.el
Date: Wed, 13 May 2020 19:35:11 -0400 (EDT)

branch: master
commit a4671733b7b990e83ef6daed4d17ab240a3591b5
Author: Stefan Kangas <address@hidden>
Commit: Stefan Kangas <address@hidden>

    ; Fix warning after last change in cal-julian.el
    
    * lisp/calendar/cal-julian.el (diary-julian-date)
    (diary-astro-day-number): Silence byte-compiler warning about variable
    'declared after its first use'.
---
 lisp/calendar/cal-julian.el | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/lisp/calendar/cal-julian.el b/lisp/calendar/cal-julian.el
index 0458c11..918995d 100644
--- a/lisp/calendar/cal-julian.el
+++ b/lisp/calendar/cal-julian.el
@@ -182,23 +182,27 @@ Echo astronomical (Julian) day number unless NOECHO is 
non-nil."
      (calendar-astro-to-absolute daynumber))))
   (or noecho (calendar-astro-print-day-number)))
 
-
-;; The function below is designed to be used in sexp diary entries,
-;; and may be present in users' diary files, so suppress the warning
-;; about this prefix-less dynamic variable.  It's called from
-;; `diary-list-sexp-entries', which binds the variable.
-(with-suppressed-warnings ((lexical date))
-  (defvar date))
-
 ;;;###diary-autoload
 (defun diary-julian-date ()
   "Julian calendar equivalent of date diary entry."
+  ;; This function is designed to be used in sexp diary entries, and
+  ;; may be present in users' diary files, so suppress the warning
+  ;; about this prefix-less dynamic variable.  It's called from
+  ;; `diary-list-sexp-entries', which binds the variable.
+  (with-suppressed-warnings ((lexical date))
+    (defvar date))
   (format "Julian date: %s" (calendar-julian-date-string date)))
 
 ;; To be called from diary-list-sexp-entries, where DATE is bound.
 ;;;###diary-autoload
 (defun diary-astro-day-number ()
   "Astronomical (Julian) day number diary entry."
+  ;; This function is designed to be used in sexp diary entries, and
+  ;; may be present in users' diary files, so suppress the warning
+  ;; about this prefix-less dynamic variable.  It's called from
+  ;; `diary-list-sexp-entries', which binds the variable.
+  (with-suppressed-warnings ((lexical date))
+    (defvar date))
   (format "Astronomical (Julian) day number at noon UTC: %s.0"
           (calendar-astro-date-string date)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]