Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How does Emacs determine the name of my computer?

Computer determine Emacs
0
10 Posted

How does Emacs determine the name of my computer?

0
10

Emacs initializes the variable “system-name” with the name of your computer upon startup. However, Emacs uses two different methods for determining the computer name depending upon whether Winsock is loaded by default when Emacs starts up. If Winsock is automatically loaded, then Emacs uses gethostname, otherwise Emacs uses GetComputerName. Alternatively, you can override all of this by explicitly setting system-name in your startup file (also look at user-mail-address for composing mail messages). By default, Emacs does not automatically load Winsock because doing so will cause Winsock to establish a connection to the network. If you are connected to a LAN, then nothing will happen, but if you dialup to an ISP then invoking Emacs (thereby loading Winsock) will prompt you to unexpectedly dialup to your ISP. You can have Emacs automatically load Winsock by defining the environment variable PRELOAD_WINSOCK. You can set it to an arbitrary value; Emacs just checks to see if it is defined.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123