;ELC ;;; Compiled ;;; in Emacs version 27.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\210\300\307!\210\300\310!\210\300\311!\210\312\313\314\315\316\317\320\321&\210\322\323\324\325\326DD\327\330\331\332\333&\210\322\334\324\325\335DD\336\332\337%\210\322\340\324\325\341DD\342\332\337%\210\322\343\324\325\344DD\345\332\337%\210\322\346\324\325\347DD\350\332\351%\210\322\352\324\325\353DD\354\332\355%\210\356\352\357\360#\207" [require esh-util esh-cmd esh-opt esh-module esh-arg esh-io pcomplete env ring custom-declare-group eshell-var nil "Variable interpolation is introduced whenever the `$' character\nappears unquoted in any argument (except when that argument is\nsurrounded by single quotes). It may be used to interpolate a\nvariable value, a subcommand, or even the result of a Lisp form." :tag "Variable handling" :group eshell custom-declare-variable eshell-var-load-hook funcall function #[0 "\300\207" [nil] 1] "A list of functions to call when loading `eshell-var'." :version "24.1" :type hook eshell-prefer-lisp-variables #[0 "\300\207" [nil] 1] "If non-nil, prefer Lisp variables to environment variables." boolean eshell-complete-export-definition #[0 "\300\207" [t] 1] "If non-nil, completing names for `export' shows current definition." eshell-modify-global-environment #[0 "\300\207" [nil] 1] "If non-nil, using `export' changes Emacs's global environment." eshell-variable-name-regexp #[0 "\300\207" [#1="[A-Za-z0-9_-]+"] 1 #1#] "A regexp identifying what constitutes a variable name reference.\nNote that this only applies for `$NAME'. If the syntax `$' is\nused, then NAME can contain any character, including angle brackets,\nif they are quoted with a backslash." regexp eshell-variable-aliases-list #[0 "\300\301\302BB\303\304\305BB\306\307D\310\311\312\313\314D\315\316D\317\320D\321\322D\323\324D\325\326D\327\330D\331\332D\333\334D\335\336D\257\207" ["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)"]] 17] "This list provides aliasing for variable references.\nIt is very similar in concept to what `eshell-user-aliases-list' does\nfor commands. Each member of this defines the name of a command,\nand the Lisp value to return for that variable if it is accessed\nvia the syntax `$NAME'.\n\nIf the value is a function, that function will be called with two\narguments: the list of the indices that was used in the reference, and\nwhether the user is requesting the length of the ultimate element.\nFor example, a reference of `$NAME[10][20]' would result in the\nfunction for alias `NAME' being called (assuming it were aliased to a\nfunction), and the arguments passed to this function would be the list\n'(10 20)', and nil." (repeat (list string sexp (choice (const :tag "Copy to environment" t) (const :tag "Use only in Eshell" nil)))) put risky-local-variable t] 8) #@38 Initialize the variable handle code. (defalias 'eshell-var-initialize #[0 "\204 \306\301!\210\307\310 \"\311\n\312\313#\210\306\303!\210\314 \315\"\306\304!\210\314\f\316\"\317\320\321\322\211$\210\317\323\324\325\322$\210\326\211 >\262\205I\317\327\330\325\322$\210\317\327\331\325\322$\207" [eshell-modify-global-environment process-environment eshell-command-map eshell-special-chars-inside-quoting eshell-special-chars-outside-quoting eshell-modules-list make-local-variable mapcar concat define-key [(meta 118)] eshell-insert-envvar append (36) (36) add-hook eshell-parse-argument-hook eshell-interpolate-variable t eshell-prepare-command-hook eshell-handle-local-variables nil eshell-cmpl pcomplete-try-first-hook eshell-complete-variable-reference eshell-complete-variable-assignment] 5 (#$ . 4287)]) #@50 Allow for the syntax `VAR=val '. (defalias 'eshell-handle-local-variables #[0 "\204 \203 @ A\202\302\303! \205i\304\"\205i\305\306\307\310\311C\312C\304  \"\203Y\211\313\314\315 \"\314\316\f\"\314\316 \"G\317UFC\244\210\303@!\262A\262\202)\211A\262\320\321 DEC#D\"\207" [eshell-last-command-name eshell-last-arguments "\\`\\([A-Za-z_][A-Za-z0-9_]*\\)=\\(.*\\)\\'" eshell-stringify string-match throw eshell-replace-command eshell-as-subcommand append progn t setenv match-string 1 2 0 eshell-named-command quote] 16 (#$ . 5108)]) #@103 Parse a variable interpolation. This function is explicit for adding to `eshell-parse-argument-hook'. (defalias 'eshell-interpolate-variable #[0 "\300f\301=\205`TdU?\205\300u\210\302\303 D\207" [nil 36 eshell-escape-arg eshell-parse-variable] 2 (#$ . 5693)]) #@65 Define a VAR-ALIAS using DEFINITION. (fn VAR-ALIAS DEFINITION) (defalias 'eshell/define #[514 "\211\204\301\302\"\"\2026\302\"\303G\304U\203!@\202\"DD\2030\301\302\"\"\211B\266\305\207" [eshell-variable-aliases-list delq assoc quote 1 nil] 8 (#$ . 5962)]) #@86 This alias allows the `export' command to act as bash users expect. (fn &rest SETS) (defalias 'eshell/export #[128 "\211\205&\211@;\203\300\301@\"\203\302\303\304@\"\303\305@\"\"\210\211A\262\202\207" [string-match "^\\([^=]+\\)=\\(.*\\)" setenv match-string 1 2] 6 (#$ . 6249)]) #@44 Completion function for Eshell's `export'. (defalias 'pcomplete/eshell-mode/export #[0 "\300\301\302\211\211$\205\f\202\207" [pcomplete--here #[0 "\203 \207\302 \207" [eshell-complete-export-definition process-environment eshell-envvar-names] 1] nil] 5 (#$ . 6547)]) #@49 Unset an environment variable. (fn &rest ARGS) (defalias 'eshell/unset #[128 "\211\205\211@;\203\300@\301\302#\210\211A\262\202\207" [setenv nil t] 5 (#$ . 6826)]) #@43 Completion function for Eshell's `unset'. (defalias 'pcomplete/eshell-mode/unset #[0 "\300\301\302\211\211$\205\f\202\207" [pcomplete--here #[0 "\300 \207" [eshell-envvar-names] 1] nil] 5 (#$ . 7005)]) #@51 Allow command-ish use of `setq'. (fn &rest ARGS) (defalias 'eshell/setq #[128 "\300\203\301@!A@L\262AA\262\266\202\211\207" [nil intern] 6 (#$ . 7216)]) #@42 Completion function for Eshell's `setq'. (defalias 'pcomplete/eshell-mode/setq #[0 "\300\301\302\211\211$\205\300\303\302\211\211$\205\202\207" [pcomplete--here #[0 "\302 \303#\207" [pcomplete-stub obarray all-completions boundp] 4] nil #[0 "\300\207" [nil] 1]] 5 (#$ . 7389)]) #@51 Implementation of `env' in Lisp. (fn &rest ARGS) (defalias 'eshell/env #[128 "\300 \210\301!\302\303\"\262\304\305\306#\211\307\310 \311\"\211\203)\211@\312\313\"\210A\266\202\202\210\314 \207" [eshell-init-print-buffer flatten-tree mapcar eshell-stringify eshell--do-opts "env" ((104 "help" nil nil "show this usage screen") :external "env" :usage "") sort eshell-environment-variables string-lessp eshell-buffered-print "\n" eshell-flush] 9 (#$ . 7680)]) #@72 Insert ENVVAR-NAME into the current buffer at point. (fn ENVVAR-NAME) (defalias 'eshell-insert-envvar #[257 "\300\301\"\207" [insert-and-inherit "$"] 4 (#$ . 8167) (byte-code "\300\301\302\"C\207" [read-envvar-name "Name of environment variable: " t] 3)]) #@92 Return a list of currently visible environment variable names. (fn &optional ENVIRONMENT) (defalias 'eshell-envvar-names #[256 "\301\302\206\"\207" [process-environment mapcar #[257 "\300\301\302\303\"#\207" [substring 0 string-match "="] 7 "\n\n(fn X)"]] 4 (#$ . 8431)]) #@169 Return a `process-environment', fully updated. This involves setting any variable aliases which affect the environment, as specified in `eshell-variable-aliases-list'. (defalias 'eshell-environment-variables #[0 "\302\303\" \211\203(\211@\3048\203!\305@\306\307@!\206\310!\"\210A\266\202\202\210)\207" [process-environment eshell-variable-aliases-list mapcar concat 2 setenv eshell-stringify eshell-get-variable ""] 7 (#$ . 8717)]) #@333 Parse the next variable reference at point. The variable name could refer to either an environment variable, or a Lisp variable. The priority order depends on the setting of `eshell-prefer-lisp-variables'. Its purpose is to call `eshell-parse-variable-ref', and then to process any indices that come after the variable reference. (defalias 'eshell-parse-variable #[0 "\300f\301=\205 \300u\210\302\300\211\303 \262m?\205\300f\304=\205\305 \262\306\307\310DDCE\262\2036\311D\2027\207" [nil 35 t eshell-parse-variable-ref 91 eshell-parse-indices let indices quote length] 7 (#$ . 9169)]) #@349 Eval a variable reference. Returns a Lisp form which, if evaluated, will return the value of the variable. Possible options are: NAME an environment or Lisp variable value disambiguates the length of the name {COMMAND} result of command is variable's value (LISP-FORM) result of Lisp form is variable's value (defalias 'eshell-parse-variable-ref #[0 "\303f\304=\203'\305\304\306\"\211\204\307\310\304\"\202&\311\312\313\314`TB!DDDTb\210\207\303f\315>\203H\303f\316=\203:\317 \202<\320 \211\205G\321\322!\323BB\207\303f\324=\203\224\305\324\325\"\211\204^\307\310\324\"\202\223\326!`T{\327Q\330\331\332\333BBDC\334\313\314!D\335\336\337\340\341\342\303\343 DEDDED\344DFETb\210\266\202\207\303f\345=\203\260\3461\252\312\347\344\350p!DDD0\207\210\307\310\345\"\207\351\352\303f! \"\203\307\303u\210\321\352`Sf!\353BB\207\354\n!\203\331\321\355\356!\357BB\356\225b\210\207\360\361!\207" [temporary-file-directory eshell-variable-aliases-list eshell-variable-name-regexp nil 123 eshell-find-delimiter 125 throw eshell-incomplete eshell-convert eshell-command-to-value eshell-as-subcommand eshell-parse-command (39 34) 39 eshell-parse-literal-quote eshell-parse-double-quote eshell-get-variable eval (indices) 60 62 make-temp-file " > " let eshell-current-handles eshell-create-handles ('overwrite) progn ignore nconc eshell-this-command-hook list function lambda delete-file quote 40 (end-of-file) eshell-lisp-command read assoc char-to-string (indices) looking-at match-string 0 (indices) error "Invalid variable reference"] 16 (#$ . 9778)]) #@45 Parse and return a list of list of indices. (defalias 'eshell-parse-indices #[0 "\301\301f\302=\203.\303\302\304\"\211\204\305\306\302\"\210\202*\301u\210\301\307`\"B\262)\211Tb\210\210\202\211\237\207" [eshell-glob-function nil 91 eshell-find-delimiter 93 throw eshell-incomplete eshell-parse-arguments] 5 (#$ . 11389)]) #@67 Get the value for the variable NAME. (fn NAME &optional INDICES) (defalias 'eshell-get-variable #[513 "\303\"\211\203\211A@\202\203\304!\203\211!\202a\305;\203O\306!\211\203G\307!\203G \204B\211\n>\204B\310!\204G\211J\202J\310!\262\202_9\203YJ\202_\311\312\313!\"\"\207" [eshell-variable-aliases-list eshell-prefer-lisp-variables eshell--local-vars assoc functionp eshell-apply-indices intern-soft boundp getenv error "Unknown variable `%s'" eshell-stringify] 9 (#$ . 11727)]) #@747 Apply to VALUE all of the given INDICES, returning the sub-result. The format of INDICES is: ((INT-OR-NAME-OR-OTHER INT-OR-NAME INT-OR-NAME ...) ...) Each member of INDICES represents a level of nesting. If the first member of a sublist is not an integer or name, and the value it's reference is a string, that will be used as the regexp with which is to divide the string into sub-parts. The default is whitespace. Otherwise, each INT-OR-NAME refers to an element of the list value. Integers imply a direct index, and names, an associate lookup using `assoc'. For example, to retrieve the second element of a user's record in '/etc/passwd', the variable reference would look like: ${grep johnw /etc/passwd}[: 2] (fn VALUE INDICES) (defalias 'eshell-apply-indices #[514 "\211\203x\211@;\2033\301@@;\203(\302\303\304Q@@\"\204(@@\262A\262\305\306\307\"\"\262\210\211G\310W\203D\311\312\313!\"\210\202p\211G\314U\203U\315@\"\262\202p\316C\203k\211\315@\"C\244\210A\262\202W\211A\262\210\210\211A\262\202\207" [eshell-variable-name-regexp nil string-match "^" "$" mapcar eshell-convert split-string 0 error "Invalid array variable index: %s" eshell-stringify 1 eshell-index-value t] 9 (#$ . 12247)]) #@58 Reference VALUE using the given INDEX. (fn VALUE INDEX) (defalias 'eshell-index-value #[514 "\211;\203\300\301\302#\203\303!\262\211;\203\304\"A\207\305!\2034\211\306!V\203/\307\310!\207\311\"\207<\203H\211GV\203D\307\312!\207\2118\207\313!\203]\211GV\203Y\307\314!\207H\207\307\315!\207" [get-text-property 0 number string-to-number assoc ring-p ring-length error "Index exceeds length of ring" ring-ref "Index exceeds length of list" vectorp "Index exceeds length of vector" "Invalid data type for indexing"] 6 (#$ . 13499)]) #@48 If there is a variable reference, complete it. (defalias 'eshell-complete-variable-reference #[0 "\302\211\303\"`{\266\202\302\304\305\306Q\"\211\262\205#\307T\"\310\311\312 \"\207" [eshell-variable-name-regexp pcomplete-stub nil pcomplete-begin string-match "\\$\\(" "\\)?\\'" substring throw pcomplete-completions eshell-variables-list] 6 (#$ . 14062)]) #@40 Generate list of applicable variables. (defalias 'eshell-variables-list #[0 "\303 \211\203 \211@\304\305P@\"\203\211@B\262A\266\202\202\210\306\307\310\311\312\313 !\"\314\n\315##\316\"\207" [pcomplete-stub eshell-variable-aliases-list obarray nil string-match "^" sort append mapcar #[257 "\300!\211\203\211;\203\301!\203\302P\202\207" [eshell-get-variable file-directory-p "/"] 4 "\n\n(fn VARNAME)"] eshell-envvar-names eshell-environment-variables all-completions boundp string-lessp] 9 (#$ . 14433)]) #@65 If there is a variable assignment, allow completion of entries. (defalias 'eshell-complete-variable-assignment #[0 "\302\211\303\"`{\266\202\302\304\305\306Q\"\205.\307\225\262\304\310\"\203$\311\225\262\312\"\313\314\315 \"\207" [eshell-variable-name-regexp pcomplete-stub nil pcomplete-begin string-match "\\`" "=" 0 "\\(:\\)[^:]*\\'" 1 substring throw pcomplete-completions pcomplete-entries] 6 (#$ . 14969)]) (provide 'esh-var)