Function: eshell-cmd-initialize

eshell-cmd-initialize is a byte-compiled function defined in esh-cmd.el.gz.

Signature

(eshell-cmd-initialize)

Documentation

Initialize the Eshell command processing module.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/esh-cmd.el.gz
(defun eshell-cmd-initialize ()     ;Called from `eshell-mode' via intern-soft!
  "Initialize the Eshell command processing module."
  (setq-local eshell-current-command nil)
  (setq-local eshell-command-name nil)
  (setq-local eshell-command-arguments nil)
  (setq-local eshell-last-arguments nil)
  (setq-local eshell-last-command-name nil)
  (setq-local eshell-last-async-proc nil)

  (add-hook 'eshell-kill-hook #'eshell-resume-command nil t)

  ;; make sure that if a command is over, and no process is being
  ;; waited for, that `eshell-current-command' is set to nil.  This
  ;; situation can occur, for example, if a Lisp function results in
  ;; `debug' being called, and the user then types \\[top-level]
  (add-hook 'eshell-post-command-hook
            (lambda ()
              (setq eshell-current-command nil
                    eshell-last-async-proc nil))
            nil t)

  (add-hook 'eshell-parse-argument-hook
	    #'eshell-parse-subcommand-argument nil t)
  (add-hook 'eshell-parse-argument-hook
	    #'eshell-parse-lisp-argument nil t)

  (when (eshell-using-module 'eshell-cmpl)
    (add-hook 'pcomplete-try-first-hook
	      #'eshell-complete-lisp-symbols nil t)))