Function: eshell-unload-all-modules

eshell-unload-all-modules is a byte-compiled function defined in eshell.el.gz.

Signature

(eshell-unload-all-modules)

Documentation

Unload all modules that were loaded by Eshell, if possible.

If the user has require'd in any of the modules, or customized a variable with a :require tag (such as eshell-prefer-to-shell), it will be impossible to unload Eshell completely without restarting Emacs.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/eshell.el.gz
;;; Code:

(defun eshell-unload-all-modules ()
  "Unload all modules that were loaded by Eshell, if possible.
If the user has require'd in any of the modules, or customized a
variable with a :require tag (such as `eshell-prefer-to-shell'), it
will be impossible to unload Eshell completely without restarting
Emacs."
  ;; if the user set `eshell-prefer-to-shell' to t, but never loaded
  ;; Eshell, then `eshell-subgroups' will be unbound
  (when (fboundp 'eshell-subgroups)
    (dolist (module (eshell-subgroups 'eshell))
      ;; this really only unloads as many modules as possible,
      ;; since other `require' references (such as by customizing
      ;; `eshell-prefer-to-shell' to a non-nil value) might make it
      ;; impossible to unload Eshell completely
      (if (featurep module)
	  (ignore-errors
	    (message "Unloading %s..." (symbol-name module))
	    (unload-feature module)
	    (message "Unloading %s...done" (symbol-name module)))))
    (message "Unloading eshell...done")))