diff options
Diffstat (limited to 'lisp/eshell')
| -rw-r--r-- | lisp/eshell/esh-cmd.el | 6 | ||||
| -rw-r--r-- | lisp/eshell/esh-var.el | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index cc4fdd15bda..75e0e1d27c8 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el | |||
| @@ -473,6 +473,8 @@ the second is ignored." | |||
| 473 | arg)) | 473 | arg)) |
| 474 | 474 | ||
| 475 | (defvar eshell-last-command-status) ;Define in esh-io.el. | 475 | (defvar eshell-last-command-status) ;Define in esh-io.el. |
| 476 | (defvar eshell--local-vars nil | ||
| 477 | "List of locally bound vars that should take precedence over env-vars.") | ||
| 476 | 478 | ||
| 477 | (defun eshell-rewrite-for-command (terms) | 479 | (defun eshell-rewrite-for-command (terms) |
| 478 | "Rewrite a `for' command into its equivalent Eshell command form. | 480 | "Rewrite a `for' command into its equivalent Eshell command form. |
| @@ -495,7 +497,9 @@ implemented via rewriting, rather than as a function." | |||
| 495 | (eshell-command-body '(nil)) | 497 | (eshell-command-body '(nil)) |
| 496 | (eshell-test-body '(nil))) | 498 | (eshell-test-body '(nil))) |
| 497 | (while (car for-items) | 499 | (while (car for-items) |
| 498 | (let ((,(intern (cadr terms)) (car for-items))) | 500 | (let ((,(intern (cadr terms)) (car for-items)) |
| 501 | (eshell--local-vars (cons ',(intern (cadr terms)) | ||
| 502 | eshell--local-vars))) | ||
| 499 | (eshell-protect | 503 | (eshell-protect |
| 500 | ,(eshell-invokify-arg body t))) | 504 | ,(eshell-invokify-arg body t))) |
| 501 | (setcar for-items (cadr for-items)) | 505 | (setcar for-items (cadr for-items)) |
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 8dd19618da2..3121dadace2 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el | |||
| @@ -502,6 +502,7 @@ Possible options are: | |||
| 502 | (let ((sym (intern-soft var))) | 502 | (let ((sym (intern-soft var))) |
| 503 | (if (and sym (boundp sym) | 503 | (if (and sym (boundp sym) |
| 504 | (or eshell-prefer-lisp-variables | 504 | (or eshell-prefer-lisp-variables |
| 505 | (memq sym eshell--local-vars) ; bug#15372 | ||
| 505 | (not (getenv var)))) | 506 | (not (getenv var)))) |
| 506 | (symbol-value sym) | 507 | (symbol-value sym) |
| 507 | (getenv var)))) | 508 | (getenv var)))) |