[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hostname and filename as frame title
From: |
Michael Albinus |
Subject: |
Re: hostname and filename as frame title |
Date: |
Fri, 12 Feb 2010 10:35:14 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux) |
Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> Hi everyone,
Hi,
>
> 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 file@remote-host.
>
> I don't even know where to start looking, any pointers would be awesome. :)
What about this:
(setq-default
frame-title-format
'(:eval
(format "%s@%s:%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)))))
It needs Emacs 23.1, due to the parameters of file-remote-p.
Best regards, Michael.