• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/eshell/

Lines Matching defs:variable

33 variable value, a subcommand, or even the result of a Lisp form."
39 ;; These are the possible variable interpolation syntaxes. Also keep
46 ;; Interval the value of an environment variable, or a Lisp variable
50 ;; "-" is a legal part of a variable name.
54 ;; Only "MYVAR" is part of the variable name in this case.
64 ;; is identical to just saying (lisp); but with the variable expansion
93 ;; if it doesn't have the form of a number, or a plain variable name
146 (defcustom eshell-variable-name-regexp "[A-Za-z0-9_-]+"
147 "*A regexp identifying what constitutes a variable name reference.
154 (defcustom eshell-variable-aliases-list
182 "*This list provides aliasing for variable references.
185 command, and the Lisp value to return for that variable if it is
200 (put 'eshell-variable-aliases-list 'risky-local-variable t)
205 "Initialize the variable handle code."
207 ;; changing a variable will affect all of Emacs.
209 (set (make-local-variable 'process-environment)
214 (set (make-local-variable 'eshell-special-chars-inside-quoting)
216 (set (make-local-variable 'eshell-special-chars-outside-quoting)
219 (add-hook 'eshell-parse-argument-hook 'eshell-interpolate-variable t t)
226 'eshell-complete-variable-reference nil t)
228 'eshell-complete-variable-assignment nil t)))
232 ;; strip off any null commands, which can only happen if a variable
245 ;; local variable settings (such as 'CFLAGS=-O2 make') are handled
270 (defun eshell-interpolate-variable ()
271 "Parse a variable interpolation.
277 (eshell-parse-variable))))
282 (setq eshell-variable-aliases-list
283 (delq (assoc var-alias eshell-variable-aliases-list)
284 eshell-variable-aliases-list))
285 (let ((def (assoc var-alias eshell-variable-aliases-list))
292 (setq eshell-variable-aliases-list
293 (delq (assoc var-alias eshell-variable-aliases-list)
294 eshell-variable-aliases-list)))
295 (setq eshell-variable-aliases-list
297 eshell-variable-aliases-list))))
317 "Unset an environment variable."
359 (list (read-envvar-name "Name of environment variable: " t)))
363 "Return a list of currently visible environment variable names."
371 This involves setting any variable aliases which affect the
372 environment, as specified in `eshell-variable-aliases-list'."
374 (eshell-for var-alias eshell-variable-aliases-list
378 (or (eshell-get-variable (car var-alias)) "")))))
381 (defun eshell-parse-variable ()
382 "Parse the next variable reference at point.
383 The variable name could refer to either an environment variable, or a
384 Lisp variable. The priority order depends on the setting of
387 Its purpose is to call `eshell-parse-variable-ref', and then to
388 process any indices that come after the variable reference."
392 (setq value (eshell-parse-variable-ref)
404 (defun eshell-parse-variable-ref ()
405 "Eval a variable reference.
407 variable.
411 NAME an environment or Lisp variable value
413 {COMMAND} result of command is variable's value
414 (LISP-FORM) result of Lisp form is variable's value"
433 (list 'eshell-get-variable (eval name) 'indices))))
466 eshell-variable-aliases-list)
468 (list 'eshell-get-variable
470 ((looking-at eshell-variable-name-regexp)
472 (list 'eshell-get-variable (match-string 0) 'indices)
475 (error "Invalid variable reference")))))
515 (defun eshell-get-variable (name &optional indices)
516 "Get the value for the variable NAME."
517 (let* ((alias (assoc name eshell-variable-aliases-list))
535 (error "Unknown variable `%s'" (eshell-stringify var))))
554 '/etc/passwd', the variable reference would look like:
563 (concat "^" eshell-variable-name-regexp "$")
572 (error "Invalid array variable index: %s"
609 (defun eshell-complete-variable-reference ()
610 "If there is a variable reference, complete it."
614 (concat "\\$\\(" eshell-variable-name-regexp
623 (eshell-for alias eshell-variable-aliases-list
631 (let ((value (eshell-get-variable varname)))
642 (defun eshell-complete-variable-assignment ()
643 "If there is a variable assignment, allow completion of entries."
645 (when (string-match (concat "\\`" eshell-variable-name-regexp "=") arg)