aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2006-12-17 22:04:05 +0000
committerAlan Mackenzie2006-12-17 22:04:05 +0000
commitaca2cfd2b6b71b4f0e3951ce6227385111f3e852 (patch)
treefe3e45d403f0fd934620c7d514553361e202b9d8
parentfe963f844bbb6feaf626e1aa096c12e7681f603d (diff)
downloademacs-aca2cfd2b6b71b4f0e3951ce6227385111f3e852.tar.gz
emacs-aca2cfd2b6b71b4f0e3951ce6227385111f3e852.zip
programs.texi (Left Margin Paren): Remove the bit which says
that CC Mode sets open-paren-in-column-0-is-defun-start to nil. Discuss some of the issues of setting this option to nil.
-rw-r--r--man/programs.texi51
1 files changed, 29 insertions, 22 deletions
diff --git a/man/programs.texi b/man/programs.texi
index fb85e470f86..200c787cf08 100644
--- a/man/programs.texi
+++ b/man/programs.texi
@@ -156,23 +156,11 @@ from Lisp, but in Emacs we use it for all languages.
156@cindex open-parenthesis in leftmost column 156@cindex open-parenthesis in leftmost column
157@cindex ( in leftmost column 157@cindex ( in leftmost column
158 Emacs assumes by default that any opening delimiter found at the 158 Emacs assumes by default that any opening delimiter found at the
159left margin is the start of a top-level definition, or defun. You can 159left margin is the start of a top-level definition, or defun.
160override this default by setting this user option: 160Therefore, @strong{don't put an opening delimiter at the left margin
161 161unless it should have that significance}. For instance, never put an
162@defvar open-paren-in-column-0-is-defun-start
163If this user option is set to @code{t} (the default), opening
164parentheses or braces at column zero always start defuns. When it's
165@code{nil}, defuns are found by searching for parens or braces at the
166outermost level. Some major modes, including C and related modes, set
167@code{open-paren-in-column-0-is-defun-start} buffer-locally to
168@code{nil}
169@end defvar
170
171 In modes where @code{open-paren-in-column-0-is-defun-start} is
172@code{t}, @strong{don't put an opening delimiter at the left margin
173unless it is a defun start}. For instance, never put an
174open-parenthesis at the left margin in a Lisp file unless it is the 162open-parenthesis at the left margin in a Lisp file unless it is the
175start of a top-level list. 163start of a top-level list.
176 164
177 If you don't follow this convention, not only will you have trouble 165 If you don't follow this convention, not only will you have trouble
178when you explicitly use the commands for motion by defuns; other 166when you explicitly use the commands for motion by defuns; other
@@ -182,10 +170,10 @@ mode (@pxref{Font Lock}).
182 170
183 The most likely problem case is when you want an opening delimiter 171 The most likely problem case is when you want an opening delimiter
184at the start of a line inside a string. To avoid trouble, put an 172at the start of a line inside a string. To avoid trouble, put an
185escape character (@samp{\}, in Emacs Lisp, @samp{/} in some other Lisp 173escape character (@samp{\}, in C and Emacs Lisp, @samp{/} in some
186dialects) before the opening delimiter. This will not affect the 174other Lisp dialects) before the opening delimiter. This will not
187contents of the string, but will prevent that opening delimiter from 175affect the contents of the string, but will prevent that opening
188starting a defun. Here's an example: 176delimiter from starting a defun. Here's an example:
189 177
190@example 178@example
191 (insert "Foo: 179 (insert "Foo:
@@ -197,6 +185,25 @@ starting a defun. Here's an example:
197highlights confusing opening delimiters (those that ought to be 185highlights confusing opening delimiters (those that ought to be
198quoted) in bold red. 186quoted) in bold red.
199 187
188If you need to override this convention, you can so by setting this
189user option:
190
191@defvar open-paren-in-column-0-is-defun-start
192If this user option is set to @code{t} (the default), opening
193parentheses or braces at column zero always start defuns. When it's
194@code{nil}, defuns are found by searching for parens or braces at the
195outermost level.
196@end defvar
197
198 Usually, you shouldn't need to set
199@code{open-paren-in-column-0-is-defun-start} to @code{nil}. However,
200if your buffer contains parentheses or braces in column zero which
201don't start defuns and this confuses Emacs, it sometimes helps to set
202the option to @code{nil}. Be aware, though, that this will make
203scrolling and display in large buffers quite sluggish, and that
204parentheses and braces must be correctly matched throughout the buffer
205for it to work properly.
206
200 In the earliest days, the original Emacs found defuns by moving 207 In the earliest days, the original Emacs found defuns by moving
201upward a level of parentheses or braces until there were no more 208upward a level of parentheses or braces until there were no more
202levels to go up. This always required scanning all the way back to 209levels to go up. This always required scanning all the way back to
@@ -1557,10 +1564,10 @@ preprocessor commands.
1557@table @kbd 1564@table @kbd
1558@item C-c C-@key{DEL} 1565@item C-c C-@key{DEL}
1559@itemx C-c @key{DEL} 1566@itemx C-c @key{DEL}
1560@findex c-hungry-backspace 1567@findex c-hungry-delete-backwards
1561@kindex C-c C-@key{DEL} (C Mode) 1568@kindex C-c C-@key{DEL} (C Mode)
1562@kindex C-c @key{DEL} (C Mode) 1569@kindex C-c @key{DEL} (C Mode)
1563@code{c-hungry-backspace}---Delete the entire block of whitespace 1570@code{c-hungry-delete-backwards}---Delete the entire block of whitespace
1564preceding point. 1571preceding point.
1565 1572
1566@item C-c C-d 1573@item C-c C-d