emacs-devel
[Top][All Lists]
Advanced

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

Re: Selecting mumamo modes


From: Lennart Borgman (gmail)
Subject: Re: Selecting mumamo modes
Date: Thu, 25 Sep 2008 23:12:30 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Richard M. Stallman wrote:
> Here's an idea.  Suppose that `normal-mode' sees that a file specifies
> a major mode of the form `A+B'.  If there is no function `A+B-mode',
> it could create one using mumamo, based on `A-mode' and `B-mode', and
> then call it.

Let me see if I understand how you think here ;-)

The structural unit needed are those for defining the chunks. They must
contain info like:

a) B can contain A
b) a chunk dividing function for B in A
c) the major mode specifier A
d) the major mode specifier B
and maybe also
e) order relative to other such structural units; for chunk dividing.

If units like that are available then maybe something like you propose
can be done, yes.

But this is actually rather similar to what is done today in the
defmacro define-mumamo-multi-major-mode, isn't it? I can still see that
it may be useful, of course, but I do not find it necessary now.

Internally I think the structure above will be needed to allow
sub-chunks in sub-chunks. I am still in doubt about how to implement
that however.

* Some notes about sub-chunks in sub-chunks:

I think the best way to do sub-chunks in sub-chunks will be to always do
the chunk dividing from beginning of the file to the end of the file.
(And we could also require that the information about the sub-chunk
major mode should be in the beginning border.)

I have been hesitating to implement this because it might take to long
time if the user for example starts by jumping to the end of the file. A
way to solve that problem is perhaps to first guess the chunk from the
information at the buffer contents close to point and then just change
the chunk if needed when the chunk dividing running from beginning of
the file to the end has come to the chunk containing point.



> That is safe because it only lets a file call `A-mode' and `B-mode',
> which files can already do individually.
>
> Naturally the feature should handle cases of more than two modes in a
> similar way. 




reply via email to

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