summaryrefslogtreecommitdiff
path: root/lisp/eshell/esh-var.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2000-08-29 00:47:45 +0000
committerJohn Wiegley <johnw@newartisans.com>2000-08-29 00:47:45 +0000
commitca7aae916bab6783c5133d8432b61d97b8ffa923 (patch)
tree1b36d8d391a6a0c166fd27a01acbc92a92020530 /lisp/eshell/esh-var.el
parentb4bd214e74d885552fe38051253dbc2b362bfe67 (diff)
downloademacs-ca7aae916bab6783c5133d8432b61d97b8ffa923.tar.gz
See ChangeLog
Diffstat (limited to 'lisp/eshell/esh-var.el')
-rw-r--r--lisp/eshell/esh-var.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index 133239703b6..34994630251 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -264,7 +264,7 @@ function), and the arguments passed to this function would be the list
"Parse a variable interpolation.
This function is explicit for adding to `eshell-parse-argument-hook'."
(when (and (eq (char-after) ?$)
- (not (= (1+ (point)) (point-max))))
+ (/= (1+ (point)) (point-max)))
(forward-char)
(list 'eshell-escape-arg
(eshell-parse-variable))))
@@ -293,11 +293,19 @@ This function is explicit for adding to `eshell-parse-argument-hook'."
(defun eshell/export (&rest sets)
"This alias allows the 'export' command to act as bash users expect."
(while sets
- (if (string-match "^\\([^=]+\\)=\\(.*\\)" (car sets))
+ (if (and (stringp (car sets))
+ (string-match "^\\([^=]+\\)=\\(.*\\)" (car sets)))
(setenv (match-string 1 (car sets))
(match-string 2 (car sets))))
(setq sets (cdr sets))))
+(defun eshell/unset (&rest args)
+ "Unset an environment variable."
+ (while args
+ (if (stringp (car args))
+ (setenv (car args) nil t))
+ (setq args (cdr args))))
+
(defun pcomplete/eshell-mode/export ()
"Completion function for Eshell's `export'."
(while (pcomplete-here