diff options
| author | Paul Eggert | 2011-09-03 16:03:38 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-09-03 16:03:38 -0700 |
| commit | b49e353d9d01adbe60bc5d0b1658b4ef978b0b06 (patch) | |
| tree | 9f2ffa6f7a6562abf661a4951012b488ad8b1ae7 /src/editfns.c | |
| parent | 74b880cbc18bd0194c7b1fc44c4a983ee05adae2 (diff) | |
| parent | bc3200871917d5c54c8c4299a06bf8f8ba2ea02d (diff) | |
| download | emacs-b49e353d9d01adbe60bc5d0b1658b4ef978b0b06.tar.gz emacs-b49e353d9d01adbe60bc5d0b1658b4ef978b0b06.zip | |
Merge from trunk.
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/editfns.c b/src/editfns.c index 577263c5aea..6759016766f 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -1695,7 +1695,9 @@ The modifiers are `E' and `O'. For certain characters X, | |||
| 1695 | %EX is a locale's alternative version of %X; | 1695 | %EX is a locale's alternative version of %X; |
| 1696 | %OX is like %X, but uses the locale's number symbols. | 1696 | %OX is like %X, but uses the locale's number symbols. |
| 1697 | 1697 | ||
| 1698 | For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */) | 1698 | For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". |
| 1699 | |||
| 1700 | usage: (format-time-string FORMAT-STRING &optional TIME UNIVERSAL) */) | ||
| 1699 | (Lisp_Object format_string, Lisp_Object timeval, Lisp_Object universal) | 1701 | (Lisp_Object format_string, Lisp_Object timeval, Lisp_Object universal) |
| 1700 | { | 1702 | { |
| 1701 | time_t value; | 1703 | time_t value; |
| @@ -2051,7 +2053,12 @@ static char *initial_tz; | |||
| 2051 | DEFUN ("set-time-zone-rule", Fset_time_zone_rule, Sset_time_zone_rule, 1, 1, 0, | 2053 | DEFUN ("set-time-zone-rule", Fset_time_zone_rule, Sset_time_zone_rule, 1, 1, 0, |
| 2052 | doc: /* Set the local time zone using TZ, a string specifying a time zone rule. | 2054 | doc: /* Set the local time zone using TZ, a string specifying a time zone rule. |
| 2053 | If TZ is nil, use implementation-defined default time zone information. | 2055 | If TZ is nil, use implementation-defined default time zone information. |
| 2054 | If TZ is t, use Universal Time. */) | 2056 | If TZ is t, use Universal Time. |
| 2057 | |||
| 2058 | Instead of calling this function, you typically want (setenv "TZ" TZ). | ||
| 2059 | That changes both the environment of the Emacs process and the | ||
| 2060 | variable `process-environment', whereas `set-time-zone-rule' affects | ||
| 2061 | only the former. */) | ||
| 2055 | (Lisp_Object tz) | 2062 | (Lisp_Object tz) |
| 2056 | { | 2063 | { |
| 2057 | const char *tzstring; | 2064 | const char *tzstring; |
| @@ -2100,7 +2107,7 @@ static char set_time_zone_rule_tz2[] = "TZ=GMT+1"; | |||
| 2100 | void | 2107 | void |
| 2101 | set_time_zone_rule (const char *tzstring) | 2108 | set_time_zone_rule (const char *tzstring) |
| 2102 | { | 2109 | { |
| 2103 | int envptrs; | 2110 | ptrdiff_t envptrs; |
| 2104 | char **from, **to, **newenv; | 2111 | char **from, **to, **newenv; |
| 2105 | 2112 | ||
| 2106 | /* Make the ENVIRON vector longer with room for TZSTRING. */ | 2113 | /* Make the ENVIRON vector longer with room for TZSTRING. */ |
| @@ -3350,7 +3357,7 @@ usage: (save-restriction &rest BODY) */) | |||
| 3350 | static char *message_text; | 3357 | static char *message_text; |
| 3351 | 3358 | ||
| 3352 | /* Allocated length of that buffer. */ | 3359 | /* Allocated length of that buffer. */ |
| 3353 | static int message_length; | 3360 | static ptrdiff_t message_length; |
| 3354 | 3361 | ||
| 3355 | DEFUN ("message", Fmessage, Smessage, 1, MANY, 0, | 3362 | DEFUN ("message", Fmessage, Smessage, 1, MANY, 0, |
| 3356 | doc: /* Display a message at the bottom of the screen. | 3363 | doc: /* Display a message at the bottom of the screen. |
| @@ -3432,8 +3439,8 @@ usage: (message-box FORMAT-STRING &rest ARGS) */) | |||
| 3432 | } | 3439 | } |
| 3433 | if (SBYTES (val) > message_length) | 3440 | if (SBYTES (val) > message_length) |
| 3434 | { | 3441 | { |
| 3442 | message_text = (char *) xrealloc (message_text, SBYTES (val)); | ||
| 3435 | message_length = SBYTES (val); | 3443 | message_length = SBYTES (val); |
| 3436 | message_text = (char *)xrealloc (message_text, message_length); | ||
| 3437 | } | 3444 | } |
| 3438 | memcpy (message_text, SDATA (val), SBYTES (val)); | 3445 | memcpy (message_text, SDATA (val), SBYTES (val)); |
| 3439 | message2 (message_text, SBYTES (val), | 3446 | message2 (message_text, SBYTES (val), |
| @@ -3882,7 +3889,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3882 | : -1)), | 3889 | : -1)), |
| 3883 | 3890 | ||
| 3884 | /* Maximum number of bytes generated by any format, if | 3891 | /* Maximum number of bytes generated by any format, if |
| 3885 | precision is no more than DBL_USEFUL_PRECISION_MAX. | 3892 | precision is no more than USEFUL_PRECISION_MAX. |
| 3886 | On all practical hosts, %f is the worst case. */ | 3893 | On all practical hosts, %f is the worst case. */ |
| 3887 | SPRINTF_BUFSIZE = | 3894 | SPRINTF_BUFSIZE = |
| 3888 | sizeof "-." + (DBL_MAX_10_EXP + 1) + USEFUL_PRECISION_MAX, | 3895 | sizeof "-." + (DBL_MAX_10_EXP + 1) + USEFUL_PRECISION_MAX, |
| @@ -4158,7 +4165,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 4158 | character. CONVBYTES says how much room is needed. Allocate | 4165 | character. CONVBYTES says how much room is needed. Allocate |
| 4159 | enough room (and then some) and do it again. */ | 4166 | enough room (and then some) and do it again. */ |
| 4160 | { | 4167 | { |
| 4161 | EMACS_INT used = p - buf; | 4168 | ptrdiff_t used = p - buf; |
| 4162 | 4169 | ||
| 4163 | if (max_bufsize - used < convbytes) | 4170 | if (max_bufsize - used < convbytes) |
| 4164 | string_overflow (); | 4171 | string_overflow (); |