Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

So I changed the name of my computer recently, by editing /etc/hostname. The bash prompt is user@name, so I know it has worked.

But in emacs, in the window bar it says emacs@name.tiscali.co.uk. Tiscali is my internet provider. Before I changed it, emacs just had emacs@oldname in the window bar.

How can I remove my IP's name from the window bar in emacs?

share|improve this question
add comment

2 Answers

up vote 8 down vote accepted

The name in /etc/hostname is what your computer thinks it's called. That's often what is meant by hostname.

Computers connected to the Internet (including intranets) have names; more precisely, most Internet network interfaces have a name associated with their IP address. Internet nodes that are not routers generally have a single network interface worth consideration, and the name associated to this interface is called its fully qualified domain name (FQDN). The FQDN is the name you can use to designate your computer from any other Internet node (well, assuming there are no complex configurations involved). Generally, to keep confusion down, the FQDN is something like foo.example.com where foo is the host name.


When you have a single frame open, Emacs uses the value of the system-name variable as the frame title. This variable is set to the FQDN when Emacs starts. You can change it from your .emacs if you wish. This variable isn't used much, so don't worry about changing it. It is used to form a default email address when you send mail or news posts from within Emacs, but you'd almost always override that email address setting anyway.

The frame title format is determined by the frame-title-format variable (unless overridden for a specific frame). You can change it if you'd like to use something other than system-name when there is a single frame. For example, if you want to always see the buffer name in the frame title (as opposed to when there is only one Emacs frame), you can set it to "%b".

share|improve this answer
    
Here's mine: (multiple-frames "%b" ("" invocation-name "@" system-name)) –  Joel J. Adamson Sep 24 '10 at 16:50
    
How do I change my FQDN? I know how to change /etc/hostname, but that doesn't change the fully qualified name... –  Seamus Sep 25 '10 at 17:35
    
@Seamus: Simple answer: in /etc/hosts, on the line corresponding to your IP address, change or add a name containing at least one dot. True answer: It depends on your network setup and what you want to achieve (there's more than one way to determine the FQDN, and they sometimes give different results). –  Gilles Sep 25 '10 at 19:48
add comment

You might walk through the steps in http://www.debianadmin.com/change-hostname-or-server-name-of-a-linux-machine.html

Emacs seems to use the full qualified domain name, so make sure this matches your desired name.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.