annotate doc/misc/forms.texi @ 111655:36363a7ada1e

Tiny authors.el updates. * lisp/emacs-lisp/authors.el (authors-ignored-files) (authors-valid-file-names, authors-renamed-files-alist): Add entries.
author Glenn Morris <rgm@gnu.org>
date Sat, 20 Nov 2010 14:27:56 -0800
parents f1266b2f017e
children 376148b31b5e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109264
f1266b2f017e Untabify doc/misc/*.texi.
Glenn Morris <rgm@gnu.org>
parents: 106815
diff changeset
1 \input texinfo @c -*-texinfo-*-
84298
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2 @c documentation for forms-mode
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
3 @c Written by Johan Vromans, and edited by Richard Stallman
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
4
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
5 @comment %**start of header (This is for running Texinfo on a region.)
84329
3d431f1997d8 (setfilename): Go up one more level to ../../info.
Glenn Morris <rgm@gnu.org>
parents: 84298
diff changeset
6 @setfilename ../../info/forms
84298
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
7 @settitle Forms Mode User's Manual
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
8 @syncodeindex vr cp
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
9 @syncodeindex fn cp
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
10 @syncodeindex ky cp
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
11 @iftex
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
12 @finalout
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
13 @setchapternewpage odd
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
14 @end iftex
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
15 @c @smallbook
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
16 @comment %**end of header (This is for running Texinfo on a region.)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
17
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
18 @copying
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
19 This file documents Forms mode, a form-editing major mode for GNU Emacs.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
20
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
21 Copyright @copyright{} 1989, 1997, 2001, 2002, 2003, 2004,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 102059
diff changeset
22 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
84298
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
23
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
24 @quotation
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
25 Permission is granted to copy, distribute and/or modify this document
99709
6de181810d0f Relicense all texi files under FDL 1.3 or later.
Glenn Morris <rgm@gnu.org>
parents: 95937
diff changeset
26 under the terms of the GNU Free Documentation License, Version 1.3 or
84298
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
27 any later version published by the Free Software Foundation; with no
95937
6f0fce2c3559 Remove references to external license, since doclicense is included.
Glenn Morris <rgm@gnu.org>
parents: 95874
diff changeset
28 Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
6f0fce2c3559 Remove references to external license, since doclicense is included.
Glenn Morris <rgm@gnu.org>
parents: 95874
diff changeset
29 and with the Back-Cover Texts as in (a) below. A copy of the license
6f0fce2c3559 Remove references to external license, since doclicense is included.
Glenn Morris <rgm@gnu.org>
parents: 95874
diff changeset
30 is included in the section entitled ``GNU Free Documentation License''.
84298
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
31
95874
eafbd7a5c9be Update Back-Cover Text as per maintain.info.
Glenn Morris <rgm@gnu.org>
parents: 87903
diff changeset
32 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
eafbd7a5c9be Update Back-Cover Text as per maintain.info.
Glenn Morris <rgm@gnu.org>
parents: 87903
diff changeset
33 modify this GNU manual. Buying copies from the FSF supports it in
eafbd7a5c9be Update Back-Cover Text as per maintain.info.
Glenn Morris <rgm@gnu.org>
parents: 87903
diff changeset
34 developing GNU and promoting software freedom.''
84298
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
35 @end quotation
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
36 @end copying
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
37
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
38 @dircategory Emacs
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
39 @direntry
109264
f1266b2f017e Untabify doc/misc/*.texi.
Glenn Morris <rgm@gnu.org>
parents: 106815
diff changeset
40 * Forms: (forms). Emacs package for editing data bases
f1266b2f017e Untabify doc/misc/*.texi.
Glenn Morris <rgm@gnu.org>
parents: 106815
diff changeset
41 by filling in forms.
84298
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
42 @end direntry
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
43
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
44 @titlepage
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
45 @sp 6
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
46 @center @titlefont{Forms Mode User's Manual}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
47 @sp 4
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
48 @center Forms-Mode version 2
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
49 @sp 1
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
50 @center for GNU Emacs 22.1
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
51 @sp 1
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
52 @center April 2007
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
53 @sp 5
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
54 @center Johan Vromans
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
55 @center @i{jvromans@@squirrel.nl}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
56 @page
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
57 @vskip 0pt plus 1filll
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
58 @insertcopying
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
59 @end titlepage
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
60
102059
9bcea07061a8 consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents: 100974
diff changeset
61 @contents
9bcea07061a8 consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents: 100974
diff changeset
62
84298
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
63 @ifnottex
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
64 @node Top
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
65 @top Forms Mode
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
66
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
67 Forms mode is an Emacs major mode for working with simple textual data
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
68 bases in a forms-oriented manner. In Forms mode, the information in
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
69 these files is presented in an Emacs window in a user-defined format,
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
70 one record at a time. The user can view records or modify their
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
71 contents.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
72
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
73 Forms mode is not a simple major mode, but requires two files to do its
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
74 job: a control file and a data file. The data file holds the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
75 actual data to be presented. The control file describes
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
76 how to present it.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
77
102059
9bcea07061a8 consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents: 100974
diff changeset
78 @insertcopying
9bcea07061a8 consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents: 100974
diff changeset
79
84298
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
80 @menu
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
81 * Forms Example:: An example: editing the password data base.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
82 * Entering and Exiting Forms Mode::
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
83 How to visit a file in Forms mode.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
84 * Forms Commands:: Special commands to use while in Forms mode.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
85 * Data File Format:: How to format the data file.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
86 * Control File Format:: How to control forms mode.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
87 * Format Description:: How to define the forms layout.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
88 * Modifying Forms Contents:: How to modify.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
89 * Miscellaneous:: Forms mode messages and other remarks.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
90 * Error Messages:: List of error messages forms mode can produce.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
91 * Long Example:: A more complex control file example.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
92 * GNU Free Documentation License:: The license for this documentation.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
93 * Credits:: Thanks everyone.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
94 * Index:: Index to this manual.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
95 @end menu
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
96 @end ifnottex
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
97
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
98 @node Forms Example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
99 @chapter Forms Example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
100
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
101 Let's illustrate Forms mode with an example. Suppose you are looking at
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
102 the @file{/etc/passwd} file, and the screen looks like this:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
103
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
104 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
105 ====== /etc/passwd ======
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
106
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
107 User : root Uid: 0 Gid: 1
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
108
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
109 Name : Super User
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
110
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
111 Home : /
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
112
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
113 Shell: /bin/sh
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
114 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
115
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
116 As you can see, the familiar fields from the entry for the super user
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
117 are all there, but instead of being colon-separated on one single line,
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
118 they make up a forms.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
119
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
120 The contents of the forms consist of the contents of the fields of the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
121 record (e.g. @samp{root}, @samp{0}, @samp{1}, @samp{Super User})
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
122 interspersed with normal text (e.g @samp{User : }, @samp{Uid: }).
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
123
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
124 If you modify the contents of the fields, Forms mode will analyze your
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
125 changes and update the file appropriately. You cannot modify the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
126 interspersed explanatory text (unless you go to some trouble about it),
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
127 because that is marked read-only (@pxref{Text Properties,,, elisp, The
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
128 Emacs Lisp Reference Manual}).
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
129
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
130 The Forms mode control file specifies the relationship between the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
131 format of @file{/etc/passwd} and what appears on the screen in Forms
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
132 mode. @xref{Control File Format}.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
133
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
134 @node Entering and Exiting Forms Mode
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
135 @chapter Entering and Exiting Forms Mode
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
136
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
137 @table @kbd
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
138 @findex forms-find-file
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
139 @item M-x forms-find-file @key{RET} @var{control-file} @key{RET}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
140 Visit a database using Forms mode. Specify the name of the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
141 @strong{control file}, not the data file!
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
142
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
143 @findex forms-find-file-other-window
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
144 @item M-x forms-find-file-other-window @key{RET} @var{control-file} @key{RET}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
145 Similar, but displays the file in another window.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
146 @end table
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
147
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
148 The command @code{forms-find-file} evaluates the file
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
149 @var{control-file}, and also visits it in Forms mode. What you see in
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
150 its buffer is not the contents of this file, but rather a single record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
151 of the corresponding data file that is visited in its own buffer. So
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
152 there are two buffers involved in Forms mode: the @dfn{forms buffer}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
153 that is initially used to visit the control file and that shows the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
154 records being browsed, and the @dfn{data buffer} that holds the data
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
155 file being visited. The latter buffer is normally not visible.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
156
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
157 Initially, the first record is displayed in the forms buffer.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
158 The mode line displays the major mode name @samp{Forms}, followed by the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
159 minor mode @samp{View} if the data base is read-only. The number of the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
160 current record (@var{n}) and the total number of records in the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
161 file(@var{t}) are shown in the mode line as @samp{@var{n}/@var{t}}. For
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
162 example:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
163
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
164 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
165 --%%-Emacs: passwd-demo (Forms View 1/54)----All-------
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
166 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
167
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
168 If the buffer is not read-only, you may change the buffer to modify the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
169 fields in the record. When you move to a different record, the contents
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
170 of the buffer are parsed using the specifications in
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
171 @code{forms-format-list}, and the data file is updated. If the record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
172 has fields that aren't included in the display, they are not changed.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
173
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
174 @vindex forms-mode-hooks
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
175 Entering Forms mode runs the normal hook @code{forms-mode-hooks} to
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
176 perform user-defined customization.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
177
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
178 To save any modified data, you can use @kbd{C-x C-s}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
179 (@code{forms-save-buffer}). This does not save the forms buffer (which would
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
180 be rather useless), but instead saves the buffer visiting the data file.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
181
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
182 To terminate Forms mode, you can use @kbd{C-x C-s} (@code{forms-save-buffer})
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
183 and then kill the forms buffer. However, the data buffer will still
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
184 remain. If this is not desired, you have to kill this buffer too.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
185
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
186 @node Forms Commands
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
187 @chapter Forms Commands
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
188
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
189 The commands of Forms mode belong to the @kbd{C-c} prefix, with one
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
190 exception: @key{TAB}, which moves to the next field. Forms mode uses
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
191 different key maps for normal mode and read-only mode. In read-only
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
192 Forms mode, you can access most of the commands without the @kbd{C-c}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
193 prefix, but you must type ordinary letters instead of control
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
194 characters; for example, type @kbd{n} instead of @kbd{C-c C-n}.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
195
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
196 If your Emacs has been built with X-toolkit support, Forms mode will
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
197 provide its own menu with a number of Forms mode commands.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
198
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
199 @table @kbd
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
200 @findex forms-next-record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
201 @kindex C-c C-n
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
202 @item C-c C-n
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
203 Show the next record (@code{forms-next-record}). With a numeric
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
204 argument @var{n}, show the @var{n}th next record.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
205
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
206 @findex forms-prev-record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
207 @kindex C-c C-p
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
208 @item C-c C-p
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
209 Show the previous record (@code{forms-prev-record}). With a numeric
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
210 argument @var{n}, show the @var{n}th previous record.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
211
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
212 @findex forms-jump-record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
213 @kindex C-c C-l
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
214 @item C-c C-l
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
215 Jump to a record by number (@code{forms-jump-record}). Specify
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
216 the record number with a numeric argument.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
217
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
218 @findex forms-first-record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
219 @kindex C-c <
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
220 @item C-c <
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
221 Jump to the first record (@code{forms-first-record}).
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
222
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
223 @findex forms-last-record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
224 @kindex C-c >
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
225 @item C-c >
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
226 Jump to the last record (@code{forms-last-record}). This command also
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
227 recalculates the number of records in the data file.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
228
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
229 @findex forms-next-field
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
230 @kindex TAB
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
231 @item @key{TAB}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
232 @kindex C-c TAB
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
233 @itemx C-c @key{TAB}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
234 Jump to the next field in the current record (@code{forms-next-field}).
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
235 With a numeric argument @var{n}, jump forward @var{n} fields. If this command
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
236 would move past the last field, it wraps around to the first field.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
237
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
238 @findex forms-toggle-read-only
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
239 @kindex C-c C-q
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
240 @item C-c C-q
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
241 Toggles read-only mode (@code{forms-toggle-read-only}). In read-only
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
242 Forms mode, you cannot edit the fields; most Forms mode commands can be
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
243 accessed without the prefix @kbd{C-c} if you use the normal letter
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
244 instead (for example, type @kbd{n} instead of @kbd{C-c C-n}). In edit
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
245 mode, you can edit the fields and thus change the contents of the data
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
246 base; you must begin Forms mode commands with @code{C-c}. Switching
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
247 to edit mode is allowed only if you have write access to the data file.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
248
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
249 @findex forms-insert-record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
250 @kindex C-c C-o
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
251 @item C-c C-o
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
252 Create a new record and insert it before the current record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
253 (@code{forms-insert-record}). It starts out with empty (or default)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
254 contents for its fields; you can then edit the fields. With a numeric
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
255 argument, the new record is created @emph{after} the current one.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
256 See also @code{forms-modified-record-filter} in @ref{Modifying Forms
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
257 Contents}.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
258
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
259 @findex forms-delete-record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
260 @kindex C-c C-k
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
261 @item C-c C-k
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
262 Delete the current record (@code{forms-delete-record}). You are
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
263 prompted for confirmation before the record is deleted unless a numeric
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
264 argument has been provided.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
265
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
266 @findex forms-search-forward
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
267 @kindex C-c C-s @var{regexp} @key{RET}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
268 @item C-c C-s @var{regexp} @key{RET}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
269 Search forward for @var{regexp} in all records following this one
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
270 (@code{forms-search-forward}). If found, this record is shown.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
271 If you give an empty argument, the previous regexp is used again.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
272
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
273 @findex forms-search-backward
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
274 @kindex C-c C-r @var{regexp} @key{RET}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
275 @item C-c C-r @var{regexp} @key{RET}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
276 Search backward for @var{regexp} in all records following this one
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
277 (@code{forms-search-backward}). If found, this record is shown.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
278 If you give an empty argument, the previous regexp is used again.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
279
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
280 @ignore
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
281 @findex forms-exit
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
282 @kindex C-c C-x
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
283 @item C-c C-x
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
284 Terminate Forms mode processing (@code{forms-exit}). The data file is
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
285 saved if it has been modified.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
286
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
287 @findex forms-exit-no-save
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
288 @item M-x forms-exit-no-save
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
289 Terminates forms mode processing without saving modified data first.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
290 @end ignore
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
291
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
292 @findex forms-prev-field
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
293 @item M-x forms-prev-field
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
294 Similar to @code{forms-next-field} but moves backwards.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
295
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
296 @findex forms-save-buffer
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
297 @item M-x forms-save-buffer
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
298 @kindex C-x C-s
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
299 @itemx C-x C-s
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
300 Forms mode replacement for @code{save-buffer}. When executed in the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
301 forms buffer it will save the contents of the (modified) data buffer
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
302 instead. In Forms mode this function will be bound to @kbd{C-x C-s}.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
303
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
304 @findex forms-print
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
305 @item M-x forms-print
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
306 This command can be used to make a formatted print
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
307 of the contents of the data file.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
308
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
309 @end table
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
310
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
311 In addition the command @kbd{M-x revert-buffer} is useful in Forms mode
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
312 just as in other modes.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
313
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
314 @ignore
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
315 @vindex forms-forms-scroll
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
316 @findex scroll-up
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
317 @findex scroll-down
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
318 If the variable @code{forms-forms-scrolls} is set to a value other
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
319 than @code{nil} (which it is, by default), the Emacs functions
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
320 @code{scroll-up} and @code{scroll-down} will perform a
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
321 @code{forms-next-record} and @code{forms-prev-record} when in forms
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
322 mode. So you can use your favorite page commands to page through the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
323 data file.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
324
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
325 @vindex forms-forms-jump
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
326 @findex beginning-of-buffer
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
327 @findex end-of-buffer
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
328 Likewise, if the variable @code{forms-forms-jump} is not @code{nil}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
329 (which it is, by default), Emacs functions @code{beginning-of-buffer}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
330 and @code{end-of-buffer} will perform @code{forms-first-record} and
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
331 @code{forms-last-record} when in forms mode.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
332 @end ignore
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
333
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
334 The following function key definitions are set up in Forms mode
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
335 (whether read-only or not):
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
336
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
337 @table @kbd
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
338 @kindex next
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
339 @item next
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
340 forms-next-record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
341
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
342 @kindex prior
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
343 @item prior
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
344 forms-prev-record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
345
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
346 @kindex begin
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
347 @item begin
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
348 forms-first-record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
349
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
350 @kindex end
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
351 @item end
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
352 forms-last-record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
353
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
354 @kindex S-Tab
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
355 @findex forms-prev-field
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
356 @item S-Tab
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
357 forms-prev-field
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
358 @end table
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
359
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
360 @node Data File Format
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
361 @chapter Data File Format
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
362
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
363 @cindex record
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
364 @cindex field
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
365 @vindex forms-field-sep
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
366 Files for use with Forms mode are very simple---each @dfn{record}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
367 (usually one line) forms the contents of one form. Each record consists
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
368 of a number of @dfn{fields}, which are separated by the value of the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
369 string @code{forms-field-sep}, which is @code{"\t"} (a Tab) by default.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
370
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
371 @vindex forms-read-file-filter
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
372 @vindex forms-write-file-filter
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
373 If the format of the data file is not suitable enough you can define the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
374 filter functions @code{forms-read-file-filter} and
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
375 @code{forms-write-file-filter}. @code{forms-read-file-filter} is called
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
376 when the data file is read from disk into the data buffer. It operates
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
377 on the data buffer, ignoring read-only protections. When the data file
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
378 is saved to disk @code{forms-write-file-filter} is called to cancel the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
379 effects of @code{forms-read-file-filter}. After being saved,
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
380 @code{forms-read-file-filter} is called again to prepare the data buffer
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
381 for further processing.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
382
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
383 @cindex pseudo-newline
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
384 @vindex forms-multi-line
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
385 Fields may contain text which shows up in the forms in multiple lines.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
386 These lines are separated in the field using a ``pseudo-newline''
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
387 character which is defined by the value of the string
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
388 @code{forms-multi-line}. Its default value is @code{"\^k"} (a Control-K
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
389 character). If it is
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
390 set to @code{nil}, multiple line fields are prohibited.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
391
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
392 If the data file does not exist, it is automatically created.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
393
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
394 @node Control File Format
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
395 @chapter Control File Format
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
396
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
397 @cindex control file
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
398 The Forms mode @dfn{control file} serves two purposes. First, it names
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
399 the data file to use, and defines its format and properties. Second,
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
400 the Emacs buffer it occupies is used by Forms mode to display the forms.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
401
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
402 The contents of the control file are evaluated as a Lisp program. It
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
403 should set the following Lisp variables to suitable values:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
404
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
405 @table @code
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
406 @vindex forms-file
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
407 @item forms-file
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
408 This variable specifies the name of the data file. Example:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
409
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
410 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
411 (setq forms-file "my/data-file")
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
412 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
413
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
414 If the control file doesn't set @code{forms-file}, Forms mode
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
415 reports an error.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
416
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
417 @vindex forms-format-list
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
418 @item forms-format-list
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
419 This variable describes the way the fields of the record are formatted on
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
420 the screen. For details, see @ref{Format Description}.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
421
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
422 @vindex forms-number-of-fields
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
423 @item forms-number-of-fields
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
424 This variable holds the number of fields in each record of the data
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
425 file. Example:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
426
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
427 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
428 (setq forms-number-of-fields 10)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
429 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
430 @end table
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
431
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
432 If the control file does not set @code{forms-format-list} a default
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
433 format is used. In this situation, Forms mode will deduce the number of
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
434 fields from the data file providing this file exists and
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
435 @code{forms-number-of-records} has not been set in the control file.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
436
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
437 The control file can optionally set the following additional Forms mode
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
438 variables. Most of them have default values that are good for most
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
439 applications.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
440
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
441 @table @code
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
442 @vindex forms-field-sep
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
443 @item forms-field-sep
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
444 This variable may be used to designate the string which separates the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
445 fields in the records of the data file. If not set, it defaults to the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
446 string @code{"\t"} (a Tab character). Example:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
447
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
448 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
449 (setq forms-field-sep "\t")
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
450 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
451
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
452 @vindex forms-read-only
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
453 @item forms-read-only
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
454 If the value is non-@code{nil}, the data file is treated read-only. (Forms
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
455 mode also treats the data file as read-only if you don't have access to
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
456 write it.) Example:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
457
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
458 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
459 (set forms-read-only t)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
460 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
461
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
462 @vindex forms-multi-line
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
463 @item forms-multi-line
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
464 This variable specifies the @dfn{pseudo newline} separator that allows
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
465 multi-line fields. This separator goes between the ``lines'' within a
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
466 field---thus, the field doesn't really contain multiple lines, but it
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
467 appears that way when displayed in Forms mode. If the value is
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
468 @code{nil}, multi-line text fields are prohibited. The pseudo newline
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
469 must not be a character contained in @code{forms-field-sep}.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
470
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
471 The default value is @code{"\^k"}, the character Control-K. Example:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
472
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
473 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
474 (setq forms-multi-line "\^k")
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
475 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
476
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
477 @ignore
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
478 @vindex forms-forms-scroll
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
479 @item forms-forms-scroll
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
480 @xref{Forms Mode Commands}, for details.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
481
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
482 @vindex forms-forms-jump
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
483 @item forms-forms-jump
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
484 @xref{Forms Mode Commands}, for details.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
485 @end ignore
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
486
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
487 @findex forms-read-file-filter
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
488 @item forms-read-file-filter
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
489 This variable holds the name of a function to be called after the data
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
490 file has been read in. This can be used to transform the contents of the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
491 data file into a format more suitable for forms processing.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
492 If it is @code{nil}, no function is called. For example, to maintain a
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
493 gzipped database:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
494
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
495 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
496 (defun gzip-read-file-filter ()
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
497 (shell-command-on-region (point-min) (point-max)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
498 "gzip -d" t t))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
499 (setq forms-read-file-filter 'gzip-read-file-filter)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
500 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
501
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
502 @findex forms-write-file-filter
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
503 @item forms-write-file-filter
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
504 This variable holds the name of a function to be called before writing
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
505 out the contents of the data file.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
506 This can be used to undo the effects of @code{forms-read-file-filter}.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
507 If it is @code{nil}, no function is called. Example:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
508
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
509 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
510 (defun gzip-write-file-filter ()
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
511 (make-variable-buffer-local 'require-final-newline)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
512 (setq require-final-newline nil)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
513 (shell-command-on-region (point-min) (point-max)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
514 "gzip" t t))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
515 (setq forms-write-file-filter 'gzip-write-file-filter)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
516 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
517
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
518 @findex forms-new-record-filter
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
519 @item forms-new-record-filter
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
520 This variable holds a function to be called whenever a new record is created
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
521 to supply default values for fields. If it is @code{nil}, no function is
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
522 called.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
523 @xref{Modifying Forms Contents}, for details.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
524
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
525 @findex forms-modified-record-filter
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
526 @item forms-modified-record-filter
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
527 This variable holds a function to be called whenever a record is
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
528 modified, just before updating the Forms data file. If it is
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
529 @code{nil}, no function is called.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
530 @xref{Modifying Forms Contents}, for details.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
531
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
532 @findex forms-insert-after
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
533 @item forms-insert-after
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
534 If this variable is not @code{nil}, new records are created @emph{after} the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
535 current record. Also, upon visiting a file, the initial position will be
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
536 at the last record instead of the first one.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
537
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
538 @findex forms-check-number-of-fields
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
539 @item forms-check-number-of-fields
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
540 Normally each record is checked to contain the correct number of fields.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
541 Under certain circumstances, this can be undesirable.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
542 If this variable is set to @code{nil}, these checks will be bypassed.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
543 @end table
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
544
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
545 @node Format Description
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
546 @chapter The Format Description
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
547
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
548 @vindex forms-format-list
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
549 The variable @code{forms-format-list} specifies the format of the data
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
550 in the data file, and how to convert the data for display in Forms mode.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
551 Its value must be a list of Forms mode @dfn{formatting elements}, each
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
552 of which can be a string, a number, a Lisp list, or a Lisp symbol that
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
553 evaluates to one of those. The formatting elements are processed in the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
554 order they appear in the list.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
555
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
556 @table @var
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
557 @item string
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
558 A string formatting element is inserted in the forms ``as is,'' as text
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
559 that the user cannot alter.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
560
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
561 @item number
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
562 A number element selects a field of the record. The contents of this
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
563 field are inserted in the display at this point. Field numbers count
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
564 starting from 1 (one).
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
565
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
566 @item list
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
567 A formatting element that is a list specifies a function call. This
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
568 function is called every time a record is displayed, and its result,
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
569 which must be a string, is inserted in the display text. The function
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
570 should do nothing but returning a string.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
571
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
572 @vindex forms-fields
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
573 The function you call can access the fields of the record as a list in
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
574 the variable
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
575 @code{forms-fields}.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
576
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
577 @item symbol
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
578 A symbol used as a formatting element should evaluate to a string, number,
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
579 or list; the value is interpreted as a formatting element, as described
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
580 above.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
581 @end table
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
582
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
583 If a record does not contain the number of fields as specified in
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
584 @code{forms-number-of-fields}, a warning message will be printed. Excess
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
585 fields are ignored, missing fields are set to empty.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
586
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
587 The control file which displays @file{/etc/passwd} file as demonstrated
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
588 in the beginning of this manual might look as follows:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
589
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
590 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
591 ;; @r{This demo visits @file{/etc/passwd}.}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
592
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
593 (setq forms-file "/etc/passwd")
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
594 (setq forms-number-of-fields 7)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
595 (setq forms-read-only t) ; @r{to make sure}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
596 (setq forms-field-sep ":")
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
597 ;; @r{Don't allow multi-line fields.}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
598 (setq forms-multi-line nil)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
599
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
600 (setq forms-format-list
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
601 (list
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
602 "====== /etc/passwd ======\n\n"
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
603 "User : " 1
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
604 " Uid: " 3
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
605 " Gid: " 4
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
606 "\n\n"
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
607 "Name : " 5
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
608 "\n\n"
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
609 "Home : " 6
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
610 "\n\n"
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
611 "Shell: " 7
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
612 "\n"))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
613 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
614
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
615 When you construct the value of @code{forms-format-list}, you should
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
616 usually either quote the whole value, like this,
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
617
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
618 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
619 (setq forms-format-list
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
620 '(
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
621 "====== " forms-file " ======\n\n"
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
622 "User : " 1
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
623 (make-string 20 ?-)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
624 @dots{}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
625 ))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
626 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
627
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
628 @noindent
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
629 or quote the elements which are lists, like this:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
630
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
631 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
632 (setq forms-format-list
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
633 (list
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
634 "====== " forms-file " ======\n\n"
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
635 "User : " 1
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
636 '(make-string 20 ?-)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
637 @dots{}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
638 ))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
639 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
640
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
641 Forms mode validates the contents of @code{forms-format-list} when you
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
642 visit a database. If there are errors, processing is aborted with an
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
643 error message which includes a descriptive text. @xref{Error Messages},
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
644 for a detailed list of error messages.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
645
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
646 If no @code{forms-format-list} is specified, Forms mode will supply a
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
647 default format list. This list contains the name of the file being
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
648 visited, and a simple label for each field indicating the field number.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
649
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
650 @node Modifying Forms Contents
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
651 @chapter Modifying The Forms Contents
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
652
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
653 If @code{forms-read-only} is @code{nil}, the user can modify the fields
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
654 and records of the database.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
655
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
656 All normal editing commands are available for editing the contents of the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
657 displayed record. You cannot delete or modify the fixed, explanatory
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
658 text that comes from string formatting elements, but you can modify the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
659 actual field contents.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
660
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
661 @ignore
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
662 @c This is for the Emacs 18 version only.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
663 If the contents of the forms cannot be recognized properly, this is
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
664 signaled using a descriptive text. @xref{Error Messages}, for more info.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
665 The cursor will indicate the last part of the forms which was
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
666 successfully parsed. It's important to avoid entering field contents
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
667 that would cause confusion with the field-separating fixed text.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
668 @end ignore
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
669
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
670 If the variable @code{forms-modified-record-filter} is non-@code{nil},
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
671 it is called as a function before the new data is written to the data
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
672 file. The function receives one argument, a vector that contains the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
673 contents of the fields of the record.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
674
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
675 The function can refer to fields with @code{aref} and modify them with
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
676 @code{aset}. The first field has number 1 (one); thus, element 0 of the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
677 vector is not used. The function should return the same vector it was
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
678 passed; the (possibly modified) contents of the vector determine what is
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
679 actually written in the file. Here is an example:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
680
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
681 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
682 (defun my-modified-record-filter (record)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
683 ;; @r{Modify second field.}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
684 (aset record 2 (current-time-string))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
685 ;; @r{Return the field vector.}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
686 record)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
687
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
688 (setq forms-modified-record-filter 'my-modified-record-filter)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
689 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
690
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
691 If the variable @code{forms-new-record-filter} is non-@code{nil}, its
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
692 value is a function to be called to fill in default values for the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
693 fields of a new record. The function is passed a vector of empty
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
694 strings, one for each field; it should return the same vector, with
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
695 the desired field values stored in it. Fields are numbered starting
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
696 from 1 (one). Example:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
697
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
698 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
699 (defun my-new-record-filter (fields)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
700 (aset fields 5 (login-name))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
701 (aset fields 1 (current-time-string))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
702 fields)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
703
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
704 (setq forms-new-record-filter 'my-new-record-filter)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
705 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
706
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
707 @node Miscellaneous
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
708 @chapter Miscellaneous
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
709
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
710 @vindex forms-version
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
711 The global variable @code{forms-version} holds the version information
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
712 of the Forms mode software.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
713
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
714 @findex forms-enumerate
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
715 It is very convenient to use symbolic names for the fields in a record.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
716 The function @code{forms-enumerate} provides an elegant means to define
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
717 a series of variables whose values are consecutive integers. The
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
718 function returns the highest number used, so it can be used to set
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
719 @code{forms-number-of-fields} also. For example:
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
720
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
721 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
722 (setq forms-number-of-fields
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
723 (forms-enumerate
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
724 '(field1 field2 field3 @dots{})))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
725 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
726
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
727 This sets @code{field1} to 1, @code{field2} to 2, and so on.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
728
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
729 Care has been taken to keep the Forms mode variables buffer-local, so it
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
730 is possible to visit multiple files in Forms mode simultaneously, even
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
731 if they have different properties.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
732
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
733 @findex forms-mode
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
734 If you have visited the control file in normal fashion with
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
735 @code{find-file} or a like command, you can switch to Forms mode with
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
736 the command @code{M-x forms-mode}. If you put @samp{-*- forms -*-} in
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
737 the first line of the control file, then visiting it enables Forms mode
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
738 automatically. But this makes it hard to edit the control file itself,
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
739 so you'd better think twice before using this.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
740
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
741 The default format for the data file, using @code{"\t"} to separate
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
742 fields and @code{"\^k"} to separate lines within a field, matches the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
743 file format of some popular database programs, e.g. FileMaker. So
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
744 @code{forms-mode} can decrease the need to use proprietary software.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
745
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
746 @node Error Messages
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
747 @chapter Error Messages
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
748
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
749 This section describes all error messages which can be generated by
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
750 forms mode. Error messages that result from parsing the control file
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
751 all start with the text @samp{Forms control file error}. Messages
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
752 generated while analyzing the definition of @code{forms-format-list}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
753 start with @samp{Forms format error}.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
754
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
755 @table @code
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
756 @item Forms control file error: `forms-file' has not been set
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
757 The variable @code{forms-file} was not set by the control file.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
758
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
759 @item Forms control file error: `forms-number-of-fields' has not been set
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
760 The variable @code{forms-number-of-fields} was not set by the control
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
761 file.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
762
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
763 @item Forms control file error: `forms-number-of-fields' must be a number > 0
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
764 The variable @code{forms-number-of-fields} did not contain a positive
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
765 number.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
766
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
767 @item Forms control file error: `forms-field-sep' is not a string
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
768 @itemx Forms control file error: `forms-multi-line' must be nil or a one-character string
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
769 The variable @code{forms-multi-line} was set to something other than
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
770 @code{nil} or a single-character string.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
771
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
772 @item Forms control file error: `forms-multi-line' is equal to 'forms-field-sep'
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
773 The variable @code{forms-multi-line} may not be equal to
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
774 @code{forms-field-sep} for this would make it impossible to distinguish
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
775 fields and the lines in the fields.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
776
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
777 @item Forms control file error: `forms-new-record-filter' is not a function
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
778 @itemx Forms control file error: `forms-modified-record-filter' is not a function
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
779 The variable has been set to something else than a function.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
780
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
781 @item Forms control file error: `forms-format-list' is not a list
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
782 The variable @code{forms-format-list} was not set to a Lisp list
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
783 by the control file.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
784
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
785 @item Forms format error: field number @var{xx} out of range 1..@var{nn}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
786 A field number was supplied in @code{forms-format-list} with a value of
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
787 @var{xx}, which was not greater than zero and smaller than or equal to
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
788 the number of fields in the forms, @var{nn}.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
789
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
790 @item Forms format error: @var{fun} is not a function
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
791 The first element of a list which is an element of
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
792 @code{forms-format-list} was not a valid Lisp function.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
793
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
794 @item Forms format error: invalid element @var{xx}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
795 A list element was supplied in @code{forms-format-list} which was not a
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
796 string, number or list.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
797
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
798 @ignore
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
799 @c This applies to Emacs 18 only.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
800 @c Error messages generated while a modified form is being analyzed.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
801
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
802 @item Parse error: not looking at `...'
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
803 When re-parsing the contents of a forms, the text shown could not
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
804 be found.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
805
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
806 @item Parse error: cannot find `...'
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
807 When re-parsing the contents of a forms, the text shown, which
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
808 separates two fields, could not be found.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
809
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
810 @item Parse error: cannot parse adjacent fields @var{xx} and @var{yy}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
811 Fields @var{xx} and @var{yy} were not separated by text, so could not be
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
812 parsed again.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
813 @end ignore
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
814
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
815 @item Warning: this record has @var{xx} fields instead of @var{yy}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
816 The number of fields in this record in the data file did not match
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
817 @code{forms-number-of-fields}. Missing fields will be made empty.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
818
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
819 @item Multi-line fields in this record - update refused!
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
820 The current record contains newline characters, hence can not be written
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
821 back to the data file, for it would corrupt it. Probably you inserted a
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
822 newline in a field, while @code{forms-multi-line} was @code{nil}.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
823
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
824 @item Field separator occurs in record - update refused!
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
825 The current record contains the field separator string inside one of the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
826 fields. It can not be written back to the data file, for it would
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
827 corrupt it. Probably you inserted the field separator string in a field.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
828
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
829 @item Record number @var{xx} out of range 1..@var{yy}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
830 A jump was made to non-existing record @var{xx}. @var{yy} denotes the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
831 number of records in the file.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
832
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
833 @item Stuck at record @var{xx}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
834 An internal error prevented a specific record from being retrieved.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
835
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
836 @item No write access to @code{"}@var{file}@code{"}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
837 An attempt was made to enable edit mode on a file that has been write
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
838 protected.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
839
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
840 @item Search failed: @var{regexp}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
841 The @var{regexp} could not be found in the data file. Forward searching
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
842 is done from the current location until the end of the file, then
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
843 retrying from the beginning of the file until the current location.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
844 Backward searching is done from the current location until the beginning
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
845 of the file, then retrying from the end of the file until the current
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
846 location.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
847
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
848 @item Wrapped
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
849 A search completed successfully after wrapping around.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
850
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
851 @item Warning: number of records changed to @var{nn}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
852 Forms mode's idea of the number of records has been adjusted to the
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
853 number of records actually present in the data file.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
854
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
855 @item Problem saving buffers?
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
856 An error occurred while saving the data file buffer. Most likely, Emacs
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
857 did ask to confirm deleting the buffer because it had been modified, and
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
858 you said `no'.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
859 @end table
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
860
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
861 @node Long Example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
862 @chapter Long Example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
863
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
864 The following example exploits most of the features of Forms mode.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
865 This example is included in the distribution as file @file{forms-d2.el}.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
866
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
867 @example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
868 ;; demo2 -- demo forms-mode -*- emacs-lisp -*-
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
869
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
870 ;; @r{This sample forms exploit most of the features of forms mode.}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
871
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
872 ;; @r{Set the name of the data file.}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
873 (setq forms-file "forms-d2.dat")
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
874
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
875 ;; @r{Use @code{forms-enumerate} to set field names and number thereof.}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
876 (setq forms-number-of-fields
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
877 (forms-enumerate
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
878 '(arch-newsgroup ; 1
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
879 arch-volume ; 2
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
880 arch-issue ; and ...
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
881 arch-article ; ... so
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
882 arch-shortname ; ... ... on
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
883 arch-parts
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
884 arch-from
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
885 arch-longname
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
886 arch-keywords
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
887 arch-date
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
888 arch-remarks)))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
889
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
890 ;; @r{The following functions are used by this form for layout purposes.}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
891 ;;
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
892 (defun arch-tocol (target &optional fill)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
893 "Produces a string to skip to column TARGET.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
894 Prepends newline if needed.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
895 The optional FILL should be a character, used to fill to the column."
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
896 (if (null fill)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
897 (setq fill ? ))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
898 (if (< target (current-column))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
899 (concat "\n" (make-string target fill))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
900 (make-string (- target (current-column)) fill)))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
901 ;;
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
902 (defun arch-rj (target field &optional fill)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
903 "Produces a string to skip to column TARGET\
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
904 minus the width of field FIELD.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
905 Prepends newline if needed.
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
906 The optional FILL should be a character,
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
907 used to fill to the column."
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
908 (arch-tocol (- target (length (nth field forms-fields))) fill))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
909
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
910 ;; @r{Record filters.}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
911 ;;
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
912 (defun new-record-filter (the-record)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
913 "Form a new record with some defaults."
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
914 (aset the-record arch-from (user-full-name))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
915 (aset the-record arch-date (current-time-string))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
916 the-record) ; return it
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
917 (setq forms-new-record-filter 'new-record-filter)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
918
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
919 ;; @r{The format list.}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
920 (setq forms-format-list
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
921 (list
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
922 "====== Public Domain Software Archive ======\n\n"
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
923 arch-shortname
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
924 " - " arch-longname
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
925 "\n\n"
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
926 "Article: " arch-newsgroup
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
927 "/" arch-article
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
928 " "
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
929 '(arch-tocol 40)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
930 "Issue: " arch-issue
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
931 " "
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
932 '(arch-rj 73 10)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
933 "Date: " arch-date
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
934 "\n\n"
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
935 "Submitted by: " arch-from
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
936 "\n"
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
937 '(arch-tocol 79 ?-)
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
938 "\n"
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
939 "Keywords: " arch-keywords
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
940 "\n\n"
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
941 "Parts: " arch-parts
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
942 "\n\n====== Remarks ======\n\n"
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
943 arch-remarks
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
944 ))
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
945
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
946 ;; @r{That's all, folks!}
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
947 @end example
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
948
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
949 @node Credits
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
950 @chapter Credits
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
951
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
952 Bug fixes and other useful suggestions were supplied by
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
953 Harald Hanche-Olsen (@code{hanche@@imf.unit.no}),
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
954 @code{cwitty@@portia.stanford.edu},
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
955 Jonathan I. Kamens,
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
956 Per Cederqvist (@code{ceder@@signum.se}),
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
957 Michael Lipka (@code{lipka@@lip.hanse.de}),
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
958 Andy Piper (@code{ajp@@eng.cam.ac.uk}),
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
959 Frederic Pierresteguy (@code{F.Pierresteguy@@frcl.bull.fr}),
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
960 Ignatios Souvatzis
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
961 and Richard Stallman (@code{rms@@gnu.org}).
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
962
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
963 This documentation was slightly inspired by the documentation of ``rolo
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
964 mode'' by Paul Davis at Schlumberger Cambridge Research
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
965 (@code{davis%scrsu1%sdr.slb.com@@relay.cs.net}).
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
966
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
967 None of this would have been possible without GNU Emacs of the Free
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
968 Software Foundation. Thanks, Richard!
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
969
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
970 @node GNU Free Documentation License
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
971 @appendix GNU Free Documentation License
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
972 @include doclicense.texi
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
973
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
974 @node Index
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
975 @unnumbered Index
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
976 @printindex cp
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
977
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
978 @bye
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
979
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
980 @ignore
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
981 arch-tag: 2ac9810b-aa49-4ea6-8030-d7f1ecd467ed
a475365b2236 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
982 @end ignore