1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- (eval-when-compile
- (require 'cl)
- (require 'esh-mode)
- (require 'eshell))
- (require 'esh-util)
- (eshell-defgroup eshell-banner nil
- "This sample module displays a welcome banner at login.
- It exists so that others wishing to create their own Eshell extension
- modules may have a simple template to begin with."
- :tag "Login banner"
-
- :group 'eshell-module)
- (defcustom eshell-banner-message "Welcome to the Emacs shell\n\n"
- "The banner message to be displayed when Eshell is loaded.
- This can be any sexp, and should end with at least two newlines."
- :type 'sexp
- :group 'eshell-banner)
- (put 'eshell-banner-message 'risky-local-variable t)
- (defcustom eshell-banner-load-hook nil
- "A list of functions to run when `eshell-banner' is loaded."
- :version "24.1"
- :type 'hook
- :group 'eshell-banner)
- (defun eshell-banner-initialize ()
- "Output a welcome banner on initialization."
-
-
-
- (unless eshell-non-interactive-p
- (assert eshell-mode)
- (assert eshell-banner-message)
- (let ((msg (eval eshell-banner-message)))
- (assert msg)
- (eshell-interactive-print msg))))
- (provide 'em-banner)
|