[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 (
> ) 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) ":"))
           (directory-file-name (expand-file-name default-directory))) 

It is not exactly what you have asked for, but computing host name and
domain name would require calling remote processes.

Best regards, Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]