Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
143cb9a9
Commit
143cb9a9
authored
Sep 10, 1995
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Fset_time_zone_rule): New function.
(syms_of_editfns): defsubr it.
parent
7fd81709
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
src/editfns.c
src/editfns.c
+50
-0
No files found.
src/editfns.c
View file @
143cb9a9
...
...
@@ -899,6 +899,55 @@ the data it can't find.")
return
Fmake_list
(
2
,
Qnil
);
}
DEFUN
(
"set-time-zone-rule"
,
Fset_time_zone_rule
,
Sset_time_zone_rule
,
1
,
1
,
0
,
"Set the local time zone using TZ, a string specifying a time zone rule.
\n
\
If TZ is nil, use implementation-defined default time zone information."
)
(
tz
)
Lisp_Object
tz
;
{
extern
char
**
environ
;
static
char
**
environbuf
;
int
envptrs
;
char
**
from
,
**
to
,
**
newenv
;
char
*
tzstring
;
if
(
NILP
(
tz
))
tzstring
=
0
;
else
{
CHECK_STRING
(
tz
,
0
);
tzstring
=
XSTRING
(
tz
)
->
data
;
}
for
(
from
=
environ
;
*
from
;
from
++
)
continue
;
envptrs
=
from
-
environ
+
2
;
newenv
=
to
=
(
char
**
)
xmalloc
(
envptrs
*
sizeof
(
char
*
)
+
(
tzstring
?
strlen
(
tzstring
)
+
4
:
0
));
if
(
tzstring
)
{
char
*
t
=
(
char
*
)
(
to
+
envptrs
);
strcpy
(
t
,
"TZ="
);
strcat
(
t
,
tzstring
);
*
to
++
=
t
;
}
for
(
from
=
environ
;
*
from
;
from
++
)
if
(
strncmp
(
*
from
,
"TZ="
,
3
)
!=
0
)
*
to
++
=
*
from
;
*
to
=
0
;
environ
=
newenv
;
if
(
environbuf
)
free
(
environbuf
);
environbuf
=
newenv
;
#ifdef LOCALTIME_CACHE
tzset
();
#endif
return
Qnil
;
}
void
insert1
(
arg
)
...
...
@@ -2319,6 +2368,7 @@ syms_of_editfns ()
defsubr
(
&
Sencode_time
);
defsubr
(
&
Scurrent_time_string
);
defsubr
(
&
Scurrent_time_zone
);
defsubr
(
&
Sset_time_zone_rule
);
defsubr
(
&
Ssystem_name
);
defsubr
(
&
Smessage
);
defsubr
(
&
Smessage_box
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment