help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hostname and filename as frame title


From: Suvayu Ali
Subject: Re: hostname and filename as frame title
Date: Fri, 12 Feb 2010 02:50:41 -0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc11 Lightning/1.0b2pre Thunderbird/3.0.1

Hi Michael,

On Friday 12 February 2010 01:35 AM, Michael Albinus wrote:
Suvayu Ali<address@hidden>  writes:

I do a lot of remote editing on several remote machines. I recently
came across the variable `frame-title-format' and was wondering if
there is a way to set the hostname of the file being edited and the
file name as the frame title? Something like address@hidden

I don't even know where to start looking, any pointers would be awesome. :)

What about this:

(setq-default
  frame-title-format
  '(:eval
    (format "address@hidden:%s"
           (or (file-remote-p default-directory 'user) user-login-name)
           (or (file-remote-p default-directory 'host) system-name)
           (file-name-nondirectory (or (buffer-file-name) default-directory)))))

Works wonders! I am on Emacs 23.1. ;)

However because of all the different machines and different usernames, I rely on my ~/.ssh/config to specify the username on the remote machine. So I open a remote file like this,

`/ssh:remote-host-alias:/path/to/file'

Probably that is why the frame title shows up as,

address@hidden:file'

But I think I can live with that. Thanks a lot Michael. :)


Best regards, Michael.

--
Suvayu

Open source is the future. It sets us free.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]