unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Joe Kelsey <joe@zircon.seattle.wa.us>
Subject: cc-mode interaction with noweb-mode
Date: 18 Jan 2003 16:56:35 -0800	[thread overview]
Message-ID: <1042937794.4591.14.camel@zircon> (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


             reply	other threads:[~2003-01-19  0:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-19  0:56 Joe Kelsey [this message]
2003-01-19  2:27 ` cc-mode interaction with noweb-mode Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1042937794.4591.14.camel@zircon \
    --to=joe@zircon.seattle.wa.us \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).