diff options
author | Alan Mackenzie <acm@muc.de> | 2006-12-17 22:04:05 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2006-12-17 22:04:05 +0000 |
commit | aca2cfd2b6b71b4f0e3951ce6227385111f3e852 (patch) | |
tree | fe3e45d403f0fd934620c7d514553361e202b9d8 /man | |
parent | fe963f844bbb6feaf626e1aa096c12e7681f603d (diff) | |
download | emacs-aca2cfd2b6b71b4f0e3951ce6227385111f3e852.tar.gz |
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.
Diffstat (limited to 'man')
-rw-r--r-- | man/programs.texi | 51 |
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. @cindex open-parenthesis in leftmost column @cindex ( in leftmost column Emacs assumes by default that any opening delimiter found at the -left margin is the start of a top-level definition, or defun. You can -override this default by setting this user option: - -@defvar open-paren-in-column-0-is-defun-start -If this user option is set to @code{t} (the default), opening -parentheses or braces at column zero always start defuns. When it's -@code{nil}, defuns are found by searching for parens or braces at the -outermost level. Some major modes, including C and related modes, set -@code{open-paren-in-column-0-is-defun-start} buffer-locally to -@code{nil} -@end defvar - - In modes where @code{open-paren-in-column-0-is-defun-start} is -@code{t}, @strong{don't put an opening delimiter at the left margin -unless it is a defun start}. For instance, never put an +left margin is the start of a top-level definition, or defun. +Therefore, @strong{don't put an opening delimiter at the left margin +unless it should have that significance}. For instance, never put an open-parenthesis at the left margin in a Lisp file unless it is the -start of a top-level list. +start of a top-level list. If you don't follow this convention, not only will you have trouble when you explicitly use the commands for motion by defuns; other @@ -182,10 +170,10 @@ mode (@pxref{Font Lock}). The most likely problem case is when you want an opening delimiter at the start of a line inside a string. To avoid trouble, put an -escape character (@samp{\}, in Emacs Lisp, @samp{/} in some other Lisp -dialects) before the opening delimiter. This will not affect the -contents of the string, but will prevent that opening delimiter from -starting a defun. Here's an example: +escape character (@samp{\}, in C and Emacs Lisp, @samp{/} in some +other Lisp dialects) before the opening delimiter. This will not +affect the contents of the string, but will prevent that opening +delimiter from starting a defun. Here's an example: @example (insert "Foo: @@ -197,6 +185,25 @@ starting a defun. Here's an example: highlights confusing opening delimiters (those that ought to be quoted) in bold red. +If you need to override this convention, you can so by setting this +user option: + +@defvar open-paren-in-column-0-is-defun-start +If this user option is set to @code{t} (the default), opening +parentheses or braces at column zero always start defuns. When it's +@code{nil}, defuns are found by searching for parens or braces at the +outermost level. +@end defvar + + Usually, you shouldn't need to set +@code{open-paren-in-column-0-is-defun-start} to @code{nil}. However, +if your buffer contains parentheses or braces in column zero which +don't start defuns and this confuses Emacs, it sometimes helps to set +the option to @code{nil}. Be aware, though, that this will make +scrolling and display in large buffers quite sluggish, and that +parentheses and braces must be correctly matched throughout the buffer +for it to work properly. + In the earliest days, the original Emacs found defuns by moving upward a level of parentheses or braces until there were no more levels to go up. This always required scanning all the way back to @@ -1557,10 +1564,10 @@ preprocessor commands. @table @kbd @item C-c C-@key{DEL} @itemx C-c @key{DEL} -@findex c-hungry-backspace +@findex c-hungry-delete-backwards @kindex C-c C-@key{DEL} (C Mode) @kindex C-c @key{DEL} (C Mode) -@code{c-hungry-backspace}---Delete the entire block of whitespace +@code{c-hungry-delete-backwards}---Delete the entire block of whitespace preceding point. @item C-c C-d |