all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman@gmail.com>
To: fx@gnu.org
Cc: help-gnu-emacs@gnu.org
Subject: Re: Multiple Major Modes
Date: Mon, 2 Nov 2009 13:32:24 +0100	[thread overview]
Message-ID: <e01d8a50911020432g477fec71idb4d9773cb2194d5@mail.gmail.com> (raw)
In-Reply-To: <87bpjmhrbh.fsf@liv.ac.uk>

On Sun, Nov 1, 2009 at 10:24 PM, Dave Love <fx@domain.invalid> wrote:
>
> I'm rather baffled by this nxhtml thing referred to, and its complexity.
> It claims to be trying to solve a problem that the indirect buffer
> approach doesn't have.  Can someone explain why?


Hi Dave,

I guess you mean the complexity of MuMaMo, which is a part of nXhtml?
nXhtml contains much more.

I you have asked some years ago about the indirect buffer thing I
could have answered it quickly, but I have forgotten all details about
why I abondoned that approach. (It was the first approach I tried.) I
am not sure whether to use indirect buffers for just fontification is
useful. It does create problems for other elisp code since they might
be interested in the actual buffer used. Please notice that some minor
modes for example work for a whole buffer and some just within a major
mode. So some buffer local variables should be preserved across chunks
while others should not. (That problem is quite hard to solve with the
current limitations of Emacs though. I have made some suggestions (in
private messages) for how to solve it but they require low level
changes in Emacs and it is quite hard to figure out exactly what is
needed.)


I really think some simplifications can be made to mumamo.el, but
maybe not as much as one might expect without looking closer at the
problems it tries to solve. Some of the complexity comes from my bad
understanding of complex parts of Emacs from the beginning so there
are some left-over code. It should of course be removed later. The
code in mumamo.el is not always pretty and should be simplified in
many cases. It is however hard to do since complicated cases easily
breaks. I have tried to write some unit tests to simplify the
rewriting work.

On the other hand most of the complexity comes from the problems that
mumamo.el tries to solve. Caching of chunk information and state
information is for example essential. You have a comment in
multi-mode.el that it would be hard to implement chunks in chunks if
chunk information was cached. It is rather the opposite since you have
to search the file from the beginning to get chunks right and that is
especially important for chunks in chunks. I did not realize the full
impact of this from the beginning and I have had to rewrite much of
the chunk dividing code because of this. (And there is still
unnecessary complexity from my rather worthless attempts trying to
make chunk dividing stable without always finding them from the start
of the file.)


Looking at the bug database in Launchpad for nXhtml (and also the old
bugs stored on EmacsWiki) will perhaps make it more clear what the
complexity in mumamo.el is about.

I have tried to avoid discussing the complexities with multi major
modes on Emacs devel since it would take too much time and space. I
have tried to do that in some private messages instead. If you are
interested I could send you some of my suggestions.


I would very much prefer merging different approaches to multi major
modes. It is actually very complex (though on the surface it does not
seem so). Having several approaches will waste a lot of time. On the
other hand forgetting good ideas will also do that. Suggestions for
simplifications of mumamo.el are very welcome.



> Doing this sort of thing properly really needs support from Emacs, which
> was originally meant to be added as necessary.


Yes, but it is hard to find out what support is needed without
actually trying to solve the problems first.




  reply	other threads:[~2009-11-02 12:32 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-29  9:45 Multiple Major Modes Nordlöw
2009-10-29 13:40 ` Pascal J. Bourguignon
2009-10-29 20:04 ` Joost Kremers
2009-10-29 22:14   ` Lennart Borgman
     [not found]   ` <mailman.9707.1256854525.2239.help-gnu-emacs@gnu.org>
2009-10-29 23:03     ` Pascal J. Bourguignon
2009-10-29 23:49       ` Lennart Borgman
     [not found]       ` <mailman.9710.1256860199.2239.help-gnu-emacs@gnu.org>
2009-10-30  0:52         ` Pascal J. Bourguignon
2009-10-30  3:28     ` Joseph Brenner
2009-11-01 23:14       ` Lennart Borgman
     [not found]       ` <mailman.9873.1257117309.2239.help-gnu-emacs@gnu.org>
2009-12-11  6:19         ` Joseph Brenner
2009-12-11 17:08           ` Lennart Borgman
2009-12-11 21:57             ` Joe Brenner
2009-12-11 22:06               ` Lennart Borgman
2009-12-12  2:16                 ` Joe Brenner
2009-12-12  2:18                   ` Lennart Borgman
2009-12-12  2:37                     ` Joe Brenner
2009-11-01 21:24 ` Dave Love
2009-11-02 12:32   ` Lennart Borgman [this message]
2009-11-02 14:01   ` Richard Riley
2009-11-02 14:22     ` Lennart Borgman
2009-11-02 14:28       ` Richard Riley
2009-11-02 14:44         ` Richard Riley
2009-11-02 15:11     ` Richard Riley
  -- strict thread matches above, loose matches on Subject: below --
2008-06-10 21:26 Nordlöw
2008-06-10 21:47 ` Lennart Borgman (gmail)
2008-06-11  5:42 ` William Xu
2007-06-11 23:27 Should nXML be included Leo
2007-06-12 10:50 ` Lennart Borgman (gmail)
2007-06-12 11:21   ` Jason Rumney
2007-06-12 12:57     ` Lennart Borgman (gmail)
2007-06-12 14:20       ` Jason Rumney
2007-06-12 15:06         ` Multiple major modes (was: Should nXML be included) Stefan Monnier
2007-06-12 15:15           ` Multiple major modes Leo
2007-06-12 18:48           ` Lennart Borgman (gmail)
2007-06-12 20:14             ` Re[2]: " Eric M. Ludlam
2007-06-12 21:04               ` Lennart Borgman (gmail)
2007-06-12 23:10                 ` Stefan Monnier
2007-06-13 16:22                   ` Richard Stallman
2007-06-13 16:22               ` Richard Stallman
2007-06-19  2:09                 ` Re[2]: " Eric M. Ludlam
2007-06-24 14:41                   ` Richard Stallman
2007-06-25 14:04                     ` Re[2]: " Eric M. Ludlam
2007-07-01 20:40                       ` Richard Stallman
2007-07-05  2:29                         ` Re[2]: " Eric M. Ludlam
2007-07-05 20:34                           ` Richard Stallman
2007-07-01 20:40                       ` Richard Stallman
2007-07-04 16:35                         ` T. V. Raman
2007-07-04 17:01                           ` David Kastrup
2007-07-05  1:31                           ` Richard Stallman
2007-07-05 14:49                             ` Stefan Monnier
2007-07-06  4:38                               ` Richard Stallman
2007-07-06  6:01                                 ` Stephen J. Turnbull
2007-07-07 13:07                                   ` Richard Stallman
2007-07-07 14:13                                     ` Lennart Borgman (gmail)
2007-07-08 16:56                                       ` Richard Stallman
2007-07-07 17:43                                     ` Stephen J. Turnbull
2007-07-06 16:00                                 ` Stefan Monnier
2007-07-06 16:10                                   ` Drew Adams
2007-07-07 13:06                                     ` Richard Stallman
2007-07-07 17:21                                       ` Stephen J. Turnbull
2007-07-08 16:55                                         ` Richard Stallman
2007-07-09  5:29                                           ` Stephen J. Turnbull
2007-07-09 17:21                                             ` Richard Stallman
2007-07-07  0:48                             ` Johan Bockgård
2007-07-05  1:44                         ` Re[2]: " Eric M. Ludlam
2007-07-08 22:23                           ` Richard Stallman
2007-07-09  0:49                             ` Re[2]: " Eric M. Ludlam
2007-07-09 17:21                               ` 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=e01d8a50911020432g477fec71idb4d9773cb2194d5@mail.gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=fx@gnu.org \
    --cc=help-gnu-emacs@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.