comparison lisp/eshell/em-banner.el @ 87063:fbd20b5beb80

Require individual files if needed when compiling, rather than esh-maint. Collect any require statements. Move provide statement to end. Move any commentary to start.
author Glenn Morris <rgm@gnu.org>
date Wed, 05 Dec 2007 06:59:48 +0000
parents a1e8300d3c55
children 107ccd98fa12 53108e6cea98
comparison
equal deleted inserted replaced
87062:dc33075c168e 87063:fbd20b5beb80
20 ;; You should have received a copy of the GNU General Public License 20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the 21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA. 23 ;; Boston, MA 02110-1301, USA.
24 24
25 (provide 'em-banner)
26
27 (eval-when-compile (require 'esh-maint))
28
29 (defgroup eshell-banner nil
30 "This sample module displays a welcome banner at login.
31 It exists so that others wishing to create their own Eshell extension
32 modules may have a simple template to begin with."
33 :tag "Login banner"
34 ;; :link '(info-link "(eshell)Login banner")
35 :group 'eshell-module)
36
37 ;;; Commentary: 25 ;;; Commentary:
38 26
39 ;; There is nothing to be done or configured in order to use this 27 ;; There is nothing to be done or configured in order to use this
40 ;; module, other than to select it by customizing the variable 28 ;; module, other than to select it by customizing the variable
41 ;; `eshell-modules-list'. It will then display a version information 29 ;; `eshell-modules-list'. It will then display a version information
49 ;; There is one configuration variable, which demonstrates how to 37 ;; There is one configuration variable, which demonstrates how to
50 ;; properly define a customization variable in an extension module. 38 ;; properly define a customization variable in an extension module.
51 ;; In this case, it allows the user to change the string which 39 ;; In this case, it allows the user to change the string which
52 ;; displays at login time. 40 ;; displays at login time.
53 41
42 ;;; Code:
43
44 (eval-when-compile
45 (require 'cl)
46 (require 'esh-mode)
47 (require 'eshell))
48
49 (require 'esh-util)
50
51 (defgroup eshell-banner nil
52 "This sample module displays a welcome banner at login.
53 It exists so that others wishing to create their own Eshell extension
54 modules may have a simple template to begin with."
55 :tag "Login banner"
56 ;; :link '(info-link "(eshell)Login banner")
57 :group 'eshell-module)
58
54 ;;; User Variables: 59 ;;; User Variables:
55 60
56 (defcustom eshell-banner-message "Welcome to the Emacs shell\n\n" 61 (defcustom eshell-banner-message "Welcome to the Emacs shell\n\n"
57 "*The banner message to be displayed when Eshell is loaded. 62 "*The banner message to be displayed when Eshell is loaded.
58 This can be any sexp, and should end with at least two newlines." 63 This can be any sexp, and should end with at least two newlines."
59 :type 'sexp 64 :type 'sexp
60 :group 'eshell-banner) 65 :group 'eshell-banner)
61 66
62 (put 'eshell-banner-message 'risky-local-variable t) 67 (put 'eshell-banner-message 'risky-local-variable t)
63
64 ;;; Code:
65
66 (require 'esh-util)
67 68
68 (defcustom eshell-banner-load-hook '(eshell-banner-initialize) 69 (defcustom eshell-banner-load-hook '(eshell-banner-initialize)
69 "*A list of functions to run when `eshell-banner' is loaded." 70 "*A list of functions to run when `eshell-banner' is loaded."
70 :type 'hook 71 :type 'hook
71 :group 'eshell-banner) 72 :group 'eshell-banner)
88 (let ((msg (eval eshell-banner-message))) 89 (let ((msg (eval eshell-banner-message)))
89 (assert msg) 90 (assert msg)
90 (goto-char (point-min)) 91 (goto-char (point-min))
91 (looking-at msg))) 92 (looking-at msg)))
92 93
94 (provide 'em-banner)
95
93 ;;; arch-tag: e738b4ef-8671-42ae-a757-291779b92491 96 ;;; arch-tag: e738b4ef-8671-42ae-a757-291779b92491
94 ;;; em-banner.el ends here 97 ;;; em-banner.el ends here