From: martin rudalics <rudalics@gmx.at>
Cc: emacs-devel@gnu.org
Subject: Re: PHP mode and mmm-mode
Date: Tue, 02 May 2006 10:10:51 +0200 [thread overview]
Message-ID: <4457140B.1050205@gmx.at> (raw)
In-Reply-To: <c3f821000605012124s593bb81fv3a506fb98b2d7006@mail.gmail.com>
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.
next prev parent reply other threads:[~2006-05-02 8:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-02 4:24 PHP mode and mmm-mode Michael Shulman
2006-05-02 8:10 ` martin rudalics [this message]
2006-05-02 14:57 ` Stefan Monnier
2006-05-02 20:29 ` Lars Magne Ingebrigtsen
2006-05-02 23:44 ` Nic
2006-05-03 3:11 ` David Hansen
2006-05-03 3:43 ` Stefan Monnier
2007-01-01 2:11 ` Richard Stallman
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4457140B.1050205@gmx.at \
--to=rudalics@gmx.at \
--cc=emacs-devel@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.