aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
authorjave2014-12-31 12:24:10 +0100
committerjave2014-12-31 12:24:10 +0100
commitbaba9e039136e183e055169ddd7ca1e983fc734f (patch)
tree9168fb077980351a25ea3a112f2abd105a11099a /src/editfns.c
parent4105b6a93047045553e10795742a808b805c85b7 (diff)
parent25346768fac53687c97c213fb99ff18fa805b073 (diff)
downloademacs-baba9e039136e183e055169ddd7ca1e983fc734f.tar.gz
emacs-baba9e039136e183e055169ddd7ca1e983fc734f.zip
merge upstream
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 430c4c91fb3..2a7dd9209ae 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -93,6 +93,17 @@ static char const *initial_tz;
93 It is OK (though a bit slower) if the user chooses this value. */ 93 It is OK (though a bit slower) if the user chooses this value. */
94static char dump_tz_string[] = "TZ=UtC0"; 94static char dump_tz_string[] = "TZ=UtC0";
95 95
96/* The cached value of Vsystem_name. This is used only to compare it
97 to Vsystem_name, so it need not be visible to the GC. */
98static Lisp_Object cached_system_name;
99
100static void
101init_and_cache_system_name (void)
102{
103 init_system_name ();
104 cached_system_name = Vsystem_name;
105}
106
96void 107void
97init_editfns (void) 108init_editfns (void)
98{ 109{
@@ -102,7 +113,7 @@ init_editfns (void)
102 Lisp_Object tem; 113 Lisp_Object tem;
103 114
104 /* Set up system_name even when dumping. */ 115 /* Set up system_name even when dumping. */
105 init_system_name (); 116 init_and_cache_system_name ();
106 117
107#ifndef CANNOT_DUMP 118#ifndef CANNOT_DUMP
108 /* When just dumping out, set the time zone to a known unlikely value 119 /* When just dumping out, set the time zone to a known unlikely value
@@ -1365,6 +1376,8 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0,
1365 doc: /* Return the host name of the machine you are running on, as a string. */) 1376 doc: /* Return the host name of the machine you are running on, as a string. */)
1366 (void) 1377 (void)
1367{ 1378{
1379 if (EQ (Vsystem_name, cached_system_name))
1380 init_and_cache_system_name ();
1368 return Vsystem_name; 1381 return Vsystem_name;
1369} 1382}
1370 1383
@@ -4965,6 +4978,7 @@ functions if all the text being accessed has this property. */);
4965 4978
4966 DEFVAR_LISP ("system-name", Vsystem_name, 4979 DEFVAR_LISP ("system-name", Vsystem_name,
4967 doc: /* The host name of the machine Emacs is running on. */); 4980 doc: /* The host name of the machine Emacs is running on. */);
4981 Vsystem_name = cached_system_name = Qnil;
4968 4982
4969 DEFVAR_LISP ("user-full-name", Vuser_full_name, 4983 DEFVAR_LISP ("user-full-name", Vuser_full_name,
4970 doc: /* The full name of the user logged in. */); 4984 doc: /* The full name of the user logged in. */);