Subject: bug#19438: 24.4; system-name bad cache

From: Stefan Monnier <[email-masked]>
Date: Sat, 27 Dec 2014 10:13:43 -0500

>> Why not get rid of the variable system-name?  It seems what it provides
>> can be easily achieved without it.
> It's documented so we shouldn't just remove it; we'd need to mark it
> as obsolescent.
> Its documented behavior is "you can set the variable @code{system-name} in
> case Emacs is confused about the name of your system".  I've never found
> this feature to be useful, though I understand it was useful for others long
> ago.  Perhaps some people still find it useful?  Anyway, if there's
> consensus to mark the variable as obsolescent I can prepare a patch along
> those lines.

Maybe we could mark it obsolete, tho I'm not completely sure what
replaces it.  Random thoughts:
- "it" is unclear, since currently the var and the function are just identical.
- this not-very-useful functionality occasionally causes 30s wait at
  startup time, so it would be good to get rid of the DNS lookup.

Maybe we could make the system-name function return the same as
`hostname` (and do it dynamically).

> How about the attached patch?  The idea is that (system-name) actually
> inquires for the current system name, and system-name caches the result.
> If an Emacs lisp program assigns to system-name, though, it's no longer
> updated thereafter.

Sounds OK.

        Stefan