diff options
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 16 |
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. */ |
| 94 | static char dump_tz_string[] = "TZ=UtC0"; | 94 | static 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. */ | ||
| 98 | static Lisp_Object cached_system_name; | ||
| 99 | |||
| 100 | static void | ||
| 101 | init_and_cache_system_name (void) | ||
| 102 | { | ||
| 103 | init_system_name (); | ||
| 104 | cached_system_name = Vsystem_name; | ||
| 105 | } | ||
| 106 | |||
| 96 | void | 107 | void |
| 97 | init_editfns (void) | 108 | init_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. */); |