Function: shell-match-partial-variable
shell-match-partial-variable is a byte-compiled function defined in
shell.el.gz.
Signature
(shell-match-partial-variable)
Documentation
Return the shell variable at point, or nil if none is found.
Source Code
;; Defined in /usr/src/emacs/lisp/shell.el.gz
(defun shell-match-partial-variable ()
"Return the shell variable at point, or nil if none is found."
(save-excursion
(if (re-search-backward "[^A-Za-z0-9_{(]" nil 'move)
(or (looking-at "\\$") (forward-char 1)))
(if (or (eolp) (looking-at "[^A-Za-z0-9_{($]"))
nil
(looking-at "\\$?[{(]?[A-Za-z0-9_]*[})]?")
(buffer-substring (match-beginning 0) (match-end 0)))))