unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* make eshell-path-env buffer-local
@ 2013-01-08 14:07 Jürgen Hötzel
  2013-01-08 14:25 ` Michael Albinus
  0 siblings, 1 reply; 6+ messages in thread
From: Jürgen Hötzel @ 2013-01-08 14:07 UTC (permalink / raw)
  To: emacs-devel

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

Hi,

this is required when running multiple Eshell buffers on different
Hosts: To prevent garbling the different PATHs.

Any objections against this commit?

Jürgen

[-- Attachment #2: 0001-set-eshell-path-env-buffer-local.patch --]
[-- Type: application/octet-stream, Size: 1236 bytes --]

From 58f16a811c6f0ed9afa12fe7cedbfe76681bc169 Mon Sep 17 00:00:00 2001
From: Juergen Hoetzel <juergen@archlinux.org>
Date: Tue, 8 Jan 2013 13:29:48 +0100
Subject: [PATCH] set eshell-path-env buffer-local

---
 lisp/tramp.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/tramp.el b/lisp/tramp.el
index f8db03e..e333ad0 100644
--- a/lisp/tramp.el
+++ b/lisp/tramp.el
@@ -3896,14 +3896,14 @@ 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"))))
+  (set (make-local-variable '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"))))
 
 (eval-after-load "esh-util"
   '(progn
-- 
1.8.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: make eshell-path-env buffer-local
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Albinus @ 2013-01-08 14:25 UTC (permalink / raw)
  To: Jürgen Hötzel; +Cc: emacs-devel

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.
>
> Any objections against this commit?
>
>  lisp/tramp.el | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/lisp/tramp.el b/lisp/tramp.el
> index f8db03e..e333ad0 100644
> --- a/lisp/tramp.el
> +++ b/lisp/tramp.el
> @@ -3896,14 +3896,14 @@ 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"))))
> +  (set (make-local-variable '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"))))
>  
>  (eval-after-load "esh-util"
>    '(progn

Wouldn't it be more consistent to declare `eshell-path-env' buffer-local
in esh-util.el?

[Sorry to react late; I haven't seen the proposed patch before]

> Jürgen

Best regards, Michael.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: make eshell-path-env buffer-local
  2013-01-08 14:25 ` Michael Albinus
@ 2013-01-08 14:53   ` Jürgen Hötzel
  2013-01-08 15:11     ` Michael Albinus
  0 siblings, 1 reply; 6+ messages in thread
From: Jürgen Hötzel @ 2013-01-08 14:53 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-devel

[-- 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: make eshell-path-env buffer-local
  2013-01-08 14:53   ` Jürgen Hötzel
@ 2013-01-08 15:11     ` Michael Albinus
  2013-01-08 17:19       ` Jürgen Hötzel
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Albinus @ 2013-01-08 15:11 UTC (permalink / raw)
  To: Jürgen Hötzel; +Cc: emacs-devel

Jürgen Hötzel <juergen@archlinux.org> writes:

> Hi Michael,

Hi Juergen,

>> 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).

Yes, but the eshell buffer's default-directory can switch between local
and remote randomly:

cd /
cd /adb::

So it might be more consistent to make that variable buffer-local anyway.
Hopefully, it doesn't hurt :-)

> Jürgen

Best regards, Michael.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: make eshell-path-env buffer-local
  2013-01-08 15:11     ` Michael Albinus
@ 2013-01-08 17:19       ` Jürgen Hötzel
  2013-01-17 10:05         ` Michael Albinus
  0 siblings, 1 reply; 6+ messages in thread
From: Jürgen Hötzel @ 2013-01-08 17:19 UTC (permalink / raw)
  To: Michael Albinus; +Cc: johnw, emacs-devel

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

Hi Michael,

On Tue, Jan 8, 2013 at 4:11 PM, Michael Albinus <michael.albinus@gmx.de> wrote:
> Jürgen Hötzel <juergen@archlinux.org> writes:
>
>> Hi Michael,
>
> Hi Juergen,
>
>>> Wouldn't it be more consistent to declare `eshell-path-env' buffer-local
>>> in esh-util.el?
> Yes, but the eshell buffer's default-directory can switch between local
> and remote randomly:
>
> cd /
> cd /adb::

Good point!

Regards, Jürgen

[-- Attachment #2: 0001-Make-eshell-path-env-become-buffer-local.patch --]
[-- Type: application/octet-stream, Size: 774 bytes --]

From ef191eefa6fbc3e16870c59e1d4ec1b491748698 Mon Sep 17 00:00:00 2001
From: Juergen Hoetzel <juergen@archlinux.org>
Date: Tue, 8 Jan 2013 18:13:38 +0100
Subject: [PATCH] Make `eshell-path-env' become buffer-local

---
 lisp/eshell/esh-util.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 2f49a21..f9b8621 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -229,6 +229,7 @@ If N or M is nil, it means the end of the list."
   "Content of $PATH.
 It might be different from \(getenv \"PATH\"\), when
 `default-directory' points to a remote host.")
+(make-variable-buffer-local 'eshell-path-env)
 
 (defun eshell-parse-colon-path (path-env)
   "Split string with `parse-colon-path'.
-- 
1.8.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: make eshell-path-env buffer-local
  2013-01-08 17:19       ` Jürgen Hötzel
@ 2013-01-17 10:05         ` Michael Albinus
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Albinus @ 2013-01-17 10:05 UTC (permalink / raw)
  To: Jürgen Hötzel; +Cc: johnw, emacs-devel

Jürgen Hötzel <juergen@archlinux.org> writes:

>>>> Wouldn't it be more consistent to declare `eshell-path-env' buffer-local
>>>> in esh-util.el?
>> Yes, but the eshell buffer's default-directory can switch between local
>> and remote randomly:
>>
>> cd /
>> cd /adb::
>
> Good point!

Since nobody has objected, I've committed the patch to the trunk.

> Regards, Jürgen

Best regards, Michael.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-01-17 10:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-01-08 15:11     ` Michael Albinus
2013-01-08 17:19       ` Jürgen Hötzel
2013-01-17 10:05         ` Michael Albinus

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).