all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jürgen Hötzel" <juergen@archlinux.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: make eshell-path-env buffer-local
Date: Tue, 8 Jan 2013 15:53:34 +0100	[thread overview]
Message-ID: <CANmXxHNvE9igOw7pMX+8SO+pkTgi0oLPmmp69a140eqsR1WOZw@mail.gmail.com> (raw)
In-Reply-To: <87fw2bg3b5.fsf@gmx.de>

[-- Attachment #1: Type: text/plain, Size: 513 bytes --]

Hi Michael,

On Tue, Jan 8, 2013 at 3:25 PM, Michael Albinus <michael.albinus@gmx.de> wrote:
> Jürgen Hötzel <juergen@archlinux.org> writes:
>
>> Hi,
>
> Hi Juergen,
>
>> this is required when running multiple Eshell buffers on different
>> Hosts: To prevent garbling the different PATHs.
.....
> Wouldn't it be more consistent to declare `eshell-path-env' buffer-local
> in esh-util.el?

Actually there is no need to track/update eshell-path-env on the
localhost (see patch enclosed).

Jürgen

[-- Attachment #2: 0001-make-eshell-path-env-buffer-local-on-remote-hosts.patch --]
[-- Type: application/octet-stream, Size: 1266 bytes --]

From 91ec798810403937ef3994134b84a72a7dd919bf Mon Sep 17 00:00:00 2001
From: Juergen Hoetzel <juergen@archlinux.org>
Date: Tue, 8 Jan 2013 15:45:46 +0100
Subject: [PATCH] make eshell-path-env buffer-local on remote hosts

Don't update eshell-path-env on local host.
---
 lisp/tramp.el | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/lisp/tramp.el b/lisp/tramp.el
index f8db03e..31c6ea7 100644
--- a/lisp/tramp.el
+++ b/lisp/tramp.el
@@ -3896,14 +3896,13 @@ Only works for Bourne-like shells."
 ;; when `default-directory' points to another host.
 (defun tramp-eshell-directory-change ()
   "Set `eshell-path-env' to $PATH of the host related to `default-directory'."
-  (setq eshell-path-env
-	(if (file-remote-p default-directory)
-	    (with-parsed-tramp-file-name default-directory nil
-	      (mapconcat
-	       'identity
-	       (tramp-get-connection-property v "remote-path" nil)
-	       ":"))
-	  (getenv "PATH"))))
+  (when (file-remote-p default-directory)
+    (set (make-local-variable 'eshell-path-env)
+	 (with-parsed-tramp-file-name default-directory nil
+	   (mapconcat
+	    'identity
+	    (tramp-get-connection-property v "remote-path" nil)
+	    ":")))))
 
 (eval-after-load "esh-util"
   '(progn
-- 
1.8.1


  reply	other threads:[~2013-01-08 14:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-08 14:07 make eshell-path-env buffer-local Jürgen Hötzel
2013-01-08 14:25 ` Michael Albinus
2013-01-08 14:53   ` Jürgen Hötzel [this message]
2013-01-08 15:11     ` Michael Albinus
2013-01-08 17:19       ` Jürgen Hötzel
2013-01-17 10:05         ` Michael Albinus

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANmXxHNvE9igOw7pMX+8SO+pkTgi0oLPmmp69a140eqsR1WOZw@mail.gmail.com \
    --to=juergen@archlinux.org \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.