unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* cc-mode interaction with noweb-mode
@ 2003-01-19  0:56 Joe Kelsey
  2003-01-19  2:27 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Kelsey @ 2003-01-19  0:56 UTC (permalink / raw)


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




-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com - A 128-bit supercerts will
allow you to extend the highest allowed 128 bit encryption to all your 
clients even if they use browsers that are limited to 40 bit encryption. 
Get a guide here:http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0030en


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: cc-mode interaction with noweb-mode
  2003-01-19  0:56 cc-mode interaction with noweb-mode Joe Kelsey
@ 2003-01-19  2:27 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2003-01-19  2:27 UTC (permalink / raw)
  Cc: emacs-devel

> Does anyone have any good ideas to follow up with?

Have you checked with mmm-mode.sf.net to see how they solve the same
kind of problems (though in a more generic setting) ?


	Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-01-19  2:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-19  0:56 cc-mode interaction with noweb-mode Joe Kelsey
2003-01-19  2:27 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).