[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to prefix tramp buffers with method prefix?
From: |
Michael Albinus |
Subject: |
Re: How to prefix tramp buffers with method prefix? |
Date: |
Fri, 26 Sep 2008 16:12:11 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
Tassilo Horn <address@hidden> writes:
> Hi,
Hi,
> I'd like to have tramp buffers prefixed with the current method. For
> example if I open /ets/hosts with the sudo method, the buffer should be
> named "sudo:hosts" instead of only "hosts" so that I can easily use the
> usual buffer completion to distinguish between normal and tramp buffers.
>
> How can I achieve that?
(add-hook 'find-file-hook
'(lambda ()
(when (file-remote-p (buffer-file-name))
(rename-buffer
(format "%s:%s"
(file-remote-p (buffer-file-name) 'method)
(buffer-name))
'unique))))
> Thanks in advance,
> Tassilo
Best regards, Michael.