diff options
| author | Jim Blandy | 1992-08-12 13:46:12 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-08-12 13:46:12 +0000 |
| commit | c2662aea9a59b3442a9a27f897e89f35ad10a440 (patch) | |
| tree | ec21e8f9a40be1602456300f1012f0e77f73d1b1 /src | |
| parent | 9fbfa962b95d25431412833795c21cf27ef69c95 (diff) | |
| download | emacs-c2662aea9a59b3442a9a27f897e89f35ad10a440.tar.gz emacs-c2662aea9a59b3442a9a27f897e89f35ad10a440.zip | |
* editfns.c (Fcurrent_time_zone): Doc fix.
* editfns.c (Fcurrent_time_zone): Don't forget to include code to
signal an error when EMACS_CURRENT_TIME_ZONE is not defined.
* editfns.c (Fcurrent_time_zone): New function.
(syms_of_editfns): defsubr it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/editfns.c b/src/editfns.c index 04772cb945b..e7eeaf2bdd2 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -542,6 +542,43 @@ if we can figure out a reasonably easy way to get that information.") | |||
| 542 | 542 | ||
| 543 | return build_string (buf); | 543 | return build_string (buf); |
| 544 | } | 544 | } |
| 545 | |||
| 546 | DEFUN ("current-time-zone", Fcurrent_time_zone, Scurrent_time_zone, 0, 0, 0, | ||
| 547 | "Return the offset, savings state, and names for the current time zone.\n\ | ||
| 548 | This returns a list of the form (OFFSET SAVINGS-FLAG STANDARD SAVINGS).\n\ | ||
| 549 | OFFSET is an integer specifying how many minutes east of Greenwich the\n\ | ||
| 550 | current time zone is located. A negative value means west of\n\ | ||
| 551 | Greenwich. Note that this describes the standard time; If daylight\n\ | ||
| 552 | savings time is in effect, it does not affect this value.\n\ | ||
| 553 | SAVINGS-FLAG is non-nil iff daylight savings time or some other sort\n\ | ||
| 554 | of seasonal time adjustment is in effect.\n\ | ||
| 555 | STANDARD is a string giving the name of the time zone when no seasonal\n\ | ||
| 556 | time adjustment is in effect.\n\ | ||
| 557 | SAVINGS is a string giving the name of the time zone when there is a\n\ | ||
| 558 | seasonal time adjustment in effect.\n\ | ||
| 559 | If the local area does not use a seasonal time adjustment,\n\ | ||
| 560 | SAVINGS-FLAG will always be nil, and STANDARD and SAVINGS will be the\n\ | ||
| 561 | same.") | ||
| 562 | () | ||
| 563 | { | ||
| 564 | #ifdef EMACS_CURRENT_TIME_ZONE | ||
| 565 | int offset, savings_flag; | ||
| 566 | char standard[11]; | ||
| 567 | char savings[11]; | ||
| 568 | |||
| 569 | EMACS_CURRENT_TIME_ZONE (&offset, &savings_flag, standard, savings); | ||
| 570 | |||
| 571 | return Fcons (make_number (offset), | ||
| 572 | Fcons ((savings_flag ? Qt : Qnil), | ||
| 573 | Fcons (build_string (standard), | ||
| 574 | Fcons (build_string (savings), | ||
| 575 | Qnil)))); | ||
| 576 | #else | ||
| 577 | error | ||
| 578 | ("current-time-zone has not been implemented on this operating system."); | ||
| 579 | #endif | ||
| 580 | } | ||
| 581 | |||
| 545 | 582 | ||
| 546 | void | 583 | void |
| 547 | insert1 (arg) | 584 | insert1 (arg) |
| @@ -1255,6 +1292,7 @@ syms_of_editfns () | |||
| 1255 | defsubr (&Suser_full_name); | 1292 | defsubr (&Suser_full_name); |
| 1256 | defsubr (&Scurrent_time); | 1293 | defsubr (&Scurrent_time); |
| 1257 | defsubr (&Scurrent_time_string); | 1294 | defsubr (&Scurrent_time_string); |
| 1295 | defsubr (&Scurrent_time_zone); | ||
| 1258 | defsubr (&Ssystem_name); | 1296 | defsubr (&Ssystem_name); |
| 1259 | defsubr (&Smessage); | 1297 | defsubr (&Smessage); |
| 1260 | defsubr (&Sformat); | 1298 | defsubr (&Sformat); |