Function: eshell-script-initialize

eshell-script-initialize is a byte-compiled function defined in em-script.el.gz.

Signature

(eshell-script-initialize)

Documentation

Initialize the script parsing code.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/em-script.el.gz
;;; Functions:

(defun eshell-script-initialize ()  ;Called from `eshell-mode' via intern-soft!
  "Initialize the script parsing code."
  (setq-local eshell-interpreter-alist
              (cons (cons (lambda (file _args)
                            (and (file-regular-p file)
                                 (string= (file-name-nondirectory file)
                                          "eshell")))
                          'eshell/source)
                    eshell-interpreter-alist))
  (setq-local eshell-complex-commands
	(append '("source" ".") eshell-complex-commands))
  ;; these two variables are changed through usage, but we don't want
  ;; to ruin it for other modules
  (let (eshell-inside-quote-regexp
	eshell-outside-quote-regexp)
    (and (not (bound-and-true-p eshell-non-interactive-p))
	 eshell-login-script
	 (file-readable-p eshell-login-script)
	 (eshell-do-eval
	  `(eshell-commands ,(eshell--source-file eshell-login-script))
          t))
    (and eshell-rc-script
	 (file-readable-p eshell-rc-script)
	 (eshell-do-eval
	  `(eshell-commands ,(eshell--source-file eshell-rc-script))
          t))))