Variable: eshell-variable-aliases-list

eshell-variable-aliases-list is a customizable variable defined in esh-var.el.gz.

Value

Large value
(("COLUMNS"
  #[257 "\300 \207"
	[window-width]
	2 "\n\n(fn INDICES)"]
  t)
 ("LINES"
  #[257 "\300 \207"
	[window-height]
	2 "\n\n(fn INDICES)"]
  t)
 ("_"
  #[257 "\211\204	�\301!@\207\302\"\207"
	[eshell-last-arguments last eshell-apply-indices]
	4 "\n\n(fn INDICES)"])
 ("?" eshell-last-command-status)
 ("$" eshell-last-command-result)
 ("0" eshell-command-name)
 ("1"
  #[257 "@\207"
	[eshell-command-arguments]
	2 "\n\n(fn INDICES)"])
 ("2"
  #[257 "A@\207"
	[eshell-command-arguments]
	2 "\n\n(fn INDICES)"])
 ("3"
  #[257 "\3018\207"
	[eshell-command-arguments 2]
	3 "\n\n(fn INDICES)"])
 ("4"
  #[257 "\3018\207"
	[eshell-command-arguments 3]
	3 "\n\n(fn INDICES)"])
 ("5"
  #[257 "\3018\207"
	[eshell-command-arguments 4]
	3 "\n\n(fn INDICES)"])
 ("6"
  #[257 "\3018\207"
	[eshell-command-arguments 5]
	3 "\n\n(fn INDICES)"])
 ("7"
  #[257 "\3018\207"
	[eshell-command-arguments 6]
	3 "\n\n(fn INDICES)"])
 ("8"
  #[257 "\3018\207"
	[eshell-command-arguments 7]
	3 "\n\n(fn INDICES)"])
 ("9"
  #[257 "\3018\207"
	[eshell-command-arguments 8]
	3 "\n\n(fn INDICES)"])
 ("*"
  #[257 "\211\204�\207\301\"\207"
	[eshell-command-arguments eshell-apply-indices]
	4 "\n\n(fn INDICES)"]))

Documentation

This list provides aliasing for variable references.

Each member defines the name of a variable, and a Lisp value used to compute the string value that will be returned when the variable is accessed via the syntax $NAME.

If the value is a function, call that function with two arguments: the list of the indices that was used in the reference, and whether the user is requesting the length of the ultimate element. For example, a reference of $NAME[10][20] would result in the function for alias NAME being called (assuming it were aliased to a function), and the arguments passed to this function would be the list '(10 20)', and nil.

If the value is a string, return the value for the variable with that name in the current environment. If no variable with that name exists in the environment, but if a symbol with that same name exists and has a value bound to it, return its value instead. You can prioritize symbol values over environment values by setting eshell-prefer-lisp-variables to t.

If the value is a symbol, return the value bound to it.

If the value has any other type, signal an error.

Additionally, each member may specify if it should be copied to the environment of created subprocesses.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/esh-var.el.gz
(defcustom eshell-variable-aliases-list
  `(;; for eshell.el
    ("COLUMNS" ,(lambda (_indices) (window-width)) t)
    ("LINES" ,(lambda (_indices) (window-height)) t)

    ;; for eshell-cmd.el
    ("_" ,(lambda (indices)
	    (if (not indices)
                (car (last eshell-last-arguments))
	      (eshell-apply-indices eshell-last-arguments
				    indices))))
    ("?" eshell-last-command-status)
    ("$" eshell-last-command-result)
    ("0" eshell-command-name)
    ("1" ,(lambda (_indices) (nth 0 eshell-command-arguments)))
    ("2" ,(lambda (_indices) (nth 1 eshell-command-arguments)))
    ("3" ,(lambda (_indices) (nth 2 eshell-command-arguments)))
    ("4" ,(lambda (_indices) (nth 3 eshell-command-arguments)))
    ("5" ,(lambda (_indices) (nth 4 eshell-command-arguments)))
    ("6" ,(lambda (_indices) (nth 5 eshell-command-arguments)))
    ("7" ,(lambda (_indices) (nth 6 eshell-command-arguments)))
    ("8" ,(lambda (_indices) (nth 7 eshell-command-arguments)))
    ("9" ,(lambda (_indices) (nth 8 eshell-command-arguments)))
    ("*" ,(lambda (indices)
	    (if (not indices)
                eshell-command-arguments
	      (eshell-apply-indices eshell-command-arguments
				    indices)))))
  "This list provides aliasing for variable references.
Each member defines the name of a variable, and a Lisp value used to
compute the string value that will be returned when the variable is
accessed via the syntax `$NAME'.

If the value is a function, call that function with two arguments: the
list of the indices that was used in the reference, and whether the
user is requesting the length of the ultimate element.  For example, a
reference of `$NAME[10][20]' would result in the function for alias
`NAME' being called (assuming it were aliased to a function), and the
arguments passed to this function would be the list '(10 20)', and
nil.

If the value is a string, return the value for the variable with that
name in the current environment.  If no variable with that name exists
in the environment, but if a symbol with that same name exists and has
a value bound to it, return its value instead.  You can prioritize
symbol values over environment values by setting
`eshell-prefer-lisp-variables' to t.

If the value is a symbol, return the value bound to it.

If the value has any other type, signal an error.

Additionally, each member may specify if it should be copied to the
environment of created subprocesses."
  :type '(repeat (list string sexp
		       (choice (const :tag "Copy to environment" t)
			       (const :tag "Use only in Eshell" nil)))))