unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Suvayu Ali <fatkasuvayu+linux@gmail.com>
Cc: Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: hostname and filename as frame title
Date: Fri, 12 Feb 2010 10:35:14 +0100	[thread overview]
Message-ID: <nqpr4an6el.fsf@alcatel-lucent.com> (raw)
In-Reply-To: <mailman.1118.1265964419.14305.help-gnu-emacs@gnu.org> (Suvayu Ali's message of "Fri, 12 Feb 2010 00:46:51 -0800")

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.




       reply	other threads:[~2010-02-12  9:35 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 ` Michael Albinus [this message]
2010-02-12 10:50   ` hostname and filename as frame title Suvayu Ali
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=nqpr4an6el.fsf@alcatel-lucent.com \
    --to=michael.albinus@gmx.de \
    --cc=fatkasuvayu+linux@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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).