aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c21
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
1698For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */) 1698For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z".
1699
1700usage: (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;
2051DEFUN ("set-time-zone-rule", Fset_time_zone_rule, Sset_time_zone_rule, 1, 1, 0, 2053DEFUN ("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.
2053If TZ is nil, use implementation-defined default time zone information. 2055If TZ is nil, use implementation-defined default time zone information.
2054If TZ is t, use Universal Time. */) 2056If TZ is t, use Universal Time.
2057
2058Instead of calling this function, you typically want (setenv "TZ" TZ).
2059That changes both the environment of the Emacs process and the
2060variable `process-environment', whereas `set-time-zone-rule' affects
2061only 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";
2100void 2107void
2101set_time_zone_rule (const char *tzstring) 2108set_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) */)
3350static char *message_text; 3357static char *message_text;
3351 3358
3352/* Allocated length of that buffer. */ 3359/* Allocated length of that buffer. */
3353static int message_length; 3360static ptrdiff_t message_length;
3354 3361
3355DEFUN ("message", Fmessage, Smessage, 1, MANY, 0, 3362DEFUN ("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 ();