emacs-devel
[Top][All Lists]
Advanced

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

CC Mode in MMM Mode(s). [Was: Re: [Emacs-diffs] scratch/widen-less a4ba


From: Alan Mackenzie
Subject: CC Mode in MMM Mode(s). [Was: Re: [Emacs-diffs] scratch/widen-less a4ba846: Replace prog-widen with consolidating widen calls]
Date: Tue, 5 Dec 2017 19:01:41 +0000
User-agent: Mutt/1.7.2 (2016-11-26)

Hello, Dmitry.

On Tue, Dec 05, 2017 at 15:08:02 +0200, Dmitry Gutov wrote:
> Hey Alan,

> On 12/4/17 5:52 PM, Alan Mackenzie wrote:

> > Any chance you could give me some basic details of how to get into this
> > MMM mode?  Like which git branch (? scratch/widen-less ?) can I find the
> > code in, and where is the best documentation to get started.

> I was talking in abstract (MMM meaning any similar framework), but it's 
> a good question. To debug the problems, a concrete example is needed.

> The latest version of mmm-mode lives here: 
> https://github.com/purcell/mmm-mode.git, you can check out the master 
> branch, and it even has a manual that's reasonably up-to-date WRT to usage.

Yes, thanks.  Eli gave me that URL yesterday, so I've had a chance to
skim the manual and some of the code.

> Here are a couple of related bug reports:

> https://github.com/purcell/mmm-mode/issues/55
> https://github.com/purcell/mmm-mode/issues/57

> Both pertaining to the use of c-mode in the context of mmm-noweb.el.

> Please let me know if you need more localized examples.

> > I've no idea how long it will take to make MMM and
> > CC Mode work with eachother.

As a first approximation, dealing with CC Mode's need to widen might
help.  (I don't yet know how that will work for when several CC Mode
chunks are embedded in a single main buffer (?local variables), but that
should become clearer as time goes by.)

In my quick skim of MMM Mode's code, I didn't see any way of accessing
all the various pertinent "point-min"s: there's the point-min set by the
user, the point-min set by MMM Mode to restrict operations to the
current chunk, and there's the point-min set by (e.g.) CC Mode for its
own purposes.  The same applies (perhaps a bit less so) to all the
"point-max"es.

Wasn't `prog-widen' supposed to get the MMM Mode's chunk boundaries?
What are the recognised ways in MMM Mode of getting these three pairs of
(point-min point-max)?

> If you manage to do it at all, that would be an achievement. But just 
> figuring out the biggest problems should help us to design the feature.

I'm thinking about first adapting all the various CC Mode caches which
implicitly or explicitly start at 1, each to have a "cache-min" position
which would coincide with the chunk-start.  Maybe I could use some
mechanism to avoid invalidating them when a buffer change before the CC
Mode chunk changes this "cache-min" position.

> > Not much, if at all.  I found those discussions to be lacking the
> > context I would have needed to understand them.

> I hope the context is apparent now.

Much more so, yes.

> > That's fair.  But the "syntax islands" proposal would be a lot of work,
> > which I don't want to commit to before I see some sort of undertaking to
> > take it seriously.

> Then it should be a good idea to try the proposed, smaller approach, and 
> collect the drawbacks you meet along the way.

That sounds like the way to go, yes.

[ .... ]

> Lots of cats around here in Cyprus. ;-)

Ah, Cyprus!  I'll bet it's a deal warmer than Germany at the moment!

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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