changeset 17626:68cce262538d

Use defcustom.
author Richard M. Stallman <rms@gnu.org>
date Sat, 03 May 1997 04:58:13 +0000
parents 321afd5b0bc5
children 2492168c1d05
files lisp/calendar/cal-tex.el lisp/calendar/diary-lib.el lisp/calendar/solar.el
diffstat 3 files changed, 71 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/cal-tex.el	Sat May 03 04:56:48 1997 +0000
+++ b/lisp/calendar/cal-tex.el	Sat May 03 04:58:13 1997 +0000
@@ -51,23 +51,29 @@
 ;;; Customizable variables 
 ;;;
 
-(defvar cal-tex-which-days '(0 1 2 3 4 5 6)
+(defcustom cal-tex-which-days '(0 1 2 3 4 5 6)
   "*The days of the week that are displayed on the portrait monthly calendar.
 Sunday is 0, Monday is 1, and so on.  The default is to print from Sunday to
 Saturday.  For example, use
 
                     (setq cal-tex-which-days '(1 3 5))
 
-to only print Monday, Wednesday, Friday.")
+to only print Monday, Wednesday, Friday."
+  :type '(repeat integer)
+  :group 'calendar-tex)
 
-(defvar cal-tex-holidays t
+(defcustom cal-tex-holidays t
   "*If t (default), then the holidays are also printed.
-If finding the holidays is too slow, set this to nil.")
+If finding the holidays is too slow, set this to nil."
+  :type 'boolean
+  :group 'calendar-tex)
 
-(defvar cal-tex-diary nil
-  "*If t, the diary entries are printed in the calendar.")
+(defcustom cal-tex-diary nil
+  "*If t, the diary entries are printed in the calendar."
+  :type 'boolean
+  :group 'calendar-tex)
 
-(defvar cal-tex-daily-string
+(defcustom cal-tex-daily-string
   '(let* ((year (extract-calendar-year date))
           (day  (calendar-day-number date))
           (days-remaining (- (calendar-day-number (list 12 31 year)) day)))
@@ -84,19 +90,29 @@
        (require 'cal-hebrew)
        (calendar-hebrew-date-string date))
 
-will put the Hebrew date at the bottom of each day.")
+will put the Hebrew date at the bottom of each day."
+  :type 'sexp
+  :group 'calendar-tex)
 
-(defvar cal-tex-buffer "calendar.tex"
-  "*The name for the tex-ed calendar.")
+(defcustom cal-tex-buffer "calendar.tex"
+  "*The name for the tex-ed calendar."
+  :type 'string
+  :group 'calendar-tex)
 
-(defvar cal-tex-24 nil
-  "*If t, use a 24 hour clock in the daily calendar.")
+(defcustom cal-tex-24 nil
+  "*If t, use a 24 hour clock in the daily calendar."
+  :type 'boolean
+  :group 'calendar-tex)
 
-(defvar cal-tex-daily-start 8
-  "*The first hour of the daily calendar page.")
+(defcustom cal-tex-daily-start 8
+  "*The first hour of the daily calendar page."
+  :type 'integer
+  :group 'calendar-tex)
 
-(defvar cal-tex-daily-end 20
-  "*The last hour of the daily calendar page.")
+(defcustom cal-tex-daily-end 20
+  "*The last hour of the daily calendar page."
+  :type 'integer
+  :group 'calendar-tex)
 
 ;;;
 ;;; Definitions for LaTeX code
--- a/lisp/calendar/diary-lib.el	Sat May 03 04:56:48 1997 +0000
+++ b/lisp/calendar/diary-lib.el	Sat May 03 04:58:13 1997 +0000
@@ -1233,7 +1233,7 @@
   "Day of year and number of days remaining in the year of date diary entry."
   (calendar-day-of-year-string date))
 
-(defvar diary-remind-message
+(defcustom diary-remind-message
   '("Reminder: Only "
     (if (= 0 (% days 7))
         (concat (int-to-string (/ days 7)) (if (= 7 days) " week" " weeks"))
@@ -1245,7 +1245,9 @@
  
 Used by the function `diary-remind', a pseudo-pattern is a list of
 expressions that can involve the keywords `days' (a number), `date' (a list of
-month, day, year), and `diary-entry' (a string).")
+month, day, year), and `diary-entry' (a string)."
+  :type 'sexp
+  :group 'diary)
 
 (defun diary-remind (sexp days &optional marking)
   "Provide a reminder of a diary entry.
--- a/lisp/calendar/solar.el	Sat May 03 04:56:48 1997 +0000
+++ b/lisp/calendar/solar.el	Sat May 03 04:58:13 1997 +0000
@@ -1,6 +1,6 @@
 ;;; solar.el --- calendar functions for solar events.
 
-;; Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 1995, 1997 Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;;	Denis B. Roegel <Denis.Roegel@loria.fr>
@@ -63,7 +63,7 @@
 (require 'cal-julian)
 
 ;;;###autoload
-(defvar calendar-time-display-form
+(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.
@@ -77,10 +77,12 @@
   '(24-hours \":\" minutes
     (if time-zone \" (\") time-zone (if time-zone \")\"))
 
-would give military-style times like `21:07 (UTC)'.")
+would give military-style times like `21:07 (UTC)'."
+  :type 'sexp
+  :group 'calendar)
 
 ;;;###autoload
-(defvar calendar-latitude nil
+(defcustom calendar-latitude nil
   "*Latitude of `calendar-location-name' in degrees.
 
 The value can be either a decimal fraction (one place of accuracy is
@@ -88,10 +90,19 @@
 can be a vector [degrees minutes north/south] such as [40 50 north] for New
 York City.
 
-This variable should be set in `site-start'.el.")
+This variable should be set in `site-start'.el."
+  :type '(choice (const nil)
+		 (number :tag "Exact")
+		 (vector :value [0 0 north]
+			 (integer :tag "Degrees")
+			 (integer :tag "Minutes")
+			 (choice :tag "Position"
+				 (const north)
+				 (const south))))
+  :group 'calendar)
 
 ;;;###autoload
-(defvar calendar-longitude nil
+(defcustom calendar-longitude nil
   "*Longitude of `calendar-location-name' in degrees.
 
 The value can be either a decimal fraction (one place of accuracy is
@@ -99,7 +110,16 @@
 can be a vector [degrees minutes east/west] such as [73 55 west] for New
 York City.
 
-This variable should be set in `site-start'.el.")
+This variable should be set in `site-start'.el."
+  :type '(choice (const nil)
+		 (number :tag "Exact")
+		 (vector :value [0 0 west]
+			 (integer :tag "Degrees")
+			 (integer :tag "Minutes")
+			 (choice :tag "Position"
+				 (const east)
+				 (const west))))
+  :group 'calendar)
 
 (defsubst calendar-latitude ()
   "Convert calendar-latitude to a signed decimal fraction, if needed."
@@ -122,7 +142,7 @@
         (- long)))))
 
 ;;;###autoload
-(defvar calendar-location-name
+(defcustom calendar-location-name
   '(let ((float-output-format "%.1f"))
      (format "%s%s, %s%s"
              (if (numberp calendar-latitude)
@@ -143,9 +163,11 @@
 For example, \"New York City\".  Default value is just the latitude, longitude
 pair.
 
-This variable should be set in `site-start'.el.")
+This variable should be set in `site-start'.el."
+  :type 'sexp
+  :group 'calendar)
 
-(defvar solar-error 0.5
+(defcustom solar-error 0.5
 "*Tolerance (in minutes) for sunrise/sunset calculations.
 
 A larger value makes the calculations for sunrise/sunset faster, but less
@@ -156,7 +178,9 @@
 accuracy in the longitude of the sun (given by the function
 `solar-ecliptic-coordinates') in degrees since (delta/360) x (86400/60) = 4 x
 delta.  At present, delta = 0.01 degrees, so the value of the variable
-`solar-error' should be at least 0.04 minutes (about 2.5 seconds).")
+`solar-error' should be at least 0.04 minutes (about 2.5 seconds)."
+  :type 'number
+  :group 'calendar)
 
 (defvar solar-n-hemi-seasons
   '("Vernal Equinox" "Summer Solstice" "Autumnal Equinox" "Winter Solstice")