Function: shell-dynamic-complete-environment-variable
shell-dynamic-complete-environment-variable is an interactive and
byte-compiled function defined in shell.el.gz.
Signature
(shell-dynamic-complete-environment-variable)
Documentation
Dynamically complete the environment variable at point.
Completes if after a variable, i.e., if it starts with a "$".
This function is similar to comint-dynamic-complete-filename, except that it
searches process-environment for completion candidates. Note that this may
not be the same as the interpreter's idea of variable names. The main problem
with this type of completion is that process-environment is the environment
which Emacs started with. Emacs does not track changes to the environment made
by the interpreter. Perhaps it would be more accurate if this function was
called shell-dynamic-complete-process-environment-variable.
Returns non-nil if successful.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/shell.el.gz
(defun shell-dynamic-complete-environment-variable ()
"Dynamically complete the environment variable at point.
Completes if after a variable, i.e., if it starts with a \"$\".
This function is similar to `comint-dynamic-complete-filename', except that it
searches `process-environment' for completion candidates. Note that this may
not be the same as the interpreter's idea of variable names. The main problem
with this type of completion is that `process-environment' is the environment
which Emacs started with. Emacs does not track changes to the environment made
by the interpreter. Perhaps it would be more accurate if this function was
called `shell-dynamic-complete-process-environment-variable'.
Returns non-nil if successful."
(interactive)
(let ((data (shell-environment-variable-completion)))
(if data
(prog2 (unless (window-minibuffer-p)
(message "Completing variable name..."))
(completion-in-region (nth 0 data) (nth 1 data) (nth 2 data))))))