Mercurial > emacs
annotate lisp/eshell/em-banner.el @ 68199:5012e59a73c7
* mh-comp.el (mh-pgp-support-flag): Move here from mh-utils.el; needed
to help remove dependency on mh-utils.
* mh-exec.el: New file. Move process support routines here from
mh-utils.el.
* mh-init.el (mh-utils): Remove require.
(mh-exec): Add require.
(mh-profile-component, mh-profile-component-value): Move here from
mh-utils.el.
* mh-utils.el (mh-pgp-support-flag): Move to mh-comp.el to reduce
dependencies on mh-utils.el.
(mh-profile-component, mh-profile-component-value): Move to mh-init.el
since that's the only place that uses them. (Other than mh-alias.el;
I'm thinking that mh-find-path can set variable from the Aliasfile
component like it does the other components).
(mh-index-max-cmdline-args, mh-xargs, mh-quote-for-shell)
(mh-exec-cmd, mh-exec-cmd-error, mh-exec-cmd-daemon)
(mh-exec-cmd-env-daemon, mh-process-daemon, mh-exec-cmd-quiet)
(defvar, mh-exec-cmd-output)
(mh-exchange-point-and-mark-preserving-active-mark)
(mh-exec-lib-cmd-output, mh-handle-process-error): Move to new file
mh-exec.el so that mh-init.el doesn't have to depend on mh-utils.el,
breaking circular dependency.
* mh-alias.el: mh-customize.el: mh-e.el: mh-funcs.el: mh-gnus.el:
* mh-identity.el: mh-inc.el: mh-junk.el: mh-mime.el: mh-print.el:
* mh-search.el: mh-seq.el: mh-speed.el: Added debugging statements
(commented out) around requires to help find dependency loops. Will
remove them when issues are resolved.
author | Bill Wohler <wohler@newt.com> |
---|---|
date | Sun, 15 Jan 2006 08:17:56 +0000 |
parents | 34bd8e434dd7 |
children | 067115a6e738 edf295560b5a |
rev | line source |
---|---|
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
32526
diff
changeset
|
1 ;;; em-banner.el --- sample module that displays a login banner |
29876 | 2 |
64701
34bd8e434dd7
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
3 ;; Copyright (C) 1999, 2000, 2002, 2003, 2004, |
34bd8e434dd7
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
4 ;; 2005 Free Software Foundation, Inc. |
29876 | 5 |
32526 | 6 ;; Author: John Wiegley <johnw@gnu.org> |
7 | |
29876 | 8 ;; This file is part of GNU Emacs. |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
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 | |
64085 | 22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
23 ;; Boston, MA 02110-1301, USA. | |
29876 | 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" | |
54566
b73ba8cc2d91
* eshell/em-banner.el (eshell-banner):
Juri Linkov <juri@jurta.org>
parents:
52401
diff
changeset
|
34 ;; :link '(info-link "(eshell)Login banner") |
29876 | 35 :group 'eshell-module) |
36 | |
37 ;;; Commentary: | |
38 | |
39 ;; There is nothing to be done or configured in order to use this | |
40 ;; module, other than to select it by customizing the variable | |
41 ;; `eshell-modules-list'. It will then display a version information | |
42 ;; message whenever Eshell is loaded. | |
43 ;; | |
44 ;; This code is only an example of a how to write a well-formed | |
45 ;; extension module for Eshell. The better way to display login text | |
46 ;; is to use the `eshell-script' module, and to echo the desired | |
47 ;; strings from the user's `eshell-login-script' file. | |
48 ;; | |
49 ;; There is one configuration variable, which demonstrates how to | |
50 ;; properly define a customization variable in an extension module. | |
51 ;; In this case, it allows the user to change the string which | |
52 ;; displays at login time. | |
53 | |
54 ;;; User Variables: | |
55 | |
56 (defcustom eshell-banner-message "Welcome to the Emacs shell\n\n" | |
57 "*The banner message to be displayed when Eshell is loaded. | |
58 This can be any sexp, and should end with at least two newlines." | |
59 :type 'sexp | |
60 :group 'eshell-banner) | |
61 | |
62 (put 'eshell-banner-message 'risky-local-variable t) | |
63 | |
64 ;;; Code: | |
65 | |
66 (require 'esh-util) | |
67 | |
68 (defcustom eshell-banner-load-hook '(eshell-banner-initialize) | |
69 "*A list of functions to run when `eshell-banner' is loaded." | |
70 :type 'hook | |
71 :group 'eshell-banner) | |
72 | |
73 (defun eshell-banner-initialize () | |
74 "Output a welcome banner on initialization." | |
75 ;; it's important to use `eshell-interactive-print' rather than | |
76 ;; `insert', because `insert' doesn't know how to interact with the | |
77 ;; I/O code used by Eshell | |
78 (unless eshell-non-interactive-p | |
79 (assert eshell-mode) | |
80 (assert eshell-banner-message) | |
81 (let ((msg (eval eshell-banner-message))) | |
82 (assert msg) | |
83 (eshell-interactive-print msg)))) | |
84 | |
85 (eshell-deftest banner banner-displayed | |
86 "Startup banner is displayed at point-min" | |
87 (assert eshell-banner-message) | |
88 (let ((msg (eval eshell-banner-message))) | |
89 (assert msg) | |
90 (goto-char (point-min)) | |
91 (looking-at msg))) | |
92 | |
52401 | 93 ;;; arch-tag: e738b4ef-8671-42ae-a757-291779b92491 |
29876 | 94 ;;; em-banner.el ends here |