(sh-shell-variables-initialized): New variable.
(sh-mode): Make sh-shell-variables and sh-shell-variables-initialized local. (sh-set-shell): Don't scan the buffer for variable assignments. Set sh-shell-variables-initialized to nil. (sh-shell-initialize-variables): New function. (sh-add-completer): New function. Initialize sh-shell-variables here if not yet done. (sh-add): Use sh-add-completer for completion.
Showing with 52 additions and 11 deletions