- ((eq (char-after) ?\<)
- (let ((end (eshell-find-delimiter ?\< ?\>)))
- (if (not end)
- (throw 'eshell-incomplete ?\<)
- (let* ((temp (make-temp-file temporary-file-directory))
- (cmd (concat (buffer-substring (1+ (point)) end)
- " > " temp)))
- (prog1
- (list
- 'let (list (list 'eshell-current-handles
- (list 'eshell-create-handles temp
- (list 'quote 'overwrite))))
- (list
- 'progn
- (list 'eshell-as-subcommand
- (eshell-parse-command cmd))
- (list 'ignore
- (list 'nconc 'eshell-this-command-hook
- (list 'list
- (list 'function
- (list 'lambda nil
- (list 'delete-file temp))))))
- (list 'quote temp)))
- (goto-char (1+ end)))))))
- ((eq (char-after) ?\()
- (condition-case err
- (list 'eshell-command-to-value
- (list 'eshell-lisp-command
- (list 'quote (read (current-buffer)))))
- (end-of-file
- (throw 'eshell-incomplete ?\())))
- ((assoc (char-to-string (char-after))
- eshell-variable-aliases-list)
- (forward-char)
- (list 'eshell-get-variable
- (char-to-string (char-before)) 'indices))
- ((looking-at eshell-variable-name-regexp)
- (prog1
- (list 'eshell-get-variable (match-string 0) 'indices)
- (goto-char (match-end 0))))
- (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"))
+ ((eq (char-after) ?\<)
+ (let ((end (eshell-find-delimiter ?\< ?\>)))
+ (if (not end)
+ (throw 'eshell-incomplete ?\<)
+ (let* ((temp (make-temp-file temporary-file-directory))
+ (cmd (concat (buffer-substring (1+ (point)) end)
+ " > " temp)))
+ (prog1
+ (list
+ 'let (list (list 'eshell-current-handles
+ (list 'eshell-create-handles temp
+ (list 'quote 'overwrite))))
+ (list
+ 'progn
+ (list 'eshell-as-subcommand
+ (eshell-parse-command cmd))
+ (list 'ignore
+ (list 'nconc 'eshell-this-command-hook
+ (list 'list
+ (list 'function
+ (list 'lambda nil
+ (list 'delete-file temp))))))
+ (list 'quote temp)))
+ (goto-char (1+ end)))))))
+ ((eq (char-after) ?\()
+ (condition-case nil
+ (list 'eshell-command-to-value
+ (list 'eshell-lisp-command
+ (list 'quote (read (current-buffer)))))
+ (end-of-file
+ (throw 'eshell-incomplete ?\())))
+ ((assoc (char-to-string (char-after))
+ eshell-variable-aliases-list)
+ (forward-char)
+ (list 'eshell-get-variable
+ (char-to-string (char-before)) 'indices))
+ ((looking-at eshell-variable-name-regexp)
+ (prog1
+ (list 'eshell-get-variable (match-string 0) 'indices)
+ (goto-char (match-end 0))))
+ (t
+ (error "Invalid variable reference"))))