From: Alan Mackenzie <acm@muc.de>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: "Simen Heggestøyl" <simenheg@runbox.com>,
acm@muc.de, 41897@debbugs.gnu.org
Subject: bug#41897: 28.0.50; JavaScript comment filling with mhtml-mode
Date: Thu, 25 Jun 2020 19:13:59 +0000 [thread overview]
Message-ID: <20200625191359.GD10342@ACM> (raw)
In-Reply-To: <d7dbba31-696d-d83c-4103-9c2631ccdc8d@yandex.ru>
Hello, Dmitry.
On Thu, Jun 25, 2020 at 21:19:11 +0300, Dmitry Gutov wrote:
> Hi Alan,
> On 25.06.2020 21:07, Alan Mackenzie wrote:
> > The purpose of this cache is to avoid repeated scanning from BOB.
> > Your proposed continual splatting of it would remove the benefit of
> > it entirely.
> That's unfortunate.
Indeed. Let's assume that keeping it working is a requirement here.
> Guess the only thing that remains for me here is to express a wish for a
> syntax-ppss based design here.
> Because mmm-mode knows how to deal with major modes based on it, as a group.
How about enhancing mmm-mode to handle any major mode, rather than a
restricted subset?
> >>> It would work fine with the current patch, together with calls to
> >>> initialise the mechanism. What precisely is the problem in mmm-mode?
> >> That there is no good place to plug in your new functions.
> > That would appear to be a deficiency in mmm-mode.
> > Does mmm-mode not call js-mode when that is one of the submodes? If it
> > doesn't, then why not add a general init function-variable/hook/whatever
> > into which initialisations can be plugged?
> It does not pick up each and every hook.
> If it did, though, it would only call your before-change-functions
> inside js-mode regions, but it would have ignored them in HTML and CSS
> regions. Which doesn't appear to be what you want anyway.
Then why not do in mmm-mode what I'm doing in CC Mode, mhtml-mode and
js-mode, i.e. add ad hoc code to handle precisely the case of js-mode?
It's not very nice, but it helps to analyse in the abstract how we
reached the point we are at. That abstract reason is js-mode using part
of CC Mode without initialising it. This is bound to lead to trouble,
and it has lead to trouble.
> >> And, in general, to have per-mode before-change-functions contents.
> > There's no problem with before/after-change-functions. They're the
> > canonical way to react to buffer changes.
> They're not very manageable, from mmm's point of view. And like the
> current example shows, it's not obvious what to do with such hooks
> outside of submode regions of major modes that added them.
Like I said earlier on in the thread, making several major modes in a
buffer work is problematic in Emacs, and we really want better support
from the C core for it. Here we seem to want "global" and "mode-local"
before-change-functionses.
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2020-06-25 19:13 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <874krbaqg3.fsf@simenheg@gmail.com>
[not found] ` <mailman.1991.1592327403.2541.bug-gnu-emacs@gnu.org>
2020-06-20 17:18 ` bug#41897: 28.0.50; JavaScript comment filling with mhtml-mode Alan Mackenzie
2020-06-20 18:27 ` Simen Heggestøyl
[not found] ` <87d05ta8z9.fsf@simenheg@gmail.com>
2020-06-21 16:55 ` Alan Mackenzie
2020-06-22 19:17 ` Alan Mackenzie
2020-06-23 0:02 ` Dmitry Gutov
2020-06-23 8:36 ` Alan Mackenzie
2020-06-23 14:23 ` Dmitry Gutov
2020-06-23 16:28 ` Alan Mackenzie
2020-06-23 17:59 ` Dmitry Gutov
2020-06-23 19:17 ` Alan Mackenzie
2020-06-23 23:11 ` Dmitry Gutov
2020-06-24 17:43 ` Alan Mackenzie
2020-06-24 18:28 ` Dmitry Gutov
2020-06-25 16:33 ` Alan Mackenzie
2020-06-25 16:48 ` Dmitry Gutov
2020-06-25 18:07 ` Alan Mackenzie
2020-06-25 18:19 ` Dmitry Gutov
2020-06-25 19:13 ` Alan Mackenzie [this message]
2020-06-25 19:28 ` Dmitry Gutov
2020-06-25 20:11 ` Alan Mackenzie
2020-06-25 21:20 ` Dmitry Gutov
2020-06-27 11:06 ` Alan Mackenzie
2020-06-28 0:18 ` Dmitry Gutov
2020-06-25 20:53 ` Tom Tromey
2020-06-25 21:14 ` Dmitry Gutov
2020-06-26 16:31 ` Alan Mackenzie
2020-06-25 20:49 ` Tom Tromey
2020-06-26 16:46 ` Alan Mackenzie
2020-07-04 13:13 ` Alan Mackenzie
2020-06-16 17:08 Simen Heggestøyl
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=20200625191359.GD10342@ACM \
--to=acm@muc.de \
--cc=41897@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=simenheg@runbox.com \
/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.