[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Visit the file and hit C-x h to mark the whole buffer. Then hit C-M-\.
First move to the brace which opens the block with C-M-u, then reindent that expression with C-M-q.
Emacs' convention is that RET just adds a newline, and that
C-j adds a newline and indents it. You can make RET do this
too by adding this to your c-mode-common-hook
:
(define-key c-mode-base-map "\C-m" 'c-context-line-break) |
This is a very common question. If you want this to be the default behavior, don't lobby me, lobby RMS! :-)
(c-set-offset 'substatement-open 0)
in my
`.emacs' file but I get an error saying that c-set-offset
's
function definition is void. What's wrong?
This means that CC Mode wasn't loaded into your Emacs session by the
time the c-set-offset
call was reached, most likely because
CC Mode is being autoloaded. Instead of putting the
c-set-offset
line in your top-level `.emacs' file, put it in
your c-mode-common-hook
, or simply modify c-offsets-alist
directly:
(setq c-offsets-alist '((substatement-open . 0))) |
Use C-M-f and C-M-b to move over balanced brace blocks. Use M-a and M-e to move by statements, which will also move into blocks.
Invalid function: (macro . #[...
. What gives?
This is a common error when CC Mode hasn't been compiled correctly, especially under Emacs 19.34(37). If you are using the standalone CC Mode distribution, try recompiling it according to the instructions in the `README' file.
It's due to the ad-hoc rule in (X)Emacs that such open parens always start defuns (which translates to functions, classes, namespaces or any other top-level block constructs in the CC Mode languages). See section `Left Margin Paren' in The Emacs Editor, for details (See section `Defuns' in The Emacs Editor, in the Emacs 20 manual).
This heuristic is built into the core syntax analysis routines in (X)Emacs, so it's not really a CC Mode issue. However, in Emacs 21.4 it has become possible to turn it off(38) and CC Mode does so there since it got its own system to keep track of blocks.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by XEmacs shared group account on December, 19 2009
using texi2html 1.65.