aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
authorPaul Eggert2018-09-21 14:24:42 -0700
committerPaul Eggert2018-09-21 14:25:19 -0700
commit0bec064454adac2bdff04a11bbdfaa79aa4ce052 (patch)
treeab85b4e46d2ab44dd3d02b85a5a540470842e470 /src/editfns.c
parent167274d44f1ccaee65a5b68e15c3ed79a53447d1 (diff)
downloademacs-0bec064454adac2bdff04a11bbdfaa79aa4ce052.tar.gz
emacs-0bec064454adac2bdff04a11bbdfaa79aa4ce052.zip
Fix ambiguity in nil DST flag
Formerly nil meant both that DST was not in effect and that the DST flag was unknown, and different functions interpreted the flag differently. Now the meaning is consistently nil for DST not in effect, and -1 for DST flag not known. * doc/lispref/os.texi (Time Conversion): The DST slot is now three-valued, not two-. * doc/misc/emacs-mime.texi (time-date): Adjust to new behavior. * etc/NEWS: Mention this. * lisp/calendar/parse-time.el (parse-time-string): * src/editfns.c (Fdecode_time): Return -1 for unknown DST flag. * test/lisp/calendar/parse-time-tests.el (parse-time-tests): Adjust tests to match new behavior, and add a new test for nil vs -1.
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 8c7491beedc..047a73f0b8c 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2165,7 +2165,8 @@ between 0 and 23. DAY is an integer between 1 and 31. MONTH is an
2165integer between 1 and 12. YEAR is an integer indicating the 2165integer between 1 and 12. YEAR is an integer indicating the
2166four-digit year. DOW is the day of week, an integer between 0 and 6, 2166four-digit year. DOW is the day of week, an integer between 0 and 6,
2167where 0 is Sunday. DST is t if daylight saving time is in effect, 2167where 0 is Sunday. DST is t if daylight saving time is in effect,
2168otherwise nil. UTCOFF is an integer indicating the UTC offset in 2168nil if it is not in effect, and -1 if this information is
2169not available. UTCOFF is an integer indicating the UTC offset in
2169seconds, i.e., the number of seconds east of Greenwich. (Note that 2170seconds, i.e., the number of seconds east of Greenwich. (Note that
2170Common Lisp has different meanings for DOW and UTCOFF.) 2171Common Lisp has different meanings for DOW and UTCOFF.)
2171 2172
@@ -2194,7 +2195,8 @@ usage: (decode-time &optional TIME ZONE) */)
2194 make_fixnum (local_tm.tm_mon + 1), 2195 make_fixnum (local_tm.tm_mon + 1),
2195 make_fixnum (local_tm.tm_year + tm_year_base), 2196 make_fixnum (local_tm.tm_year + tm_year_base),
2196 make_fixnum (local_tm.tm_wday), 2197 make_fixnum (local_tm.tm_wday),
2197 local_tm.tm_isdst ? Qt : Qnil, 2198 (local_tm.tm_isdst < 0 ? make_fixnum (-1)
2199 : local_tm.tm_isdst == 0 ? Qnil : Qt),
2198 (HAVE_TM_GMTOFF 2200 (HAVE_TM_GMTOFF
2199 ? make_fixnum (tm_gmtoff (&local_tm)) 2201 ? make_fixnum (tm_gmtoff (&local_tm))
2200 : gmtime_r (&time_spec, &gmt_tm) 2202 : gmtime_r (&time_spec, &gmt_tm)