[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tramp + eshell

From: Daniel Kraus
Subject: Re: Tramp + eshell
Date: Fri, 29 Oct 2021 15:06:48 +0200


Michael Albinus <> writes:

> (defun eshell/lcd (&optional directory)
>   "Like regular 'cd' but don't jump out of a tramp directory.
> When on a remote directory with tramp don't jump 'out' of the server.
> So if we're connected with sudo to 'remotehost'
> '$ lcd /etc' would go to '/sudo:remotehost:/etc' instead of just
> '/etc' on localhost."
>   (setq directory (or directory "~/"))
>   (unless (file-remote-p directory)
>     (setq directory (concat (file-remote-p default-directory) directory)))
>   (eshell/cd directory))
> In general, I argue against using Tramp internal functions. Their API is
> not guranteed to be kept. For example, tramp-make-tramp-file-name has
> changed its argument list in Tramp 2.4.0 (Emacs 27.1), the old argument
> list (which you use) is kept for backward compatibility. When Tramp
> throws compatibility for Emacs 26, this backward compatibility might be
> skipped.

Good info. I updated my config and will keep it in mind.
Thanks :)


reply via email to

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