annotate man/lispref/help.texi @ 272:c5d627a313b1 r21-0b34

Import from CVS: tag r21-0b34
author cvs
date Mon, 13 Aug 2007 10:28:48 +0200
parents c7528f8e288d
children a4f53d9b3154
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 @c -*-texinfo-*-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 @c This is part of the XEmacs Lisp Reference Manual.
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 @c See the file lispref.texi for copying conditions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 @setfilename ../../info/help.info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 @node Documentation, Files, Modes, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 @chapter Documentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 @cindex documentation strings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 XEmacs Lisp has convenient on-line help facilities, most of which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 derive their information from the documentation strings associated with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 functions and variables. This chapter describes how to write good
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 documentation strings for your Lisp programs, as well as how to write
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 programs to access documentation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 Note that the documentation strings for XEmacs are not the same thing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 as the XEmacs manual. Manuals have their own source files, written in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 the Texinfo language; documentation strings are specified in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 definitions of the functions and variables they apply to. A collection
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 of documentation strings is not sufficient as a manual because a good
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 manual is not organized in that fashion; it is organized in terms of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 topics of discussion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 * Documentation Basics:: Good style for doc strings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 Where to put them. How XEmacs stores them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 * Accessing Documentation:: How Lisp programs can access doc strings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 * Keys in Documentation:: Substituting current key bindings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 * Describing Characters:: Making printable descriptions of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 non-printing characters and key sequences.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 * Help Functions:: Subroutines used by XEmacs help facilities.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 * Obsoleteness:: Upgrading Lisp functionality over time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 @node Documentation Basics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 @section Documentation Basics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 @cindex documentation conventions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 @cindex writing a documentation string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 @cindex string, writing a doc string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 A documentation string is written using the Lisp syntax for strings,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 with double-quote characters surrounding the text of the string. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 is because it really is a Lisp string object. The string serves as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 documentation when it is written in the proper place in the definition
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 of a function or variable. In a function definition, the documentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 string follows the argument list. In a variable definition, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 documentation string follows the initial value of the variable.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 When you write a documentation string, make the first line a complete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 sentence (or two complete sentences) since some commands, such as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 @code{apropos}, show only the first line of a multi-line documentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 string. Also, you should not indent the second line of a documentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 string, if you have one, because that looks odd when you use @kbd{C-h f}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (@code{describe-function}) or @kbd{C-h v} (@code{describe-variable}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 @xref{Documentation Tips}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 Documentation strings may contain several special substrings, which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 stand for key bindings to be looked up in the current keymaps when the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 documentation is displayed. This allows documentation strings to refer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 to the keys for related commands and be accurate even when a user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 rearranges the key bindings. (@xref{Accessing Documentation}.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 Within the Lisp world, a documentation string is accessible through
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 the function or variable that it describes:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 The documentation for a function is stored in the function definition
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 itself (@pxref{Lambda Expressions}). The function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 @code{documentation} knows how to extract it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 @kindex variable-documentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 The documentation for a variable is stored in the variable's property
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 list under the property name @code{variable-documentation}. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 function @code{documentation-property} knows how to extract it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 @cindex @file{DOC} (documentation) file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 To save space, the documentation for preloaded functions and variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (including primitive functions and autoloaded functions) is stored in
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
82 the @dfn{internal doc file} @file{DOC}. The documentation for functions
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
83 and variables loaded during the XEmacs session from byte-compiled files
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
84 is stored in those very same byte-compiled files (@pxref{Docs and
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
85 Compilation}).
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 XEmacs does not keep documentation strings in memory unless necessary.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 Instead, XEmacs maintains, for preloaded symbols, an integer offset into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 the internal doc file, and for symbols loaded from byte-compiled files,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 a list containing the filename of the byte-compiled file and an integer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 offset, in place of the documentation string. The functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 @code{documentation} and @code{documentation-property} use that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 information to read the documentation from the appropriate file; this is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 transparent to the user.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 For information on the uses of documentation strings, see @ref{Help, ,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 Help, emacs, The XEmacs Reference Manual}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 @c Wordy to prevent overfull hbox. --rjc 15mar92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 The @file{emacs/lib-src} directory contains two utilities that you can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 use to print nice-looking hardcopy for the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 @file{emacs/etc/DOC-@var{version}}. These are @file{sorted-doc.c} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 @file{digest-doc.c}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 @node Accessing Documentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 @section Access to Documentation Strings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 @defun documentation-property symbol property &optional verbatim
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 This function returns the documentation string that is recorded in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 @var{symbol}'s property list under property @var{property}. It
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 retrieves the text from a file if necessary, and runs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 @code{substitute-command-keys} to substitute actual key bindings. (This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 substitution is not done if @var{verbatim} is non-@code{nil}; the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 @var{verbatim} argument exists only as of Emacs 19.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 @smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (documentation-property 'command-line-processed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 'variable-documentation)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 @result{} "t once command line has been processed"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (symbol-plist 'command-line-processed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 @result{} (variable-documentation 188902)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 @end smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 @defun documentation function &optional verbatim
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 This function returns the documentation string of @var{function}. It
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 reads the text from a file if necessary. Then (unless @var{verbatim} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 non-@code{nil}) it calls @code{substitute-command-keys}, to return a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 value containing the actual (current) key bindings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 The function @code{documentation} signals a @code{void-function} error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 if @var{function} has no function definition. However, it is ok if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 the function definition has no documentation string. In that case,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 @code{documentation} returns @code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 @c Wordy to prevent overfull hboxes. --rjc 15mar92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 Here is an example of using the two functions, @code{documentation} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 @code{documentation-property}, to display the documentation strings for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 several symbols in a @samp{*Help*} buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 @smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (defun describe-symbols (pattern)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 "Describe the XEmacs Lisp symbols matching PATTERN.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 All symbols that have PATTERN in their name are described
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 in the `*Help*' buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (interactive "sDescribe symbols matching: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (let ((describe-func
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
154 (function
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (lambda (s)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ;; @r{Print description of symbol.}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (if (fboundp s) ; @r{It is a function.}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (princ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (format "%s\t%s\n%s\n\n" s
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
162 (if (commandp s)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (let ((keys (where-is-internal s)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (if keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 "Keys: "
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
167 (mapconcat 'key-description
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 keys " "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 "Keys: none"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 "Function")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 @group
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
173 (or (documentation s)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 "not documented"))))
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
175
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (if (boundp s) ; @r{It is a variable.}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (princ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (format "%s\t%s\n%s\n\n" s
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
181 (if (user-variable-p s)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 "Option " "Variable")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 @group
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
185 (or (documentation-property
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 s 'variable-documentation)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 "not documented")))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 sym-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 ;; @r{Build a list of symbols that match pattern.}
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
193 (mapatoms (function
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (lambda (sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (if (string-match pattern (symbol-name sym))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (setq sym-list (cons sym sym-list))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 ;; @r{Display the data.}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (with-output-to-temp-buffer "*Help*"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (mapcar describe-func (sort sym-list 'string<))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (print-help-return-message))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 @end smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 The @code{describe-symbols} function works like @code{apropos},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 but provides more information.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 @smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (describe-symbols "goal")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 ---------- Buffer: *Help* ----------
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
215 goal-column Option
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 *Semipermanent goal column for vertical motion, as set by C-x C-n, or nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 @c Do not blithely break or fill these lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 @c That makes them incorrect.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 set-goal-column Command: C-x C-n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 Set the current horizontal position as a goal for C-n and C-p.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 @c DO NOT put a blank line here! That is factually inaccurate!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 Those commands will move to this position in the line moved to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 rather than trying to keep the same horizontal position.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 With a non-nil argument, clears out the goal column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 so that C-n and C-p resume vertical motion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 The goal column is stored in the variable `goal-column'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 temporary-goal-column Variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 Current goal column for vertical motion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 It is the column where point was
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 at the start of current run of vertical motion commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 When the `track-eol' feature is doing its job, the value is 9999.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 ---------- Buffer: *Help* ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 @end smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 @defun Snarf-documentation filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 This function is used only during XEmacs initialization, just before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 the runnable XEmacs is dumped. It finds the file offsets of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 documentation strings stored in the file @var{filename}, and records
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 them in the in-core function definitions and variable property lists in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 place of the actual strings. @xref{Building XEmacs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
251 XEmacs finds the file @var{filename} in the @file{lib-src} directory.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
252 When the dumped XEmacs is later executed, the same file is found in the
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
253 directory @code{doc-directory}. The usual value for @var{filename} is
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
254 @file{DOC}, but this can be changed by modifying the variable
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
255 @code{internal-doc-file-name}.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 @defvar internal-doc-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 This variable holds the name of the file containing documentation
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
260 strings of built-in symbols, usually @file{DOC}. The full pathname of
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
261 the internal doc file is @samp{(concat doc-directory internal-doc-file-name)}.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 @defvar doc-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 This variable holds the name of the directory which contains the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 @dfn{internal doc file} that contains documentation strings for built-in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 and preloaded functions and variables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 In most cases, this is the same as @code{exec-directory}. They may be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 different when you run XEmacs from the directory where you built it,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 without actually installing it. See @code{exec-directory} in @ref{Help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 Functions}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 In older Emacs versions, @code{exec-directory} was used for this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 @defvar data-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 This variable holds the name of the directory in which XEmacs finds
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 certain system independent documentation and text files that come
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 with XEmacs. In older Emacs versions, @code{exec-directory} was used for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 @node Keys in Documentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 @section Substituting Key Bindings in Documentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 @cindex documentation, keys in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 @cindex keys in documentation strings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 @cindex substituting keys in documentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 When documentation strings refer to key sequences, they should use the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 current, actual key bindings. They can do so using certain special text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 sequences described below. Accessing documentation strings in the usual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 way substitutes current key binding information for these special
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 sequences. This works by calling @code{substitute-command-keys}. You
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 can also call that function yourself.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 Here is a list of the special sequences and what they mean:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 @item \[@var{command}]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 stands for a key sequence that will invoke @var{command}, or @samp{M-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 @var{command}} if @var{command} has no key bindings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
304 @item \@{@var{mapvar}@}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 stands for a summary of the value of @var{mapvar}, which should be a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 keymap. The summary is made by @code{describe-bindings}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
308 @item \<@var{mapvar}>
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 stands for no text itself. It is used for a side effect: it specifies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 @var{mapvar} as the keymap for any following @samp{\[@var{command}]}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 sequences in this documentation string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 @item \=
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 quotes the following character and is discarded; this @samp{\=\=} puts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 @samp{\=} into the output, and @samp{\=\[} puts @samp{\[} into the output.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 @strong{Please note:} Each @samp{\} must be doubled when written in a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 string in XEmacs Lisp.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 @defun substitute-command-keys string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 This function scans @var{string} for the above special sequences and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 replaces them by what they stand for, returning the result as a string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 This permits display of documentation that refers accurately to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 user's own customized key bindings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 Here are examples of the special sequences:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 @smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 @group
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
332 (substitute-command-keys
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 "To abort recursive edit, type: \\[abort-recursive-edit]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 @result{} "To abort recursive edit, type: C-]"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 @group
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
338 (substitute-command-keys
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 "The keys that are defined for the minibuffer here are:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 \\@{minibuffer-local-must-match-map@}")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 @result{} "The keys that are defined for the minibuffer here are:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 ? minibuffer-completion-help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 SPC minibuffer-complete-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 TAB minibuffer-complete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 LFD minibuffer-complete-and-exit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 RET minibuffer-complete-and-exit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 C-g abort-recursive-edit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (substitute-command-keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 "To abort a recursive edit from the minibuffer, type\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 \\<minibuffer-local-must-match-map>\\[abort-recursive-edit].")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 @result{} "To abort a recursive edit from the minibuffer, type C-g."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (substitute-command-keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 "Substrings of the form \\=\\@{MAPVAR@} are replaced by summaries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 \(made by describe-bindings) of the value of MAPVAR, taken as a keymap.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 Substrings of the form \\=\\<MAPVAR> specify to use the value of MAPVAR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 as the keymap for future \\=\\[COMMAND] substrings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 \\=\\= quotes the following character and is discarded;
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
366 thus, \\=\\=\\=\\= puts \\=\\= into the output,
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 and \\=\\=\\=\\[ puts \\=\\[ into the output.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 @result{} "Substrings of the form \@{MAPVAR@} are replaced by summaries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (made by describe-bindings) of the value of MAPVAR, taken as a keymap.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 Substrings of the form \<MAPVAR> specify to use the value of MAPVAR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 as the keymap for future \[COMMAND] substrings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 \= quotes the following character and is discarded;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 thus, \=\= puts \= into the output,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 and \=\[ puts \[ into the output."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 @end smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 @node Describing Characters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 @section Describing Characters for Help Messages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 These functions convert events, key sequences or characters to textual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 descriptions. These descriptions are useful for including arbitrary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 text characters or key sequences in messages, because they convert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 non-printing and whitespace characters to sequences of printing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 characters. The description of a non-whitespace printing character is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 the character itself.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 @defun key-description sequence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 @cindex XEmacs event standard notation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 This function returns a string containing the XEmacs standard notation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 for the input events in @var{sequence}. The argument @var{sequence} may
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 be a string, vector or list. @xref{Events}, for more information about
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 valid events. See also the examples for @code{single-key-description},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 below.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 @defun single-key-description key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 @cindex event printing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 @cindex character printing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 @cindex control character printing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 @cindex meta character printing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 This function returns a string describing @var{key} in the standard
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 XEmacs notation for keyboard input. A normal printing character appears
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 as itself, but a control character turns into a string starting with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 @samp{C-}, a meta character turns into a string starting with @samp{M-},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 and space, linefeed, etc.@: appear as @samp{SPC}, @samp{LFD}, etc. A
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 symbol appears as the name of the symbol. An event that is a list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 appears as the name of the symbol in the @sc{car} of the list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 @smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (single-key-description ?\C-x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 @result{} "C-x"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (key-description "\C-x \M-y \n \t \r \f123")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 @result{} "C-x SPC M-y SPC LFD SPC TAB SPC RET SPC C-l 1 2 3"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 @group
54
05472e90ae02 Import from CVS: tag r19-16-pre2
cvs
parents: 52
diff changeset
420 (single-key-description 'kp_next)
05472e90ae02 Import from CVS: tag r19-16-pre2
cvs
parents: 52
diff changeset
421 @result{} "kp_next"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 (single-key-description '(shift button1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 @result{} "Sh-button1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 @end smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 @defun text-char-description character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 This function returns a string describing @var{character} in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 standard XEmacs notation for characters that appear in text---like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 @code{single-key-description}, except that control characters are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 represented with a leading caret (which is how control characters in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 XEmacs buffers are usually displayed).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 @smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (text-char-description ?\C-c)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 @result{} "^C"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 (text-char-description ?\M-m)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 @result{} "M-m"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (text-char-description ?\C-\M-m)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 @result{} "M-^M"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 @end smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 @node Help Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 @section Help Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 XEmacs provides a variety of on-line help functions, all accessible to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 the user as subcommands of the prefix @kbd{C-h}, or on some keyboards,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 @kbd{help}. For more information about them, see @ref{Help, , Help,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 emacs, The XEmacs Reference Manual}. Here we describe some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 program-level interfaces to the same information.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 @deffn Command apropos regexp &optional do-all predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 This function finds all symbols whose names contain a match for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 regular expression @var{regexp}, and returns a list of them
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (@pxref{Regular Expressions}). It also displays the symbols in a buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 named @samp{*Help*}, each with a one-line description.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 @c Emacs 19 feature
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 If @var{do-all} is non-@code{nil}, then @code{apropos} also shows
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 key bindings for the functions that are found.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 If @var{predicate} is non-@code{nil}, it should be a function to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 called on each symbol that has matched @var{regexp}. Only symbols for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 which @var{predicate} returns a non-@code{nil} value are listed or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 In the first of the following examples, @code{apropos} finds all the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 symbols with names containing @samp{exec}. In the second example, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 finds and returns only those symbols that are also commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (We don't show the output that results in the @samp{*Help*} buffer.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 @smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (apropos "exec")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 @result{} (Buffer-menu-execute command-execute exec-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 exec-path execute-extended-command execute-kbd-macro
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 executing-kbd-macro executing-macro)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (apropos "exec" nil 'commandp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 @result{} (Buffer-menu-execute execute-extended-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 @ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 ---------- Buffer: *Help* ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 Buffer-menu-execute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 Function: Save and/or delete buffers marked with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 M-x Buffer-menu-save or M-x Buffer-menu-delete commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 execute-extended-command ESC x
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
501 Function: Read function name, then read its
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 arguments and call it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 ---------- Buffer: *Help* ----------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 @end ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 @end smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 @code{apropos} is used by various user-level commands, such as @kbd{C-h
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 a} (@code{hyper-apropos}), a graphical front-end to @code{apropos}; and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 @kbd{C-h A} (@code{command-apropos}), which does an apropos over only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 those functions which are user commands. @code{command-apropos} calls
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 @code{apropos}, specifying a @var{predicate} to restrict the output to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 symbols that are commands. The call to @code{apropos} looks like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 @smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (apropos string t 'commandp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 @end smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 @end deffn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 @c Emacs 19 feature
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 @c super-apropos is obsolete - function absorbed by apropos --mrb
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 @ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 @deffn Command super-apropos regexp &optional do-all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 This function differs from @code{apropos} in that it searches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 documentation strings as well as symbol names for matches for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 @var{regexp}. By default, it searches the documentation strings only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 for preloaded functions and variables. If @var{do-all} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 non-@code{nil}, it scans the names and documentation strings of all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 functions and variables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 @end deffn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 @end ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 @defvar help-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 The value of this variable is a local keymap for characters following the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 Help key, @kbd{C-h}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 @deffn {Prefix Command} help-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 This symbol is not a function; its function definition is actually the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 keymap known as @code{help-map}. It is defined in @file{help.el} as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 follows:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 @smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (define-key global-map "\C-h" 'help-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (fset 'help-command help-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 @end smallexample
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 @end deffn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 @defun print-help-return-message &optional function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 This function builds a string that explains how to restore the previous
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 state of the windows after a help command. After building the message,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 it applies @var{function} to it if @var{function} is non-@code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 Otherwise it calls @code{message} to display it in the echo area.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 This function expects to be called inside a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 @code{with-output-to-temp-buffer} special form, and expects
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 @code{standard-output} to have the value bound by that special form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 For an example of its use, see the long example in @ref{Accessing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 Documentation}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 @defvar help-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 The value of this variable is the help character---the character that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 XEmacs recognizes as meaning Help. By default, it is the character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 @samp{?\^H} (ASCII 8), which is @kbd{C-h}. When XEmacs reads this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 character, if @code{help-form} is non-@code{nil} Lisp expression, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 evaluates that expression, and displays the result in a window if it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 a string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 @code{help-char} can be a character or a key description such as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 @code{help} or @code{(meta h)}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 Usually the value of @code{help-form}'s value is @code{nil}. Then the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 help character has no special meaning at the level of command input, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 it becomes part of a key sequence in the normal way. The standard key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 binding of @kbd{C-h} is a prefix key for several general-purpose help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 features.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 The help character is special after prefix keys, too. If it has no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 binding as a subcommand of the prefix key, it runs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 @code{describe-prefix-bindings}, which displays a list of all the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 subcommands of the prefix key.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 @defvar help-form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 If this variable is non-@code{nil}, its value is a form to evaluate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 whenever the character @code{help-char} is read. If evaluating the form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 produces a string, that string is displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 A command that calls @code{next-command-event} or @code{next-event}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 probably should bind @code{help-form} to a non-@code{nil} expression
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 while it does input. (The exception is when @kbd{C-h} is meaningful
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 input.) Evaluating this expression should result in a string that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 explains what the input is for and how to enter it properly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 Entry to the minibuffer binds this variable to the value of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 @code{minibuffer-help-form} (@pxref{Minibuffer Misc}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 @defvar prefix-help-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 This variable holds a function to print help for a prefix character.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 The function is called when the user types a prefix key followed by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 help character, and the help character has no binding after that prefix.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 The variable's default value is @code{describe-prefix-bindings}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 @end defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 @defun describe-prefix-bindings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 This function calls @code{describe-bindings} to display a list of all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 the subcommands of the prefix key of the most recent key sequence. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 prefix described consists of all but the last event of that key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 sequence. (The last event is, presumably, the help character.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 The following two functions are found in the library @file{helper}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 They are for modes that want to provide help without relinquishing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 control, such as the ``electric'' modes. You must load that library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 with @code{(require 'helper)} in order to use them. Their names begin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 with @samp{Helper} to distinguish them from the ordinary help functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 @deffn Command Helper-describe-bindings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 This command pops up a window displaying a help buffer containing a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 listing of all of the key bindings from both the local and global keymaps.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 It works by calling @code{describe-bindings}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 @end deffn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 @deffn Command Helper-help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 This command provides help for the current mode. It prompts the user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 in the minibuffer with the message @samp{Help (Type ? for further
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 options)}, and then provides assistance in finding out what the key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 bindings are, and what the mode is intended for. It returns @code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 This can be customized by changing the map @code{Helper-help-map}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 @end deffn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 @ignore @c Not in XEmacs currently
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 @c Emacs 19 feature
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 @defmac make-help-screen fname help-line help-text help-map
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 78
diff changeset
640 This macro defines a help command named @var{fname} that acts like a
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 prefix key that shows a list of the subcommands it offers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 When invoked, @var{fname} displays @var{help-text} in a window, then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 reads and executes a key sequence according to @var{help-map}. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 string @var{help-text} should describe the bindings available in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 @var{help-map}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 The command @var{fname} is defined to handle a few events itself, by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 scrolling the display of @var{help-text}. When @var{fname} reads one of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 those special events, it does the scrolling and then reads another
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 event. When it reads an event that is not one of those few, and which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 has a binding in @var{help-map}, it executes that key's binding and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 then returns.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 The argument @var{help-line} should be a single-line summary of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 alternatives in @var{help-map}. In the current version of Emacs, this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 argument is used only if you set the option @code{three-step-help} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 @code{t}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 @end defmac
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 @defopt three-step-help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 If this variable is non-@code{nil}, commands defined with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 @code{make-help-screen} display their @var{help-line} strings in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 echo area at first, and display the longer @var{help-text} strings only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 if the user types the help character again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 @end defopt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 @end ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 @node Obsoleteness
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 @section Obsoleteness
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 As you add functionality to a package, you may at times want to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 replace an older function with a new one. To preserve compatibility
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 with existing code, the older function needs to still exist; but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 users of that function should be told to use the newer one instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 XEmacs Lisp lets you mark a function or variable as @dfn{obsolete},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 and indicate what should be used instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 @defun make-obsolete function new
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 This function indicates that @var{function} is an obsolete function,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 and the function @var{new} should be used instead. The byte compiler
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 will issue a warning to this effect when it encounters a usage of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 older function, and the help system will also note this in the function's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 documentation. @var{new} can also be a string (if there is not a single
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 function with the same functionality any more), and should be a descriptive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 statement, such as "use @var{foo} or @var{bar} instead" or "this function is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 unnecessary".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 @defun make-obsolete-variable variable new
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 This is like @code{make-obsolete} but is for variables instead of functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 @defun define-obsolete-function-alias oldfun newfun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 This function combines @code{make-obsolete} and @code{define-function},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 declaring @var{oldfun} to be an obsolete variant of @var{newfun} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 defining @var{oldfun} as an alias for @var{newfun}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 @defun define-obsolete-variable-alias oldvar newvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 This is like @code{define-obsolete-function-alias} but for variables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 Note that you should not normally put obsoleteness information
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 explicitly in a function or variable's doc string. The obsoleteness
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 information that you specify using the above functions will be displayed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 whenever the doc string is displayed, and by adding it explicitly the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 result is redundancy.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 Also, if an obsolete function is substantially the same as a newer one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 but is not actually an alias, you should consider omitting the doc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 string entirely (use a null string @samp{""} as the doc string). That
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 way, the user is told about the obsoleteness and is forced to look at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 the documentation of the new function, making it more likely that he
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 will use the new function.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 @defun function-obsoleteness-doc function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 If @var{function} is obsolete, this function returns a string describing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 this. This is the message that is printed out during byte compilation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 or in the function's documentation. If @var{function} is not obsolete,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 @code{nil} is returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 @defun variable-obsoleteness-doc variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 This is like @code{function-obsoleteness-doc} but for variables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 The obsoleteness information is stored internally by putting a property
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 @code{byte-obsolete-info} (for functions) or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 @code{byte-obsolete-variable} (for variables) on the symbol that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 specifies the obsolete function or variable. For more information, see
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 the implementation of @code{make-obsolete} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 @code{make-obsolete-variable} in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 @file{lisp/bytecomp/bytecomp-runtime.el}.