[Top][All Lists]

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

Re: PHP mode and mmm-mode

From: Lars Magne Ingebrigtsen
Subject: Re: PHP mode and mmm-mode
Date: Tue, 02 May 2006 22:29:04 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

"Michael Shulman" <address@hidden> writes:

> For example, in certain modes (which I don't remember off the
> top of my head) indentation in submode regions is broken, while in
> others, quotation marks in one place can adversely affect the
> font-locking somewhere where they really shouldn't.

Well, that's to be expected, but if a convention for telling modes
what regions belongs to what modes, then these things can be fixed in
the relevant major modes.

We're not talking about hundreds of modes, either -- the number of
modes where mixing types is likely is probably pretty low.  Say
10 to 20.

> This is fine as far as it goes, but it makes it hard
> to completely conceal extraneous parts of the buffer from modes that
> should not be paying attention to them, producing the above-mentioned
> problems with font-lock and indentation.

I just had a gross idea.  Before calling any of the major-mode
functions (in response to, say, `TAB'), you'd make all the text that's
not in the current major mode invisible and intangible.  Then each
major mode function would believe there was nothing but its own type
of text in the buffer.

The mmm minor mode would basically install a keymap that does


The major mode would probably need a way to tell mmm which functions
would need this treatment. 

> Perhaps an approach based on narrowing, or the creation of auxiliary
> buffers, might work better; I haven't really explored these
> possibilities.

I think using narrowing and auxiliary buffers would both be less than
optimal.  When you program, you need to see the context.

(domestic pets only, the antidote for overdose, milk.)
  address@hidden * Lars Magne Ingebrigtsen

reply via email to

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