Mercurial > emacs
annotate lisp/eshell/em-banner.el @ 112281:697cfa263439
info-xref.el Version 3.
* lisp/info-xref.el (info-xref-check, info-xref-check-all): Move
commentary details into docstrings for better visibility.
Use compilation-mode for the results buffer.
(info-xref-output, info-xref-output-error, info-xref-with-output)
(info-xref-filename, info-xref-in-progress):
New internals for this.
(info-xref-check-list, info-xref-check-buffer)
(info-xref-check-all-custom): Use those.
(info-xref-output-buffer): Rename from info-xref-results-buffer.
(info-xref-output-heading): Rename from info-xref-filename-heading.
(info-xref-good, info-xref-bad, info-xref-xfile-alist)
(info-xref-filename-heading): Move to output managing section.
(info-xref-docstrings): New command checking "Info node `(foo)Bar'"
(info-xref-lock-file-p, info-xref-with-file): New helpers for it.
(info-xref-subfile-p): Move to generic section with those two.
(info-xref-check-node): New function split from
info-xref-check-buffer, shared by info-xref-docstrings.
(info-xref-goto-node-p): Move to a checking section with that func.
(info-xref-unavail): New counter.
(info-xref-check-node): Use it.
(info-xref-with-output): Show count of unavailables at end of output.
(info-xref-all-info-files): Exclude ".*" dotfiles. Ignore broken
symlinks. Exclude .texi files. Exclude Emacs backup files.
(info-xref-check-all-custom): Fix quietening viper-mode and
gnus-registry-install -- use setq not let so as not to unbind after load.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 15 Jan 2011 17:59:33 -0800 |
parents | ef719132ddfa |
children |
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 |
95152
ad5d26b1d5d1
Use eshell-defgroup rather than defgroup.
Glenn Morris <rgm@gnu.org>
parents:
94661
diff
changeset
|
3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
112218
376148b31b5e
Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
4 ;; 2008, 2009, 2010, 2011 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 | |
94661
b5b0801a7637
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
10 ;; GNU Emacs is free software: you can redistribute it and/or modify |
29876 | 11 ;; it under the terms of the GNU General Public License as published by |
94661
b5b0801a7637
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
12 ;; the Free Software Foundation, either version 3 of the License, or |
b5b0801a7637
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
13 ;; (at your option) any later version. |
29876 | 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 | |
94661
b5b0801a7637
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
29876 | 22 |
23 ;;; Commentary: | |
24 | |
25 ;; There is nothing to be done or configured in order to use this | |
26 ;; module, other than to select it by customizing the variable | |
27 ;; `eshell-modules-list'. It will then display a version information | |
28 ;; message whenever Eshell is loaded. | |
29 ;; | |
30 ;; This code is only an example of a how to write a well-formed | |
31 ;; extension module for Eshell. The better way to display login text | |
32 ;; is to use the `eshell-script' module, and to echo the desired | |
33 ;; strings from the user's `eshell-login-script' file. | |
34 ;; | |
35 ;; There is one configuration variable, which demonstrates how to | |
36 ;; properly define a customization variable in an extension module. | |
37 ;; In this case, it allows the user to change the string which | |
38 ;; displays at login time. | |
39 | |
87063
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
40 ;;; Code: |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
41 |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
42 (eval-when-compile |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
43 (require 'cl) |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
44 (require 'esh-mode) |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
45 (require 'eshell)) |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
46 |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
47 (require 'esh-util) |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
48 |
95152
ad5d26b1d5d1
Use eshell-defgroup rather than defgroup.
Glenn Morris <rgm@gnu.org>
parents:
94661
diff
changeset
|
49 ;;;###autoload |
ad5d26b1d5d1
Use eshell-defgroup rather than defgroup.
Glenn Morris <rgm@gnu.org>
parents:
94661
diff
changeset
|
50 (eshell-defgroup eshell-banner nil |
87063
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
51 "This sample module displays a welcome banner at login. |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
52 It exists so that others wishing to create their own Eshell extension |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
53 modules may have a simple template to begin with." |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
54 :tag "Login banner" |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
55 ;; :link '(info-link "(eshell)Login banner") |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
56 :group 'eshell-module) |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
57 |
29876 | 58 ;;; User Variables: |
59 | |
60 (defcustom eshell-banner-message "Welcome to the Emacs shell\n\n" | |
110580
f57f72bb4757
Cosmetic doc fixes for eshell.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
61 "The banner message to be displayed when Eshell is loaded. |
29876 | 62 This can be any sexp, and should end with at least two newlines." |
63 :type 'sexp | |
64 :group 'eshell-banner) | |
65 | |
66 (put 'eshell-banner-message 'risky-local-variable t) | |
67 | |
68 (defcustom eshell-banner-load-hook '(eshell-banner-initialize) | |
110580
f57f72bb4757
Cosmetic doc fixes for eshell.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
69 "A list of functions to run when `eshell-banner' is loaded." |
29876 | 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 | |
87063
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
93 (provide 'em-banner) |
fbd20b5beb80
Require individual files if needed when compiling, rather than
Glenn Morris <rgm@gnu.org>
parents:
78220
diff
changeset
|
94 |
95152
ad5d26b1d5d1
Use eshell-defgroup rather than defgroup.
Glenn Morris <rgm@gnu.org>
parents:
94661
diff
changeset
|
95 ;; Local Variables: |
ad5d26b1d5d1
Use eshell-defgroup rather than defgroup.
Glenn Morris <rgm@gnu.org>
parents:
94661
diff
changeset
|
96 ;; generated-autoload-file: "esh-groups.el" |
ad5d26b1d5d1
Use eshell-defgroup rather than defgroup.
Glenn Morris <rgm@gnu.org>
parents:
94661
diff
changeset
|
97 ;; End: |
ad5d26b1d5d1
Use eshell-defgroup rather than defgroup.
Glenn Morris <rgm@gnu.org>
parents:
94661
diff
changeset
|
98 |
29876 | 99 ;;; em-banner.el ends here |