[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PHP mode and mmm-mode
From: |
martin rudalics |
Subject: |
Re: PHP mode and mmm-mode |
Date: |
Tue, 02 May 2006 10:10:51 +0200 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
The most simple approach would be to mark regions reserved for "other"
modes by turning them into generic strings. Usually, major modes don't
touch strings during indentation, font-lock colors them uniformly,
parse-partial-sexp and syntax-ppss handle them. Hence there wouldn't
have to be done too much to implement this - point-entered/-left hooks
to switch to the appropriate mode and set the appropriate syntax-table
properties. Obviously, a region reserved for a particular mode had to
maintain point-entered/-left properties appropriately - likely the more
expensive overhead involved.
With foo-mode active, bar-mode and baz-mode would be barred off as
foo-mode
|bar-mode|
foo-mode
|baz-mode
bar-mode|
where text between two matching bars is a generic string. Entering
bar-mode text would require to reinstall syntax-table text properties
|foo-mode|
bar-mode
|foo-mode
baz-mode|
bar-mode
and peform a redisplay. Things like `indent-buffer' in foo-mode would
use `inhibit-point-motion-hooks' to avoid switching to another mode
intermittently. In any case, the original philosophy that "each buffer
has only one major mode at a time" would remain intact.
AFAICT only three major modes - cc-awk, cperl, and perl - currently use
generic strings for their purposes. Whether and how to accomodate them
is beyond my comprehension.
Just an idea - with blatant disregard for the particular needs of PHP
and friends.