From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: hostname and filename as frame title
Date: Fri, 12 Feb 2010 02:50:41 -0800 [thread overview]
Message-ID: <4B753281.7050004@gmail.com> (raw)
In-Reply-To: <nqpr4an6el.fsf@alcatel-lucent.com>
Hi Michael,
On Friday 12 February 2010 01:35 AM, Michael Albinus wrote:
> Suvayu Ali<fatkasuvayu+linux@gmail.com> 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 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)))))
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,
`local-user@remote-host: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.
next prev parent reply other threads:[~2010-02-12 10:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.1118.1265964419.14305.help-gnu-emacs@gnu.org>
2010-02-12 9:35 ` hostname and filename as frame title Michael Albinus
2010-02-12 10:50 ` Suvayu Ali [this message]
2010-02-12 11:58 ` Michael Albinus
2010-02-12 17:17 ` Suvayu Ali
2010-02-14 21:01 ` Suvayu Ali
2010-02-12 8:46 Suvayu Ali
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B753281.7050004@gmail.com \
--to=fatkasuvayu+linux@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=michael.albinus@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).