X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/2b0c7330457b8ca42375c92ada7dc7cefb0fa9fb..0d1f53adb0f0a614c102fb5c2b5212ace4b4078b:/lisp/eshell/esh-var.el diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 4c42b305ec..06858c5b98 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -1,6 +1,6 @@ ;;; esh-var.el --- handling of variables -;; Copyright (C) 1999-2011 Free Software Foundation, Inc. +;; Copyright (C) 1999-2013 Free Software Foundation, Inc. ;; Author: John Wiegley @@ -109,10 +109,9 @@ (eval-when-compile (require 'pcomplete) - (require 'esh-test) (require 'esh-util) - (require 'esh-opt) (require 'esh-mode)) +(require 'esh-opt) (require 'env) (require 'ring) @@ -126,8 +125,9 @@ variable value, a subcommand, or even the result of a Lisp form." ;;; User Variables: -(defcustom eshell-var-load-hook '(eshell-var-initialize) +(defcustom eshell-var-load-hook nil "A list of functions to call when loading `eshell-var'." + :version "24.1" ; removed eshell-var-initialize :type 'hook :group 'eshell-var) @@ -344,15 +344,14 @@ This function is explicit for adding to `eshell-parse-argument-hook'." (pcomplete-here)))) (defun eshell/env (&rest args) - "Implemention of `env' in Lisp." + "Implementation of `env' in Lisp." (eshell-init-print-buffer) (eshell-eval-using-options "env" args '((?h "help" nil nil "show this usage screen") :external "env" :usage "") - (eshell-for setting (sort (eshell-environment-variables) - 'string-lessp) + (dolist (setting (sort (eshell-environment-variables) 'string-lessp)) (eshell-buffered-print setting "\n")) (eshell-flush))) @@ -374,7 +373,7 @@ This function is explicit for adding to `eshell-parse-argument-hook'." This involves setting any variable aliases which affect the environment, as specified in `eshell-variable-aliases-list'." (let ((process-environment (eshell-copy-environment))) - (eshell-for var-alias eshell-variable-aliases-list + (dolist (var-alias eshell-variable-aliases-list) (if (nth 2 var-alias) (setenv (car var-alias) (eshell-stringify @@ -477,30 +476,6 @@ Possible options are: (t (error "Invalid variable reference"))))) -(eshell-deftest var interp-cmd - "Interpolate command result" - (eshell-command-result-p "+ ${+ 1 2} 3" "6\n")) - -(eshell-deftest var interp-lisp - "Interpolate Lisp form evalution" - (eshell-command-result-p "+ $(+ 1 2) 3" "6\n")) - -(eshell-deftest var interp-concat - "Interpolate and concat command" - (eshell-command-result-p "+ ${+ 1 2}3 3" "36\n")) - -(eshell-deftest var interp-concat-lisp - "Interpolate and concat Lisp form" - (eshell-command-result-p "+ $(+ 1 2)3 3" "36\n")) - -(eshell-deftest var interp-concat2 - "Interpolate and concat two commands" - (eshell-command-result-p "+ ${+ 1 2}${+ 1 2} 3" "36\n")) - -(eshell-deftest var interp-concat-lisp2 - "Interpolate and concat two Lisp forms" - (eshell-command-result-p "+ $(+ 1 2)$(+ 1 2) 3" "36\n")) - (defun eshell-parse-indices () "Parse and return a list of list of indices." (let (indices) @@ -623,7 +598,7 @@ For example, to retrieve the second element of a user's record in "Generate list of applicable variables." (let ((argname pcomplete-stub) completions) - (eshell-for alias eshell-variable-aliases-list + (dolist (alias eshell-variable-aliases-list) (if (string-match (concat "^" argname) (car alias)) (setq completions (cons (car alias) completions)))) (sort