[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: modifying shell buffer names with TRAMP data
From: |
Michael Albinus |
Subject: |
Re: modifying shell buffer names with TRAMP data |
Date: |
Sat, 10 Jul 2010 11:08:29 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Terrence Brannon <address@hidden> writes:
> I have been using TRAMP with shell-current-directory (
> http://github.com/metaperl/emacs/blob/master/shell-current-directory.el ) to
> open shells on remote machines successfully.
>
> I would like to modify the directory-shell-buffer-name function:
>
> (defun directory-shell-buffer-name ()
>
> so that it includes the hostname and domain name of the machine the shell is
> being created on.
I would do
(defun directory-shell-buffer-name ()
"The name of a shell buffer pertaining to DIR."
(concat "*"
(if (file-remote-p default-directory)
(concat (file-remote-p default-directory 'user) "@"
(file-remote-p default-directory 'host) ":"))
(file-name-nondirectory
(directory-file-name (expand-file-name default-directory)))
"-shell*"))
It is not exactly what you have asked for, but computing host name and
domain name would require calling remote processes.
Best regards, Michael.