emacs-devel
[Top][All Lists]
Advanced

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

Re: PHP mode and mmm-mode


From: Richard Stallman
Subject: Re: PHP mode and mmm-mode
Date: Sun, 31 Dec 2006 21:11:08 -0500

I am going through the old mail that I failed to deal with during the
past year.  Please forgive me for taking so long to respond.

    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.

This is an interesting idea, but I think it won't work unless we rewrite
major modes specifically to work with it.

Making it invisible is pointless since it would only affect
redisplay.

Making it intangible would stop point from staying inside it.  That
could influence the various major modes.  But I don't think it would
influence them enough.  The classic case of mixing two languages is
Bison input.

Would making everything except the C code intangible cause the C code
to be handled and indented properly by CC mode?  I tend to think the
answer is no, but you could try it easily and see.

    > 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.

I agree with you that that isn't likely to work.

Perhaps we could have a text property `language' and a variable
`current-language'.  If the `language' property of a character doesn't
equal the value of `current-language', then the character would be
treated syntactically as whitespace in syntax.c, and ignored _in the
appropriate way_ by various other primitives.




reply via email to

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