annotate man/vhdl-mode.texi @ 123:c77884c6318d

Added tag r20-1b14 for changeset d2f30a177268
author cvs
date Mon, 13 Aug 2007 09:26:04 +0200
parents c0c698873ce1
children 9ad43877534d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1 \input texinfo @c -*- texinfo -*-
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
3 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
4 @comment %**start of header (This is for running Texinfo on a region)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
5 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
6
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
7 @setfilename vhdl-mode.info
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
8 @settitle VHDL-MODE Version 2 Documentation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
9 @footnotestyle end
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
10
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
11 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
12 @comment @setchapternewpage odd !! we don't want blank pages !!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
13 @comment %**end of header (This is for running Texinfo on a region)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
14 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
15
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
16
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
17 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
18 @comment
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
19 @comment texinfo manual for @file{vhdl-mode.el} version 2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
20 @comment manual version: 2.1
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
21 @comment adapted from the cc-mode texinfo manual by Barry A. Warsaw
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
22 @comment <bwarsaw@cnri.reston.va.us>
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
23 @comment
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
24 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
25
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
26
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
27 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
28 @comment The following line inserts the copyright notice
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
29 @comment into the Info file.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
30 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
31
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
32 @ifinfo
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
33 Copyright @copyright{} 1995 Rodney J. Whitby
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
34 @end ifinfo
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
35
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
36 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
37 @comment !!!The titlepage section does not appear in the Info file.!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
38 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
39
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
40 @titlepage
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
41 @sp 10
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
42
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
43
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
44 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
45 @comment The title is printed in a large font.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
46 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
47
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
48 @center @titlefont{VHDL-MODE Version 2}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
49 @sp 2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
50 @center A GNU Emacs mode for editing VHDL code.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
51 @center (manual revision: 2.1)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
52 @sp 2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
53 @center Rod Whitby
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 72
diff changeset
54 @center @code{rwhitby@@asc.corp.mot.com}
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
55
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
56
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
57 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
58 @comment The following two commands start the copyright page
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
59 @comment for the printed manual. This will not appear in the Info file.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
60 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
61
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
62 @page
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
63 @vskip 0pt plus 1filll
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
64 Copyright @copyright{} 1995 Rodney J. Whitby
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
65 @end titlepage
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
66
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
67
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
68 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
69 @comment The Top node contains the master menu for the Info file.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
70 @comment This appears only in the Info file, not the printed manual.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
71 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
73 @node Top, Introduction, (dir), (dir)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
74 @comment node-name, next, previous, up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
75
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
76
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
77 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
78 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
79
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
80 @menu
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
81 * Introduction::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
82 * Getting Connected::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
83 * New Indentation Engine::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
84 * Customizing Indentation::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
85 * Syntactic Symbols::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
86 * Indentation Commands::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
87 * Frequently Asked Questions::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
88 * Getting the latest vhdl-mode release::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
89 * Sample .emacs File::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
90 * Requirements::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
91 * Limitations and Known Bugs::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
92 * Mailing Lists and Submitting Bug Reports::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
93 * Concept Index::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
94 * Command Index:: Command Index
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
95 * Key Index:: Key Index
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
96 * Variable Index:: Variable Index
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
97 @end menu
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
98
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
99 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
100 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
101
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
102 @node Introduction, Getting Connected, Top, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
103 @comment node-name, next, previous, up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
104 @chapter Introduction
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
105 @cindex Introduction
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
106
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
107 Welcome to @code{vhdl-mode}, version 2. This is a GNU Emacs mode for
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
108 editing files containing VHDL code.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
109
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
110 This manual will describe the following:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
111
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
112 @itemize @bullet
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
113 @item
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
114 How to get started using @code{vhdl-mode}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
115
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
116 @item
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
117 How the new indentation engine works.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
118
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
119 @item
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
120 How to customize the new indentation engine.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
121
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
122 @end itemize
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
123
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
124 @findex vhdl-version
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
125 The major version number was incremented to 2 with the addition of the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
126 new indentation engine. To find the minor revision number of this
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
127 release, use @kbd{M-x vhdl-version RET}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
128
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
129 A special word of thanks goes to Barry Warsaw, who wrote the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
130 @code{cc-mode} indentation engine that formed the basis of the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
131 @code{vhdl-mode} indentation engine. This manual is also based upon the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
132 manual for @code{cc-mode}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
133
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
134
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
135 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
136
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
137 @node Getting Connected, New Indentation Engine, Introduction, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
138 @comment node-name, next, previous, up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
139 @chapter Getting Connected
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
140 @cindex Getting Connected
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
141
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
142 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
143
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
144 @file{vhdl-mode.el} works well with the 3 main branches of Emacs 19:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
145 XEmacs, Win-Emacs (which has the same heritage as XEmacs) and the Emacs
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
146 19 maintained by the FSF. FSF's Emacs 19 users will want to use Emacs
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
147 version 19.21 or better, Win-Emacs users will want 1.35 or better, and
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
148 XEmacs users will want 19.6 or better. Earlier versions of these
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
149 Emacsen have deficiencies and/or bugs which will adversely affect the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
150 performance and usability of @code{vhdl-mode}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
151
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
152 @cindex .emacs file
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
153 The first thing you will want to do is put @file{vhdl-mode.el} somewhere
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
154 on your @code{load-path} so Emacs can find it. Do a @kbd{C-h v
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
155 load-path RET} to see all the directories Emacs looks at when loading a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
156 file. If none of these directories are appropriate, create a new
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
157 directory and add it to your @code{load-path}:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
158
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
159 @noindent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
160 @emph{[in the shell]}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
161 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
162 @group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
163
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
164 % cd
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
165 % mkdir mylisp
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
166 % mv vhdl-mode.el mylisp
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
167 % cd mylisp
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
168
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
169 @end group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
170 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
171
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
172 @noindent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
173 @emph{[in your .emacs file add]}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
174 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
175
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
176 (setq load-path (cons "~/mylisp" load-path))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
177
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
178 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
179
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
180 @cindex byte compile
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
181 Next you want to @dfn{byte compile} @file{vhdl-mode.el}. The mode uses a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
182 lot of macros so if you don't byte compile it, things will be unbearably
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
183 slow. @emph{You can ignore all byte-compiler warnings!} They are the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
184 result of the supporting different versions of Emacs, and none of the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
185 warnings have any effect on operation. Let me say this again:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
186 @strong{You really can ignore all byte-compiler warnings!}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
187
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
188 Here's what to do to byte-compile the file [in emacs]:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
189 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
190
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
191 M-x byte-compile-file RET ~/mylisp/vhdl-mode.el RET
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
192
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
193 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
194
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
195 Now add the following autoloads to your @file{.emacs} file so that
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
196 @code{vhdl-mode} gets loaded at the right time:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
197 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
198
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
199 (autoload 'vhdl-mode "vhdl-mode" "VHDL Editing Mode" t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
200
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
201 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
202
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
203 Alternatively, if you want to make sure @code{vhdl-mode} is loaded when
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
204 Emacs starts up, you could use this line instead of the autoload above:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
205 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
206
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
207 (require 'vhdl-mode)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
208
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
209 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
210
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
211 Next, you will want to set up Emacs so that it edits VHDL files in
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
212 @code{vhdl-mode}. All users should add the following to their
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
213 @file{.emacs} file. Note that this assumes you'll be editing @code{.vhd}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
214 and files as VHDL. YMMV:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
215 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
216 @group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
217
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
218 (setq auto-mode-alist
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
219 (append
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
220 '(("\\.vhd$" . vhdl-mode)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
221 ) auto-mode-alist))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
222
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
223 @end group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
224 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
225
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
226 That's all you need -- I know, I know, it sounds like a lot @code{:-)},
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
227 but after you've done all this, you should only need to quit and restart
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
228 Emacs. The next time you visit a VHDL file you should be using
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
229 @code{vhdl-mode}. You can check this easily by hitting @kbd{M-x
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
230 vhdl-version RET} in the @code{vhdl-mode} buffer. You should see this
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
231 message in the echo area:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
232 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
233
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
234 Using @code{vhdl-mode} version 2.@var{XXX}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
235
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
236 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
237
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
238 @noindent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
239 where @var{XXX} will be some minor revision number.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
240
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
241 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
242
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
243 @node New Indentation Engine, Indentation Commands, Getting Connected, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
244 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
245
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
246 @chapter New Indentation Engine
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
247 @cindex New Indentation Engine
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
248
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
249 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
250
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
251 @code{vhdl-mode} has a new indentation engine, providing a simplified, yet
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
252 flexible and general mechanism for customizing indentation. It breaks
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
253 indentation calculation into two steps. First for the line of code being
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
254 indented, @code{vhdl-mode} analyzes what kind of language construct it's
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
255 looking at, then it applies user defined offsets to the current line
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
256 based on this analysis.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
257
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
258 This section will briefly cover how indentation is calculated in
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
259 @code{vhdl-mode}. It is important to understand the indentation model
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
260 being used so that you will know how to customize @code{vhdl-mode} for
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
261 your personal coding style.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
262
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
263 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
264 @menu
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
265 * Syntactic Analysis:: Step 1 -- Syntactic Analysis
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
266 * Indentation Calculation:: Step 2 -- Indentation Calculation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
267 @end menu
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
268 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
269
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
270 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
271 @node Syntactic Analysis, Indentation Calculation, , New Indentation Engine
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
272 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
273 @section Syntactic Analysis
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
274 @cindex Syntactic Analysis
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
275 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
276
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
277 @vindex vhdl-offsets-alist
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
278 @vindex offsets-alist (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
279 @cindex relative buffer position
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
280 @cindex syntactic symbol
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
281 @cindex syntactic component
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
282 @cindex syntactic component list
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
283 @cindex relative buffer position
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
284 The first thing @code{vhdl-mode} does when indenting a line of code, is
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
285 to analyze the line, determining the @dfn{syntactic component list} of
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
286 the construct on that line. A @dfn{syntactic component} consists of a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
287 pair of information (in lisp parlance, a @emph{cons cell}), where the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
288 first part is a @dfn{syntactic symbol}, and the second part is a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
289 @dfn{relative buffer position}. Syntactic symbols describe elements of
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
290 VHDL code, e.g. @code{statement}, @code{comment}, @code{block-open},
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
291 @code{block-close}, etc. @xref{Syntactic Symbols}, for a complete list
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
292 of currently recognized syntactic symbols and their semantics. Also,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
293 the variable @code{vhdl-offsets-alist} contains the list of currently
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
294 supported syntactic symbols.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
295
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
296 Conceptually, a line of VHDL code is always indented relative to the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
297 indentation of some line higher up in the buffer. This is represented
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
298 by the relative buffer position in the syntactic component.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
299
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
300 It might help to see an example. Suppose we had the following code as
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
301 the only thing in a @code{vhdl-mode} buffer @footnote{The line numbers
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
302 in this and future examples don't actually appear in the buffer.}:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
303 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
304 @group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
305
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
306 1: inverter : process
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
307 2: begin
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
308 3: q <= not d;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
309 4: wait on d;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
310 5: end inverter;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
311
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
312 @end group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
313 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
314
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
315 @kindex C-c C-s
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
316 @findex vhdl-show-syntactic-information
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
317 @findex show-syntactic-information (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
318 We can use the command @kbd{C-c C-s}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
319 (@code{vhdl-show-syntactic-information}) to simply report what the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
320 syntactic analysis is for the current line. Running this command on
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
321 line 4 of example 1, we'd see in the echo area:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
322 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
323
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
324 ((statement . 28))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
325
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
326 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
327
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
328 This tells us that the line is a statement and it is indented relative
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
329 to buffer position 28, which happens to be the @samp{q} on line 3. If
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
330 you were to move point to line 3 and hit @kbd{C-c C-s}, you would see:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
331 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
332
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
333 ((statement-block-intro . 20))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
334
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
335 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
336
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
337 This indicates that line 3 is the first statement in a block, and is
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
338 indented relative to buffer position 20, which is the @samp{b} in the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
339 @code{begin} keyword on line 2.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
340
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
341 @cindex comment only line
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
342 Syntactic component lists can contain more than one component, and
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
343 individual syntactic compenents need not have relative buffer positions.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
344 The most common example of this is a line that contains a @dfn{comment
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
345 only line}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
346 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
347 @group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
348
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
349 %%% TBD %%%
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
350
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
351 @end group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
352 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
353
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
354 @noindent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
355 Hitting @kbd{C-c C-s} on line 3 of the example gives us:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
356 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
357
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
358 ((comment-intro) (block-intro . 46))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
359
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
360 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
361
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
362 @noindent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
363 so you can see that the syntactic component list contains two syntactic
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
364 components. Also notice that the first component,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
365 @samp{(comment-intro)} has no relative buffer position.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
366
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
367 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
368 @node Indentation Calculation, , Syntactic Analysis, New Indentation Engine
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
369 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
370 @section Indentation Calculation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
371 @cindex Indentation Calculation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
372 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
373
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
374 @vindex vhdl-offsets-alist
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
375 @vindex offsets-alist (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
376 Indentation for the current line is calculated using the syntactic
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
377 component list derived in step 1 above (see @ref{Syntactic
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
378 Analysis}). Each component contributes to the final total indentation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
379 of the line in two ways.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
380
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
381 First, the syntactic symbols are looked up in the @code{vhdl-offsets-alist}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
382 variable, which is an association list of syntactic symbols and the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
383 offsets to apply for those symbols. These offsets are added to the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
384 running total.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
385
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
386 Second, if the component has a relative buffer position, @code{vhdl-mode}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
387 adds the column number of that position to the running total. By adding
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
388 up the offsets and columns for every syntactic component on the list,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
389 the final total indentation for the current line is computed.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
390
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
391 Let's use our code example above to see how this works. Here is our
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
392 example again.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
393 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
394 @group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
395
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
396 1: inverter : process
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
397 2: begin
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
398 3: q <= not d;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
399 4: wait on d;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
400 5: end inverter;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
401
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
402 @end group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
403 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
404
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
405 @kindex TAB
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
406 Let's say point is on line 3 and we hit the @key{TAB} key to re-indent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
407 the line. Remember that the syntactic component list for that
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
408 line is:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
409 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
410
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
411 ((statement-block-intro . 20))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
412
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
413 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
414
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
415 @noindent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
416 @code{vhdl-mode} looks up @code{statement-block-intro} in the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
417 @code{vhdl-offsets-alist} variable. Let's say it finds the value @samp{2};
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
418 it adds this to the running total (initialized to zero), yielding a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
419 running total indentation of 2 spaces.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
420
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
421 Next @code{vhdl-mode} goes to buffer position 20 and asks for the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
422 current column. Since the @code{begin} keyword at buffer position 20 is
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
423 in column zero, it adds @samp{0} to the running total. Since there is
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
424 only one syntactic component on the list for this line, indentation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
425 calculation is complete, and the total indentation for the line is 2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
426 spaces.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
427 Simple, huh?
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
428
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
429 Actually, the mode usually just does The Right Thing without you having
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
430 to think about it in this much detail. But when customizing
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
431 indentation, it's helpful to understand the general indentation model
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
432 being used.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
433
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
434 @vindex vhdl-echo-syntactic-information-p
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
435 @vindex echo-syntactic-information-p (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
436 @cindex TAB
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
437 To help you configure @code{vhdl-mode}, you can set the variable
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
438 @code{vhdl-echo-syntactic-information-p} to non-@code{nil} so that the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
439 syntactic component list and calculated offset will always be echoed in
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
440 the minibuffer when you hit @kbd{TAB}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
441
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
442
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
443 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
444 @node Indentation Commands, Customizing Indentation, New Indentation Engine, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
445 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
446
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
447 @chapter Indentation Commands
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
448 @cindex Indentation Commands
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
449 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
450
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
451 @strong{<TBD>}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
452
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
453 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
454 @node Customizing Indentation, Syntactic Symbols, Indentation Commands, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
455 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
456
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
457 @chapter Customizing Indentation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
458 @cindex Customizing Indentation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
459 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
460
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
461 @cindex vhdl-set-offset
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
462 @cindex set-offset (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
463 The @code{vhdl-offsets-alist} variable is where you customize all your
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
464 indentations. You simply need to decide what additional offset you want
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
465 to add for every syntactic symbol. You can use the command @kbd{C-c
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
466 C-o} (@code{vhdl-set-offset}) as the way to set offsets, both
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
467 interactively and from your mode hook. Also, you can set up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
468 @emph{styles} of indentation. Most likely, you'll find one of the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
469 pre-defined styles will suit your needs, but if not, this section will
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
470 describe how to set up basic editing configurations. @xref{Styles} for
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
471 an explanation of how to set up named styles.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
472
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
473 @cindex vhdl-basic-offset
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
474 @cindex basic-offset (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
475 As mentioned previously, the variable @code{vhdl-offsets-alist} is an
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
476 association list between syntactic symbols and the offsets to be applied
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
477 for those symbols. In fact, these offset values can be an integer, a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
478 function or variable name, or one of the following symbols: @code{+},
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
479 @code{-}, @code{++}, @code{--}, @code{*}, or @code{/}. The symbol
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
480 values have the following meanings:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
481
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
482 @itemize @bullet
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
483
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
484 @item
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
485 @code{+} -- 1 x @code{vhdl-basic-offset}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
486 @item
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
487 @code{-} -- -1 x @code{vhdl-basic-offset}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
488 @item
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
489 @code{++} -- 2 x @code{vhdl-basic-offset}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
490 @item
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
491 @code{--} -- -2 x @code{vhdl-basic-offset}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
492 @item
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
493 @code{*} -- 0.5 x @code{vhdl-basic-offset}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
494 @item
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
495 @code{/} -- -0.5 x @code{vhdl-basic-offset}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
496
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
497 @end itemize
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
498
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
499 @noindent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
500 So, for example, because most of the default offsets are defined in
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
501 terms of @code{+}, @code{-}, and @code{0}, if you like the general
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
502 indentation style, but you use 2 spaces instead of 4 spaces per level,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
503 you can probably achieve your style just by changing
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
504 @code{vhdl-basic-offset} like so (in your @file{.emacs} file):
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
505 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
506
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
507 (setq vhdl-basic-offset 2)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
508
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
509 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
510
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
511 To change indentation styles more radically, you will want to change the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
512 value associated with the syntactic symbols in the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
513 @code{vhdl-offsets-alist} variable. First, I'll show you how to do that
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
514 interactively, then I'll describe how to make changes to your
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
515 @file{.emacs} file so that your changes are more permanent.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
516
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
517 @menu
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
518 * Interactive Customization::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
519 * Permanent Customization::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
520 * Styles::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
521 * Advanced Customizations::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
522 @end menu
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
523
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
524 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
525 @node Interactive Customization, Permanent Customization, , Customizing Indentation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
526 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
527
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
528 @section Interactive Customization
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
529 @cindex Interactive Customization
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
530 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
531
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
532 As an example of how to customize indentation, let's change the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
533 style of the example above from:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
534 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
535 @group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
536
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
537 1: inverter : process
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
538 2: begin
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
539 3: q <= not d;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
540 4: wait on d;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
541 5: end inverter;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
542
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
543 @end group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
544 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
545 @noindent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
546 to:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
547 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
548 @group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
549
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
550 1: inverter : process
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
551 2: begin
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
552 3: q <= not d;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
553 4: wait on d;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
554 5: end inverter;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
555
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
556 @end group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
557 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
558
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
559 In other words, we want to change the indentation of the statments
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
560 inside the inverter process. Notice that the construct we want to
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
561 change starts on line 3. To change the indentation of a line, we need
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
562 to see which syntactic component affect the offset calculations for that
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
563 line. Hitting @kbd{C-c C-s} on line 3 yields:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
564 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
565
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
566 ((statement-block-intro . 20))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
567
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
568 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
569
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
570 @findex vhdl-set-offset
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
571 @findex set-offset (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
572 @kindex C-c C-o
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
573 @noindent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
574 So we know that to change the offset of the first signal assignment, we need to
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
575 change the indentation for the @code{statement-block-intro} syntactic
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
576 symbol. To do this interactively, just hit @kbd{C-c C-o}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
577 (@code{vhdl-set-offset}). This prompts you for the syntactic symbol to
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
578 change, providing a reasonable default. In this case, the default is
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
579 @code{statement-block-intro}, which is just the syntactic symbol we want to
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
580 change!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
581
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
582 After you hit return, @code{vhdl-mode} will then prompt you for the new
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
583 offset value, with the old value as the default. The default in this
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
584 case is @samp{+}, so hit backspace to delete the @samp{+}, then hit
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
585 @samp{++} and @kbd{RET}. This will associate an offset of twice the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
586 basic indent with the syntactic symbol @code{statement-block-intro} in
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
587 the @code{vhdl-offsets-alist} variable.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
588
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
589 @findex vhdl-indent-defun
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
590 @findex indent-defun (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
591 @kindex C-c C-q
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
592 To check your changes quickly, just hit @kbd{C-c C-q}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
593 (@code{vhdl-indent-defun}) to reindent the entire function. The example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
594 should now look like:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
595 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
596 @group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
597
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
598 1: inverter : process
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
599 2: begin
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
600 3: q <= not d;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
601 4: wait on d;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
602 5: end inverter;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
603
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
604 @end group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
605 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
606
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
607 Notice how just changing the offset on line 3 is all we needed to do.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
608 Since the other affected lines are indented relative to line 3, they are
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
609 automatically indented the way you'd expect. For more complicated
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
610 examples, this may not always work. The general approach to take is to
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
611 always start adjusting offsets for lines higher up in the file, then
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
612 re-indent and see if any following lines need further adjustments.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
613
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
614 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
615 @node Permanent Customization, Styles, Interactive Customization, Customizing Indentation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
616 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
617
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
618 @section Permanent Indentation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
619 @cindex Permanent Indentation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
620 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
621
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
622 @vindex vhdl-mode-hook
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
623 @cindex hooks
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
624 To make this change permanent, you need to add some lisp code to your
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
625 @file{.emacs} file. @code{vhdl-mode} provides a @code{vhdl-mode-hook}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
626 that you can use to customize your language editing styles. This hook
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
627 gets run as the last thing when you enter @code{vhdl-mode}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
628
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
629 Here's a simplified example of what you can add to your @file{.emacs}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
630 file to make the changes described in the previous section
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
631 (@ref{Interactive Customization}) more permanent. See the Emacs
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
632 manuals for more information on customizing Emacs via hooks.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
633 @xref{Sample .emacs File} for a more complete sample @file{.emacs} file.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
634 @footnote{The use of @code{add-hook} in this example only works for
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
635 Emacs 19. Workarounds are available if you are using Emacs 18, but this
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
636 just points out another reason for you to upgrade to Emacs 19!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
637 @code{:-)}}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
638 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
639 @group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
640
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
641 (defun my-vhdl-mode-hook ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
642 ;; my customizations for all of vhdl-mode
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
643 (vhdl-set-offset 'statement-block-intro '++)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
644 ;; other customizations can go here
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
645 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
646 (add-hook 'vhdl-mode-hook 'my-vhdl-mode-hook)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
647
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
648 @end group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
649 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
650
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
651 For complex customizations, you will probably want to set up a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
652 @emph{style} that groups all your customizations under a single
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
653 name. @xref{Styles} for details.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
654
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
655 The offset value can also be a function, and this is how power users
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
656 gain enormous flexibility in customizing indentation. @xref{Advanced
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
657 Customizations} for details.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
658
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
659 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
660 @node Styles, Advanced Customizations, Permanent Customization, Customizing Indentation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
661 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
662
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
663 @section Styles
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
664 @cindex Styles
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
665 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
666
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
667 Most people only need to edit code formatted in just a few well-defined
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
668 and consistent styles. For example, their organization might impose a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
669 ``blessed'' style that all its programmers must conform to. Similarly,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
670 people who work on GNU software will have to use the GNU coding style on
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
671 C code. Some shops are more lenient, allowing some variety of coding
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
672 styles, and as programmers come and go, there could be a number of
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
673 styles in use. For this reason, @code{vhdl-mode} makes it convenient for
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
674 you to set up logical groupings of customizations called @dfn{styles},
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
675 associate a single name for any particular style, and pretty easily
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
676 start editing new or existing code using these styles. This chapter
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
677 describes how to set up styles and how to edit your C code using styles.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
678
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
679 @menu
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
680 * Built-in Styles::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
681 * Adding Styles::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
682 * File Styles::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
683 @end menu
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
684
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
685
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
686 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
687 @node Built-in Styles, Adding Styles, , Styles
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
688 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
689
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
690 @subsection Built-in Styles
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
691 @cindex Built-in Styles
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
692 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
693
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
694 If you're lucky, one of @code{vhdl-mode}'s built-in styles might be just
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
695 what you're looking for. Some of the most common VHDL styles are
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
696 already built-in. These include:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
697
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
698 @itemize @bullet
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
699 @item
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
700 @cindex IEEE style
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
701 @code{GNU} -- the coding style in the IEEE Language Reference Manual.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
702
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
703 @end itemize
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
704
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
705 @findex vhdl-set-style
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
706 @findex set-style (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
707 If you'd like to experiment with these built-in styles you can simply
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
708 type the following in a @code{vhdl-mode} buffer:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
709 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
710 @group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
711
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
712 @kbd{M-x vhdl-set-style RET}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
713
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
714 @end group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
715 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
716 @noindent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
717 You will be prompted for one of the above styles (with completion).
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
718 Enter one of the styles and hit @kbd{RET}. Note however that setting a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
719 style in this way does @emph{not} automatically re-indent your file.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
720 For commands that you can use to view the effect of your changes, see
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
721 @ref{Indentation Commands}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
722
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
723 Once you find a built-in style you like, you can make the change
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
724 permanent by adding a call to your @file{.emacs} file. Let's say for
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
725 example that you want to use the @code{IEEE} style in all your
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
726 files. You would add this:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
727 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
728 @group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
729
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
730 (defun my-vhdl-mode-hook ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
731 ;; use IEEE style for all VHDL code
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
732 (vhdl-set-style "IEEE")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
733 ;; other customizations can go here
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
734 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
735 (add-hook 'vhdl-mode-hook 'my-vhdl-mode-hook)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
736
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
737 @end group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
738 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
739
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
740 @noindent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
741 @xref{Permanent Customization}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
742
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
743 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
744 @node Adding Styles, File Styles, Built-in Styles, Styles
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
745 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
746
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
747 @subsection Adding Styles
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
748 @cindex Adding Styles
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
749 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
750
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
751 @vindex vhdl-style-alist
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
752 @vindex style-alist (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
753 @findex vhdl-add-style
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
754 @findex add-style (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
755 If none of the built-in styles is appropriate, you'll probably want to
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
756 add a new style definition. Styles are kept in the @code{vhdl-style-alist}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
757 variable, but you probably won't want to modify this variable directly.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
758 @code{vhdl-mode} provides a function, called @code{vhdl-add-style}, that you
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
759 can use to easily add new styles or update existing styles. This
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
760 function takes two arguments, a @var{stylename} string, and an
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
761 association list @var{description} of style customizations. If
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
762 @var{stylename} is not already in @code{vhdl-style-alist}, the new style is
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
763 added, otherwise the style already associated with @var{stylename} is
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
764 changed to the new @var{description}. This function also takes an
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
765 optional third argument, which if non-@code{nil}, automatically
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
766 institutes the new style in the current buffer.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
767
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
768 The sample @file{.emacs} file provides a concrete example of how a new
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
769 style can be added and automatically set. @xref{Sample .emacs File}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
770
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
771 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
772 @node File Styles, , Adding Styles, Styles
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
773 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
774
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
775 @subsection File Styles
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
776 @cindex File Styles
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
777 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
778
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
779 @cindex local variables
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
780 The Emacs manual describes how you can customize certain variables on a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
781 per-file basis by including a @dfn{Local Variable} block at the end of
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
782 the file. So far, you've only seen a functional interface to
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
783 @code{vhdl-mode}, which is highly inconvenient for use in a Local Variable
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
784 block. @code{vhdl-mode} provides two variables that make it easier for
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
785 you to customize your style on a per-file basis.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
786
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
787 @vindex vhdl-file-style
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
788 @vindex file-style (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
789 @vindex vhdl-file-offsets
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
790 @vindex file-offsets (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
791
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
792 The variable @code{vhdl-file-style} can be set to a style name string as
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
793 described in @ref{Built-in Styles}. When the file is visited,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
794 @code{vhdl-mode} will automatically set the file's style to this style
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
795 using @code{vhdl-set-style}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
796
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
797 @vindex vhdl-offsets-alist
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
798 @vindex offsets-alist (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
799 @findex vhdl-set-offset
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
800 @findex set-offset (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
801 Another variable, @code{vhdl-file-offsets}, takes an association list
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
802 similar to what is allowed in @code{vhdl-offsets-alist}. When the file is
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
803 visited, @code{vhdl-mode} will automatically institute these offets using
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
804 @code{vhdl-set-offset}. @xref{Customizing Indentation}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
805
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
806 Note that file style settings (i.e. @code{vhdl-file-style}) are applied
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
807 before file offset settings (i.e. @code{vhdl-file-offsets}).
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
808
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
809
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
810 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
811 @node Advanced Customizations, , Styles, Customizing Indentation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
812 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
813
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
814 @section Advanced Customizations
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
815 @cindex Advanced Customizations
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
816 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
817
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
818 @vindex vhdl-style-alist
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
819 @vindex style-alist (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
820 @vindex vhdl-basic-offset
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
821 @vindex basic-offset (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
822 For most users, @code{vhdl-mode} will support their coding styles with
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
823 very little need for customizations. Usually, one of the standard
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
824 styles defined in @code{vhdl-style-alist} will do the trick. Sometimes,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
825 one of the syntactic symbol offsets will need to be tweeked slightly, or
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
826 perhaps @code{vhdl-basic-offset} will need to be changed. However, some
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
827 styles require a more advanced ability for customization, and one of the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
828 real strengths of @code{vhdl-mode} is that the syntactic analysis model
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
829 provides a very flexible framework for customizing indentation. This
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
830 allows you to perform special indentation calculations for situations
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
831 not handled by the mode directly.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
832
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
833 @menu
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
834 * Custom Indentation Functions::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
835 * Other Special Indentations::
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
836 @end menu
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
837
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
838 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
839 @node Custom Indentation Functions, Other Special Indentations, , Advanced Customizations
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
840 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
841
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
842 @subsection Custom Indentation Functions
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
843 @cindex Custom Indentation Functions
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
844 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
845
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
846 @cindex custom indentation functions
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
847 One of the most common ways to customize @code{vhdl-mode} is by writing
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
848 @dfn{custom indentation functions} and associating them with specific
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
849 syntactic symbols (see @ref{Syntactic Symbols}). @code{vhdl-mode} itself
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
850 uses custom indentation functions to provide more sophisticated
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
851 indentation, for example when lining up selected signal assignments:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
852 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
853 @group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
854
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
855 %%% TBD %%%
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
856
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
857 @end group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
858 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
859
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
860 In this example, the @code{statement-cont} syntactic symbol has an
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
861 offset of @code{+}, and @code{vhdl-basic-offset} is 2, so lines 4
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
862 through 6 are simply indented two spaces to the right of line 3. But
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
863 perhaps we'd like @code{vhdl-mode} to be a little more intelligent so
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
864 that it offsets the waveform descriptions relative to the signal
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
865 assignment operator in line 3. To do this, we have to write a custom
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
866 indentation function which finds the column of signal assignment
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
867 operator on the first line of the statement. Here is the lisp code
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
868 (from the @file{vhdl-mode.el} source file) that implements this:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
869 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
870 @group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
871
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
872 (defun vhdl-lineup-statement-cont (langelem)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
873 ;; line up statement-cont after the assignment operator
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
874 (save-excursion
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
875 (let* ((relpos (cdr langelem))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
876 (assignp (save-excursion
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
877 (goto-char (vhdl-point 'boi))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
878 (and (re-search-forward "\\(<\\|:\\)="
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
879 (vhdl-point 'eol) t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
880 (- (point) (vhdl-point 'boi)))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
881 (curcol (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
882 (goto-char relpos)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
883 (current-column)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
884 foundp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
885 (while (and (not foundp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
886 (< (point) (vhdl-point 'eol)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
887 (re-search-forward "\\(<\\|:\\)=\\|(" (vhdl-point 'eol) 'move)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
888 (if (vhdl-in-literal (cdr langelem))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
889 (forward-char)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
890 (if (= (preceding-char) ?\()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
891 ;; skip over any parenthesized expressions
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
892 (goto-char (min (vhdl-point 'eol)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
893 (scan-lists (point) 1 1)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
894 ;; found an assignment operator (not at eol)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
895 (setq foundp (not (looking-at "\\s-*$"))))))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
896 (if (not foundp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
897 ;; there's no assignment operator on the line
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
898 vhdl-basic-offset
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
899 ;; calculate indentation column after assign and ws, unless
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
900 ;; our line contains an assignment operator
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
901 (if (not assignp)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
902 (progn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
903 (forward-char)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
904 (skip-chars-forward " \t")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
905 (setq assignp 0)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
906 (- (current-column) assignp curcol))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
907 )))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
908
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
909 @end group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
910 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
911 @noindent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
912 Custom indent functions take a single argument, which is a syntactic
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
913 component cons cell (see @ref{Syntactic Analysis}). The
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
914 function returns an integer offset value that will be added to the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
915 running total indentation for the lne. Note that what actually gets
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
916 returned is the difference between the column that the signal assignment
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
917 operator is on, and the column of the buffer relative position passed in
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
918 the function's argument. Remember that @code{vhdl-mode} automatically
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
919 adds in the column of the component's relative buffer position and we
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
920 don't want that value added into the final total twice.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
921
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
922 @cindex statement-cont syntactic symbol
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
923 @findex vhdl-lineup-statement-cont
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
924 @findex lineup-statement-cont (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
925 Now, to associate the function @code{vhdl-lineup-statement-cont} with the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
926 @code{statement-cont} syntactic symbol, we can add something like the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
927 following to our @code{vhdl-mode-hook}:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
928 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
929
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
930 (vhdl-set-offset 'statement-cont 'vhdl-lineup-statement-cont)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
931
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
932 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
933
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
934 @kindex C-c C-q
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
935 Now the function looks like this after re-indenting (using @kbd{C-c
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
936 C-q}):
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
937 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
938 @group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
939
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
940 %%% TBD %%%
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
941
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
942 @end group
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
943 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
944
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
945 @vindex vhdl-offsets-alist
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
946 @vindex offsets-alist (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
947 Custom indentation functions can be as simple or as complex as you like,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
948 and any syntactic symbol that appears in @code{vhdl-offsets-alist} can have
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
949 a custom indentation function associated with it. Note however that
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
950 using many custom indentation functions may have a performance impact on
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
951 @code{vhdl-mode}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
952
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
953 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
954 @node Other Special Indentations, , Custom Indentation Functions, Advanced Customizations
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
955 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
956
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
957 @subsection Other Special Indentations
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
958 @cindex Other Special Indentations
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
959 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
960
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
961 @vindex vhdl-special-indent-hook
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
962 @vindex special-indent-hook (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
963 One other variable is available for you to customize @code{vhdl-mode}:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
964 @code{vhdl-special-indent-hook}. This is a standard hook variable that
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
965 is called after every line is indented by @code{vhdl-mode}. You can use
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
966 it to do any special indentation or line adjustments your style
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
967 dictates, such as adding extra indentation to the port map clause in a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
968 component instantiation, etc. Note however, that you should not change
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
969 @code{point} or @code{mark} inside your @code{vhdl-special-indent-hook}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
970 functions.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
971
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
972
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
973 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
974 @node Syntactic Symbols, Frequently Asked Questions, Customizing Indentation, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
975 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
976
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
977 @chapter Syntactic Symbols
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
978 @cindex Syntactic Symbols
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
979 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
980
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
981 @vindex vhdl-offsets-alist
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
982 The complete list of recognized syntactic symbols is described in the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
983 @code{vhdl-offsets-alist} variable. This chapter will provide some
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
984 examples to help clarify these symbols.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
985
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
986 @cindex -open syntactic symbols
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
987 @cindex -close syntactic symbols
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
988 Most syntactic symbol names follow a general naming convention. When a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
989 line begins with a @code{begin} or @code{end} keyword, the syntactic
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
990 symbol will contain the suffix @code{-open} or @code{-close}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
991 respectively.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
992
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
993 @cindex -intro syntactic symbols
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
994 @cindex -cont syntactic symbols
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
995 @cindex -block-intro syntactic symbols
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
996 Usually, a distinction is made between the first line that introduces a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
997 construct and lines that continue a construct, and the syntactic symbols
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
998 that represent these lines will contain the suffix @code{-intro} or
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
999 @code{-cont} respectively. As a sub-classification of this scheme, a
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1000 line which is the first of a particular block construct will contain the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1001 suffix @code{-block-intro}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1002
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1003 @strong{<TBD> include the name and a brief example of every syntactic
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1004 symbol currently recognized}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1005
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1006 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1007 @node Frequently Asked Questions, Getting the latest vhdl-mode release, Syntactic Symbols, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1008 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1009
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1010 @chapter Frequently Asked Questions
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1011 @cindex Frequently Asked Questions
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1012 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1013
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1014 @kindex C-x h
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1015 @kindex ESC C-\
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1016 @kindex C-c C-q
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1017 @kindex ESC C-q
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1018 @kindex ESC C-u
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1019 @kindex RET
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1020 @kindex LFD
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1021 @findex newline-and-indent
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1022 @quotation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1023
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1024 @strong{Q.} @emph{How do I re-indent the whole file?}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1025
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1026 @strong{A.} Visit the file and hit @kbd{C-x h} to mark the whole
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1027 buffer. Then hit @kbd{@key{ESC} C-\} to re-indent the entire region
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1028 which you've just marked.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1029 @sp 2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1030
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1031 @strong{Q.} @emph{How do I re-indent the entire function?}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1032
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1033 @strong{A.} Hit @kbd{@key{ESC} C-h} to mark the entire function. Then
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1034 hit @kbd{@key{ESC} C-\} to re-indent the entire region which you've just
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1035 marked.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1036 @sp 2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1037
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1038 @strong{Q.} @emph{How do I re-indent the current block?}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1039
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1040 @strong{A.} First move to the brace which opens the block with
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1041 @kbd{@key{ESC} C-u}, then re-indent that expression with
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1042 @kbd{@key{ESC} C-q}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1043 @sp 2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1044
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1045 @strong{Q.} @emph{How do I re-indent the current statement?}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1046
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1047 @strong{A.} First move to the beginning of the statement with
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1048 @kbd{@key{ESC} a}, then re-indent that expression with @kbd{@key{ESC}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1049 C-q}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1050 @sp 2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1051
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1052 @strong{Q.} @emph{Why doesn't the @key{RET} key indent the line to
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1053 where the new text should go after inserting the newline?}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1054
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1055 @strong{A.} Emacs' convention is that @key{RET} just adds a newline,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1056 and that @key{LFD} adds a newline and indents it. You can make
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1057 @key{RET} do this too by adding this to your
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1058 @code{vhdl-mode-hook} (see the sample @file{.emacs} file
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1059 @ref{Sample .emacs File}):
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1060 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1061
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1062 (define-key vhdl-mode-map "\C-m" 'newline-and-indent)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1063
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1064 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1065
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1066 This is a very common question. @code{:-)} If you want this to be the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1067 default behavior, don't lobby me, lobby RMS!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1068 @sp 2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1069
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1070 @strong{Q.} @emph{I put @code{(vhdl-set-offset 'statement-cont 0)}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1071 in my @file{.emacs} file but I get an error saying that
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1072 @code{vhdl-set-offset}'s function definition is void.}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1073
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1074 @strong{A.} This means that @code{vhdl-mode} wasn't loaded into your
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1075 Emacs session by the time the @code{vhdl-set-offset} call was reached,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1076 mostly likely because @code{vhdl-mode} is being autoloaded. Instead
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1077 of putting the @code{vhdl-set-offset} line in your top-level
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1078 @file{.emacs} file, put it in your @code{vhdl-mode-hook}, or
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1079 simply add the following to the top of your @file{.emacs} file:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1080 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1081
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1082 (require 'vhdl-mode)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1083
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1084 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1085
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1086 See the sample @file{.emacs} file @ref{Sample .emacs File} for
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1087 details.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1088
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1089 @end quotation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1090
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1091
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1092 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1093 @node Getting the latest vhdl-mode release, Sample .emacs File, Frequently Asked Questions, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1094 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1095
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1096 @chapter Getting the latest @code{vhdl-mode} release
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1097 @cindex Getting the latest @code{vhdl-mode} release
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1098 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1099
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1100 The best way to be sure you always have the latest @code{vhdl-mode}
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1101 release is to join the @code{vhdl-mode-announce} mailing list. If you
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1102 are a brave soul, and wish to participate in beta testing of new
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1103 releases of @code{vhdl-mode}, you may also join the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1104 @code{vhdl-mode-victims} mailing list. Send email to the author to join
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1105 either of these lists.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1106
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1107 The canonical anonymous FTP URL for @code{vhdl-mode} is
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1108 @code{ftp://ftp.eda.com.au/pub/emacs/vhdl-mode.tar.gz}. Special thanks
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1109 to Ken Wood <ken@@eda.com.au> for providing an FTP repository for
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1110 @code{vhdl-mode}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1111
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1112 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1113 @node Sample .emacs File, Requirements, Getting the latest vhdl-mode release, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1114 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1115
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1116 @chapter Sample @file{.emacs} file
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1117 @cindex Sample @file{.emacs} file
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1118 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1119
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1120 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1121 ;; Here's a sample .emacs file that might help you along the way. Just
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1122 ;; copy this region and paste it into your .emacs file. You may want to
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1123 ;; change some of the actual values.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1124
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1125 (defconst my-vhdl-style
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1126 '((vhdl-tab-always-indent . t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1127 (vhdl-comment-only-line-offset . 4)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1128 (vhdl-offsets-alist . ((arglist-close . vhdl-lineup-arglist)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1129 (statement-cont . 0)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1130 (case-alternative . 4)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1131 (block-open . 0)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1132 (vhdl-echo-syntactic-information-p . t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1133 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1134 "My VHDL Programming Style")
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1135
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1136 ;; Customizations for vhdl-mode
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1137 (defun my-vhdl-mode-hook ()
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1138 ;; add my personal style and set it for the current buffer
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1139 (vhdl-add-style "PERSONAL" my-vhdl-style t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1140 ;; offset customizations not in my-vhdl-style
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1141 (vhdl-set-offset 'statement-case-intro '++)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1142 ;; other customizations
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1143 (setq tab-width 8
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1144 ;; this will make sure spaces are used instead of tabs
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1145 indent-tabs-mode nil)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1146 ;; keybindings for VHDL are put in vhdl-mode-map
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1147 (define-key vhdl-mode-map "\C-m" 'newline-and-indent)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1148 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1149
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1150 ;; the following only works in Emacs 19
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1151 ;; Emacs 18ers can use (setq vhdl-mode-hook 'my-vhdl-mode-hook)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1152 (add-hook 'vhdl-mode-hook 'my-vhdl-mode-hook)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1153 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1154
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1155 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1156 @node Requirements, Limitations and Known Bugs, Sample .emacs File, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1157 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1158 @chapter Requirements
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1159 @cindex Requirements
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1160 @comment * Requirements
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1161 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1162
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1163 @cindex reporter.el
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1164 @file{vhdl-mode.el} requires @file{reporter.el} for submission of bug
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1165 reports. @file{reporter.el} is distributed with the latest FSF and
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1166 XEmacs 19's. Here is the Emacs Lisp Archive anonymous ftp'ing
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1167 record for those of you who are using older Emacsen.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1168
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1169 @comment * Here's the Emacs Lisp Archive information for @file{reporter.el}:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1170 @example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1171
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1172 GNU Emacs Lisp Code Directory Apropos -- "reporter"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1173 "~/" refers to archive.cis.ohio-state.edu:/pub/gnu/emacs/elisp-archive/
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1174
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1175 reporter (2.12) 06-Jul-1994
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1176 Barry A. Warsaw, <bwarsaw@@cen.com>
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1177 ~/misc/reporter.el.Z
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1178 Customizable bug reporting of lisp programs.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1179
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1180 @end example
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1181
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1182 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1183 @node Limitations and Known Bugs, Mailing Lists and Submitting Bug Reports, Requirements, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1184 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1185 @chapter Limitations and Known Bugs
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1186 @cindex Limitations and Known Bugs
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1187 @comment * Limitations and Known Bugs
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1188 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1189
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1190 @itemize @bullet
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1191 @item
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1192 Re-indenting large regions or expressions can be slow.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1193
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1194 @item
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1195 Use with Emacs 18 can be slow and annoying. You should seriously
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1196 consider upgrading to Emacs 19.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1197
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1198 @end itemize
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1199
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1200 @node Mailing Lists and Submitting Bug Reports, Concept Index, Limitations and Known Bugs, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1201 @comment node-name, next, previous,up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1202 @chapter Mailing Lists and Submitting Bug Reports
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1203 @cindex Mailing Lists and Submitting Bug Reports
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1204 @comment * Mailing Lists and Submitting Bug Reports
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1205
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1206 @kindex C-c C-b
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1207 @findex vhdl-submit-bug-report
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1208 @findex submit-bug-report (vhdl-)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1209 @cindex beta testers mailing list
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1210 @cindex announcement mailing list
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1211 To report bugs, use the @kbd{C-c C-b} (@code{vhdl-submit-bug-report})
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1212 command. This provides vital information I need to reproduce your
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1213 problem. Make sure you include a concise, but complete code example.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1214 Please try to boil your example down to just the essential code needed
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1215 to reproduce the problem, and include an exact recipe of steps needed to
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1216 expose the bug. Be especially sure to include any code that appears
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1217 @emph{before} your bug example.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1218
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1219 For other help or suggestions, send a message to
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1220 @code{rwhitby@@asc.corp.mot.com}.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1221
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1222 Send an add message to @code{rwhitby@@asc.corp.mot.com} to get on the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1223 @code{vhdl-mode-victims} beta testers list where beta releases of
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1224 @code{vhdl-mode} are posted. Note that you shouldn't expect beta
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1225 releases to be as stable as public releases.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1226
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1227 There is also an announce only list where the latest public releases of
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1228 @code{vhdl-mode} are posted. Send an add message to
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1229 @code{rwhitby@@asc.corp.mot.com} to be added to this list.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1230
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1231 @c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1232 @node Concept Index, Command Index, Mailing Lists and Submitting Bug Reports, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1233 @comment node-name, next, previous, up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1234 @unnumbered Concept Index
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1235 @c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1236
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1237 @printindex cp
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1238
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1239
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1240 @c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1241 @node Command Index, Key Index, Concept Index, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1242 @comment node-name, next, previous, up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1243 @unnumbered Command Index
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1244 @c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1245
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1246 @ifinfo
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1247
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1248 @end ifinfo
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1249 Since all @code{vhdl-mode} commands are prepended with the string
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1250 @samp{vhdl-}, each appears under its @code{vhdl-<thing>} name and its
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1251 @code{<thing> (vhdl-)} name.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1252 @iftex
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1253 @sp 2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1254 @end iftex
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1255 @printindex fn
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1256
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1257
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1258 @c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1259 @node Key Index, Variable Index, Command Index, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1260 @comment node-name, next, previous, up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1261 @unnumbered Key Index
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1262 @c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1263
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1264 @printindex ky
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1265
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1266
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1267 @c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1268 @node Variable Index, , Key Index, Top
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1269 @comment node-name, next, previous, up
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1270 @unnumbered Variable Index
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1271 @c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1272
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1273 @ifinfo
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1274
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1275 @end ifinfo
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1276 Since all @code{vhdl-mode} variables are prepended with the string
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1277 @samp{vhdl-}, each appears under its @code{vhdl-<thing>} name and its
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1278 @code{<thing> (vhdl-)} name.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1279 @iftex
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1280 @sp 2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1281 @end iftex
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1282 @printindex vr
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1283 @summarycontents
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1284 @contents
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1285 @bye