emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cc-mode interaction with noweb-mode


From: Joe Kelsey
Subject: cc-mode interaction with noweb-mode
Date: 18 Jan 2003 16:56:35 -0800

I am interested in improving the interaction between cc-mode and
noweb-mode.  The current noweb-mode does an adequate job of switching
font-lock as the point moves between documentation chunks and code
chunks, but minor characters in documentation chunks can radically alter
the indentation engine in code chunks.  For instance, the simple
apostrophe in documentation can cause the indentation engine to think it
has encountered an unterminated string.  Also, if you intermix different
code chunks, the indentation engine can become quite confused.

noweb-mode maintains a list of all of the different chunks currently
active in the document and it has the functions noweb-next-chunk and
noweb-previous-chunk to move forward and back within named chunks.  I
was thinking that a modification to c-forward-syntactic-ws could make it
move between chunks when it reaches the beginning or end of a chunk,
thus fooling the indentation engine into skipping over stuff it doesn't
need to worry about.

However, it is a nice theory, but difficult to implement.  First of all,
noweb-mode only keeps track of the beginning of different chunks, not
the end!  We could solve that by making cc-mode notice an @ at bol to
signal end of chunk, but it would also have to notice the >>= at eol to
notice the beginning of a chunk.  This is a different thing than just
keeping track of comments, as we don't want it to try to do any
formatting outside of its assigned space.

Could some sort of narrowing work here?

Does anyone have any good ideas to follow up with?

Thanks.
/Joe






reply via email to

[Prev in Thread] Current Thread [Next in Thread]