]> code.delx.au - gnu-emacs/blobdiff - lisp/eshell/esh-var.el
Auto-commit of generated files.
[gnu-emacs] / lisp / eshell / esh-var.el
index 4c42b305ec2bf632580c5a1881fe069ba6599dd9..06858c5b9865615a970c293b9f74bfc2a816c0b6 100644 (file)
@@ -1,6 +1,6 @@
 ;;; esh-var.el --- handling of variables
 
-;; Copyright (C) 1999-201 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2013 Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 
 
 (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 "<no arguments>")
-   (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