Commit e85393d4 authored by Glenn Morris's avatar Glenn Morris

Remove leading `*' from defcustom doc-strings.

(calendar-time-display-form, calendar-latitude)
(calendar-longitude, solar-equinoxes-solstices): Remove autoload cookies.
(calendar-latitude, calendar-longitude): Move functions after
variables.
(diary-sabbath-candles-minutes): Move to start.
(solar-setup): Use or rather than if.
(solar-sin-degrees, solar-cosine-degrees, solar-tangent-degrees):
Remove condition-case.
(solar-atn2): Use zerop.
(solar-equinoxes-solstices): Doc fix.
parent ec1ee609
......@@ -16,6 +16,67 @@
2008-03-07 Glenn Morris <rgm@gnu.org>
* calendar/appt.el (appt-issue-message)
(appt-message-warning-time, appt-audible, appt-visible)
(appt-msg-window, appt-display-mode-line, appt-display-duration)
(appt-display-diary): Remove autoload cookies.
* calendar/cal-china.el, calendar/timeclock.el, calendar/todo-mode.el:
Remove leading `*' from defcustom doc-strings.
* calendar/cal-dst.el (calendar-dst): New custom group.
(calendar-daylight-savings-starts, calendar-daylight-savings-ends)
(calendar-time-zone, calendar-daylight-time-offset)
(calendar-standard-time-zone-name, calendar-daylight-time-zone-name)
(calendar-daylight-savings-starts-time)
(calendar-daylight-savings-ends-time): Convert from defvar to defcustom.
(calendar-daylight-savings-starts, calendar-daylight-savings-ends):
Move to start.
* calendar/cal-menu.el (holidays-in-diary-buffer): Declare for compiler.
* calendar/calendar.el (calendar-version): Use emacs-version and
make it obsolete. Move to end.
(calendar-offset, view-diary-entries-initially)
(mark-diary-entries-in-calendar, calendar-remove-frame-by-deleting)
(view-calendar-holidays-initially, all-hebrew-calendar-holidays)
(all-christian-calendar-holidays, all-islamic-calendar-holidays)
(all-bahai-calendar-holidays, calendar-load-hook)
(initial-calendar-window-hook, today-visible-calendar-hook)
(today-invisible-calendar-hook, calendar-move-hook)
(diary-nonmarking-symbol, hebrew-diary-entry-symbol)
(islamic-diary-entry-symbol, bahai-diary-entry-symbol)
(diary-include-string, sexp-diary-entry-symbol)
(abbreviated-calendar-year, american-date-diary-pattern)
(european-date-diary-pattern, european-calendar-display-form)
(american-calendar-display-form, print-diary-entries-hook)
(list-diary-entries-hook, diary-hook, diary-display-hook)
(nongregorian-diary-listing-hook, mark-diary-entries-hook)
(nongregorian-diary-marking-hook, diary-list-include-blanks)
(holidays-in-diary-buffer, general-holidays, oriental-holidays)
(local-holidays, other-holidays, hebrew-holidays-1)
(hebrew-holidays-2, hebrew-holidays-3, hebrew-holidays-4)
(hebrew-holidays, christian-holidays, islamic-holidays)
(bahai-holidays, solar-holidays, calendar-setup)
(calendar-week-start-day): Remove autoload cookies.
(diary-glob-file-regexp-prefix): Doc fix.
(calendar-goto-info-node): Use `info' rather than `Info-find-node'.
(Info-find-emacs-command-nodes, Info-find-node): Remove declarations.
(calendar-week-start-day, calendar-debug-sexp): Move to start.
* calendar/solar.el: Remove leading `*' from defcustom doc-strings.
(calendar-time-display-form, calendar-latitude)
(calendar-longitude, solar-equinoxes-solstices): Remove autoload
cookies.
(calendar-latitude, calendar-longitude): Move functions after
variables.
(diary-sabbath-candles-minutes): Move to start.
(solar-setup): Use or rather than if.
(solar-sin-degrees, solar-cosine-degrees, solar-tangent-degrees):
Remove condition-case.
(solar-atn2): Use zerop.
(solar-equinoxes-solstices): Doc fix.
* mail/supercite.el: Remove leading `*' from defcustom doc-strings.
(sc-mode-map-prefix): Doc fix. Make it a defcustom.
......
......@@ -61,16 +61,16 @@
(if (fboundp 'atan)
(require 'lisp-float-type)
(error "Solar/lunar calculations impossible since floating point is unavailable"))
(error "Solar calculations impossible since floating point is unavailable"))
(require 'cal-dst)
(require 'cal-julian)
;;;###autoload
(defcustom calendar-time-display-form
'(12-hours ":" minutes am-pm
(if time-zone " (") time-zone (if time-zone ")"))
"*The pseudo-pattern that governs the way a time of day is formatted.
"The pseudo-pattern that governs the way a time of day is formatted.
A pseudo-pattern is a list of expressions that can involve the keywords
`12-hours', `24-hours', and `minutes', all numbers in string form,
......@@ -85,9 +85,8 @@ would give military-style times like `21:07 (UTC)'."
:type 'sexp
:group 'calendar)
;;;###autoload
(defcustom calendar-latitude nil
"*Latitude of `calendar-location-name' in degrees.
"Latitude of `calendar-location-name' in degrees.
The value can be either a decimal fraction (one place of accuracy is
sufficient), + north, - south, such as 40.7 for New York City, or the value
......@@ -105,9 +104,8 @@ This variable should be set in `site-start'.el."
(const south))))
:group 'calendar)
;;;###autoload
(defcustom calendar-longitude nil
"*Longitude of `calendar-location-name' in degrees.
"Longitude of `calendar-location-name' in degrees.
The value can be either a decimal fraction (one place of accuracy is
sufficient), + east, - west, such as -73.9 for New York City, or the value
......@@ -125,27 +123,6 @@ This variable should be set in `site-start'.el."
(const west))))
:group 'calendar)
(defsubst calendar-latitude ()
"Convert calendar-latitude to a signed decimal fraction, if needed."
(if (numberp calendar-latitude)
calendar-latitude
(let ((lat (+ (aref calendar-latitude 0)
(/ (aref calendar-latitude 1) 60.0))))
(if (equal (aref calendar-latitude 2) 'north)
lat
(- lat)))))
(defsubst calendar-longitude ()
"Convert calendar-longitude to a signed decimal fraction, if needed."
(if (numberp calendar-longitude)
calendar-longitude
(let ((long (+ (aref calendar-longitude 0)
(/ (aref calendar-longitude 1) 60.0))))
(if (equal (aref calendar-longitude 2) 'east)
long
(- long)))))
;;;###autoload
(defcustom calendar-location-name
'(let ((float-output-format "%.1f"))
(format "%s%s, %s%s"
......@@ -163,7 +140,7 @@ This variable should be set in `site-start'.el."
(if (numberp calendar-longitude)
(if (> calendar-longitude 0) "E" "W")
(if (equal (aref calendar-longitude 2) 'east) "E" "W"))))
"*Expression evaluating to name of `calendar-longitude', `calendar-latitude'.
"Expression evaluating to name of `calendar-longitude', `calendar-latitude'.
For example, \"New York City\". Default value is just the latitude, longitude
pair.
......@@ -172,7 +149,7 @@ This variable should be set in `site-start'.el."
:group 'calendar)
(defcustom solar-error 0.5
"*Tolerance (in minutes) for sunrise/sunset calculations.
"Tolerance (in minutes) for sunrise/sunset calculations.
A larger value makes the calculations for sunrise/sunset faster, but less
accurate. The default is half a minute (30 seconds), so that sunrise/sunset
......@@ -186,6 +163,16 @@ delta. At present, delta = 0.01 degrees, so the value of the variable
:type 'number
:group 'calendar)
(defcustom diary-sabbath-candles-minutes 18
"Number of minutes before sunset for sabbath candle lighting."
:group 'diary
:type 'integer
:version "21.1")
;;; End of user options.
(defvar solar-n-hemi-seasons
'("Vernal Equinox" "Summer Solstice" "Autumnal Equinox" "Winter Solstice")
"List of season changes for the northern hemisphere.")
......@@ -202,21 +189,43 @@ delta. At present, delta = 0.01 degrees, so the value of the variable
"Non-nil if northern spring or summer and nil otherwise.
Needed for polar areas, in order to know whether the day lasts 0 or 24 hours.")
(defsubst calendar-latitude ()
"Convert calendar-latitude to a signed decimal fraction, if needed."
(if (numberp calendar-latitude)
calendar-latitude
(let ((lat (+ (aref calendar-latitude 0)
(/ (aref calendar-latitude 1) 60.0))))
(if (equal (aref calendar-latitude 2) 'north)
lat
(- lat)))))
(defsubst calendar-longitude ()
"Convert calendar-longitude to a signed decimal fraction, if needed."
(if (numberp calendar-longitude)
calendar-longitude
(let ((long (+ (aref calendar-longitude 0)
(/ (aref calendar-longitude 1) 60.0))))
(if (equal (aref calendar-longitude 2) 'east)
long
(- long)))))
(defun solar-setup ()
"Prompt user for latitude, longitude, and time zone."
(beep)
(if (not calendar-longitude)
(or calendar-longitude
(setq calendar-longitude
(solar-get-number
"Enter longitude (decimal fraction; + east, - west): ")))
(if (not calendar-latitude)
(or calendar-latitude
(setq calendar-latitude
(solar-get-number
"Enter latitude (decimal fraction; + north, - south): ")))
(if (not calendar-time-zone)
(or calendar-time-zone
(setq calendar-time-zone
(solar-get-number
"Enter difference from Coordinated Universal Time (in minutes): "))))
"Enter difference from Coordinated Universal Time (in \
minutes): "))))
(defun solar-get-number (prompt)
"Return a number from the minibuffer, prompting with PROMPT.
......@@ -225,20 +234,14 @@ Returns nil if nothing was entered."
(if (not (string-equal x ""))
(string-to-number x))))
;; The condition-case stuff is needed to catch bogus arithmetic
;; exceptions that occur on some machines (like Sparcs)
(defun solar-sin-degrees (x)
(condition-case nil
(sin (degrees-to-radians (mod x 360.0)))
(solar-sin-degrees x)))
(sin (degrees-to-radians (mod x 360.0))))
(defun solar-cosine-degrees (x)
(condition-case nil
(cos (degrees-to-radians (mod x 360.0)))
(solar-cosine-degrees x)))
(cos (degrees-to-radians (mod x 360.0))))
(defun solar-tangent-degrees (x)
(condition-case nil
(tan (degrees-to-radians (mod x 360.0)))
(solar-tangent-degrees x)))
(tan (degrees-to-radians (mod x 360.0))))
(defun solar-xy-to-quadrant (x y)
"Determines the quadrant of the point X, Y."
......@@ -260,20 +263,19 @@ Returns nil if nothing was entered."
(defun solar-atn2 (x y)
"Arctan of point X, Y."
(if (= x 0)
(if (zerop x)
(if (> y 0) 90 270)
(solar-arctan (/ y x) (solar-xy-to-quadrant x y))))
(defun solar-arccos (x)
"Arcos of X."
(let ((y (sqrt (- 1 (* x x)))))
(solar-atn2 x y)))
"Arcos of X."
(let ((y (sqrt (- 1 (* x x)))))
(solar-atn2 x y)))
(defun solar-arcsin (y)
"Arcsin of Y."
(let ((x (sqrt (- 1 (* y y)))))
(solar-atn2 x y)
))
"Arcsin of Y."
(let ((x (sqrt (- 1 (* y y)))))
(solar-atn2 x y)))
(defsubst solar-degrees-to-hours (degrees)
"Convert DEGREES to hours."
......@@ -914,12 +916,6 @@ Accurate to a few seconds."
(solar-setup))
(solar-sunrise-sunset-string date))
(defcustom diary-sabbath-candles-minutes 18
"*Number of minutes before sunset for sabbath candle lighting."
:group 'diary
:type 'integer
:version "21.1")
(defun diary-sabbath-candles (&optional mark)
"Local time of candle lighting diary entry--applies if date is a Friday.
No diary entry if there is no sunset on that date.
......@@ -1044,9 +1040,8 @@ solstice. These formulas are only to be used between 1000 BC and 3000 AD."
(* -0.00823 z z z)
(* 0.00032 z z z z)))))))
;;;###autoload
(defun solar-equinoxes-solstices ()
"*local* date and time of equinoxes and solstices, if visible in the calendar window.
"Local date and time of equinoxes and solstices, if visible in the calendar.
Requires floating point."
(let ((m displayed-month)
(y displayed-year))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment