From: Alan Mackenzie <acm@muc.de>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: Tom Tromey <tom@tromey.com>,
Stefan Monnier <monnier@iro.umontreal.ca>,
Vitalie Spinu <spinuvit@gmail.com>,
emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] scratch/widen-less a4ba846: Replace prog-widen with consolidating widen calls
Date: Fri, 1 Dec 2017 22:35:29 +0000 [thread overview]
Message-ID: <20171201223529.GG3840@ACM> (raw)
In-Reply-To: <1e542021-e389-cca4-6acd-349efddb2652@yandex.ru>
Hello, Dmitry.
On Fri, Dec 01, 2017 at 19:13:27 +0000, Dmitry Gutov wrote:
> On 12/1/17 3:49 PM, Alan Mackenzie wrote:
> >> Please give an example.
> > A low level function which as an essential part of its functionality
> > (for example, to make sure point-min isn't within a comment or string)
> > widens.
> See Stefan and I's responses. Including an example of a shim that
> wouldn't require you to change your code too much.
A shim? Yuck! My idea is an MMM that doesn't require any such shims.
Major modes should not be "polluted" to adapt to one particular MMM. It
solidifies that MMM, making it difficult to change to a better one.
> But first and foremost, CC Mode probably doesn't need to worry about
> complying with this guideline (yet). In my experience, it doesn't work
> well in multi-mode context for reasons other than it calling widen. So
> worrying about this change in protocol might be premature.
You mean, it would be better to wait until this protocol is firmly
established before arguing against it? I'm guessing that the main
reason CC Mode doesn't work well in MMM is the contention between CC
Mode's narrowing and MMM's narrowing. (This is the example you asked
for earlier on.)
> >> To rephrase, don't widen in indent-line-function or
> >> beginning-of-defun-function.
> > This is an intolerable restriction. The low level function mentioned
> > above cannot, should not, must not know whether it's being called
> > (indirectly) from indent-line-function or b-o-d-function. It will have
> > to widen in all cases or none. Therefore there will be failures whilst
> > being called either from one of the two noted functions or from
> > elsewhere.
> See that shim in the other email.
The shim doesn't help. It's still horribly ugly.
> > Indeed it can, and it must. A super-mode thus may not "reserve"
> > narrowing for its own purposes to the exclusion of other uses.
> Right.
Glad we agree upon this. However that contradicts your proposal that
anything a beginning-of-defun-function calls can't use narrowing and
widening.
> > The multi-mode mechanism should be designed to be usable with any major
> > mode. There's nothing particularly hard about supporting CC Mode in a
> > well designed multi-mode scheme.
> It's harder than supporting Ruby, CSS and JS modes, that I can tell you
> for sure. For one thing, the extra caches CC Mode uses have given me
> multiple "argument out of bounds" errors when used with narrowing.
There's your example for contention between major modes' narrowing and
MMM's narrowing. If you didn't narrow, CC Mode would behave properly.
> So these are my takeaways:
> 1) The "low-level primitives" in CC Mode do not widen consistently.
They widen when they need to, which is not always.
> Some of them miss that responsibility (or else I wouldn't get those
> kind of errors).
It is the multiple-mode code that is responsible for not getting these
errors. At least it should be.
> That tells me that moving (widen) call to some higher level is
> generally a good idea, but you can disagree.
> 2) The other errors should be solvable, but they require a separate
> investigation, which nobody has found the time and energy to do so far,
> over many years. So maybe it's not so necessary.
I would like AWK Mode to work inside shell-script-mode, since short AWK
scripts are so often embedded in scripts.
> 3) The solution to the other problems is most likely orthogonal to the
> current discussion. Allowing multi-mode packages to use narrowing
> certainly shouldn't hurt.
Of course not. It's prohibiting major modes from using
narrowing/widening that is objectionable.
> > We need better tools. I have already proposed and offered to implement
> > such tools.
> It was much more complex, nowhere near even a proof of concept, and
> doesn't seem to move anywhere, so far.
Investing the time and energy on an implementation was too risky. In
practice, Stefan has veto power over what goes into the syntax area, and
I've been at the sharp end of that veto once too often (the rejection of
my "comment-cache" code which solved the problem of open parens at
column zero in comments). In the last exchange about the "syntactic
islands" concept, Stefan showed little enthusiasm for it: there was no
"OK, implement it and we'll see what we can do with it", no
encouragement whatsoever. There was no discussion of major topics, such
as the possibilities it would open up, or any plans to use it. Mainly,
the talk was about minor aspects of the proposal, at one point
degenerating into a squabble about the use of the word "island".
I'm still prepared to implement the "islands" proposal, which would
allow a better MMM mode than one based on narrowing, but ONLY if I get
some assurance from John, Eli, or even Stefan himself beforehand that
the implementation is, in principle, going to be incorporated into
Emacs. That the only thing which would stop that would be solid
technical reasons.
> The change we're discussing is much smaller and pretty much implemented.
But it has negative implications. It will only work with major modes
specially adapted for it, and it imposes severe restrictions on those
major modes. I think it needs those modes to be "polluted" with MMM
code.
> And again, there's no reason why they couldn't coexist.
The "pollution" mentioned above would make it more difficult.
If the new code you're proposing is incorporated into Emacs, it will
acquire some momentum, making it difficult to introduce a better
solution.
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2017-12-01 22:35 UTC|newest]
Thread overview: 194+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171129233237.27462.23351@vcs0.savannah.gnu.org>
[not found] ` <20171129233238.504B5204F1@vcs0.savannah.gnu.org>
2017-11-30 1:53 ` [Emacs-diffs] scratch/widen-less a4ba846: Replace prog-widen with consolidating widen calls Stefan Monnier
2017-11-30 8:59 ` Dmitry Gutov
2017-11-30 10:58 ` Dmitry Gutov
2017-11-30 15:31 ` Tom Tromey
2017-11-30 21:28 ` Dmitry Gutov
2017-11-30 21:46 ` Alan Mackenzie
2017-11-30 23:03 ` [SUSPECTED SPAM] " Stefan Monnier
2017-12-01 16:07 ` Alan Mackenzie
2017-11-30 23:09 ` Dmitry Gutov
2017-12-01 15:49 ` Alan Mackenzie
2017-12-01 16:26 ` Stefan Monnier
2017-12-01 18:20 ` Alan Mackenzie
2017-12-01 18:59 ` Dmitry Gutov
2017-12-01 19:51 ` Stefan Monnier
2017-12-01 20:50 ` Dmitry Gutov
2017-12-02 2:24 ` Stefan Monnier
2017-12-02 20:01 ` Dmitry Gutov
2017-12-02 23:47 ` Stefan Monnier
2017-12-03 3:38 ` Eli Zaretskii
2017-12-03 23:43 ` Dmitry Gutov
2017-12-04 3:38 ` Eli Zaretskii
2017-12-04 11:53 ` Dmitry Gutov
2017-12-04 16:41 ` Eli Zaretskii
2017-12-04 17:45 ` Stefan Monnier
2017-12-05 0:10 ` Dmitry Gutov
2017-12-03 16:42 ` Dmitry Gutov
2017-12-03 21:23 ` Stefan Monnier
2017-12-03 23:58 ` Dmitry Gutov
2017-12-01 17:06 ` Drew Adams
2017-12-01 18:03 ` Stefan Monnier
2017-12-01 21:27 ` Vitalie Spinu
2017-12-01 21:38 ` Dmitry Gutov
2017-12-01 22:45 ` Alan Mackenzie
2017-12-02 2:53 ` Stefan Monnier
2017-12-02 14:02 ` Tom Tromey
2017-12-02 23:48 ` Richard Stallman
2017-12-01 19:13 ` Dmitry Gutov
2017-12-01 22:35 ` Alan Mackenzie [this message]
2017-12-01 23:24 ` Dmitry Gutov
2017-12-02 2:47 ` Stefan Monnier
2017-12-02 20:28 ` Alan Mackenzie
2017-12-03 0:03 ` Stefan Monnier
2017-12-03 12:18 ` Alan Mackenzie
2017-12-03 16:02 ` Dmitry Gutov
2017-12-03 3:52 ` Dmitry Gutov
2017-12-03 14:54 ` Alan Mackenzie
2017-12-03 18:40 ` Stefan Monnier
2017-12-03 22:26 ` Alan Mackenzie
2017-12-03 23:42 ` Stefan Monnier
2017-12-04 2:33 ` syntax-propertize and CC-mode (was: [Emacs-diffs] scratch/widen-less a4ba846: Replace prog-widen with consolidating widen calls) Stefan Monnier
2017-12-03 23:53 ` [Emacs-diffs] scratch/widen-less a4ba846: Replace prog-widen with consolidating widen calls Dmitry Gutov
2017-12-02 8:27 ` Eli Zaretskii
2017-12-02 10:50 ` Dmitry Gutov
2017-12-02 11:10 ` Eli Zaretskii
2017-12-02 16:41 ` Stefan Monnier
2017-12-02 17:13 ` Eli Zaretskii
2017-12-02 17:53 ` Stefan Monnier
2017-12-02 18:33 ` Eli Zaretskii
2017-12-02 20:18 ` Dmitry Gutov
2017-12-02 20:14 ` Dmitry Gutov
2017-12-02 20:58 ` Eli Zaretskii
2017-12-02 21:35 ` Dmitry Gutov
2017-12-03 15:28 ` Eli Zaretskii
2017-12-03 16:35 ` Dmitry Gutov
2017-12-03 17:20 ` Eli Zaretskii
2017-12-03 19:43 ` Dmitry Gutov
2017-12-04 15:52 ` Eli Zaretskii
2017-12-04 16:35 ` Stefan Monnier
2017-12-04 16:56 ` Eli Zaretskii
2017-12-04 22:57 ` Dmitry Gutov
2017-12-04 23:27 ` Dmitry Gutov
2017-12-03 18:59 ` Alan Mackenzie
2017-12-03 19:25 ` Eli Zaretskii
2017-12-03 21:20 ` Alan Mackenzie
2017-12-04 16:10 ` Eli Zaretskii
2017-12-04 16:23 ` Alan Mackenzie
2017-12-04 16:48 ` Eli Zaretskii
2017-12-03 22:01 ` Stefan Monnier
2017-12-04 0:37 ` Dmitry Gutov
2017-12-04 15:52 ` Alan Mackenzie
2017-12-04 16:46 ` Eli Zaretskii
2017-12-05 13:08 ` Dmitry Gutov
2017-12-05 19:01 ` CC Mode in MMM Mode(s). [Was: Re: [Emacs-diffs] scratch/widen-less a4ba846: Replace prog-widen with consolidating widen calls] Alan Mackenzie
2017-12-05 23:34 ` Dmitry Gutov
2017-12-06 18:19 ` CC Mode in MMM Mode(s) Alan Mackenzie
2017-12-07 0:21 ` Dmitry Gutov
2017-12-07 19:49 ` Richard Stallman
2017-12-07 23:43 ` Dmitry Gutov
2017-12-08 21:36 ` Richard Stallman
2017-12-09 15:20 ` Dmitry Gutov
2017-12-03 21:52 ` [Emacs-diffs] scratch/widen-less a4ba846: Replace prog-widen with consolidating widen calls Stefan Monnier
2017-12-04 0:03 ` Dmitry Gutov
2017-12-04 2:24 ` [SUSPECTED SPAM] " Stefan Monnier
2017-12-04 10:03 ` Dmitry Gutov
2017-12-04 16:21 ` Eli Zaretskii
2017-12-04 17:12 ` Stefan Monnier
2017-12-04 17:40 ` Eli Zaretskii
2017-12-04 17:52 ` Stefan Monnier
2017-12-04 19:53 ` Eli Zaretskii
2017-12-04 20:36 ` Eli Zaretskii
2017-12-04 21:00 ` Stefan Monnier
2017-12-04 21:50 ` Dmitry Gutov
2017-12-06 18:41 ` Dmitry Gutov
2017-12-09 10:47 ` Eli Zaretskii
2017-12-09 11:05 ` Eli Zaretskii
2017-12-10 5:01 ` Stefan Monnier
2017-12-10 6:53 ` Eli Zaretskii
2017-12-10 20:08 ` Stefan Monnier
2017-12-11 14:18 ` Getting rid of prog-indentation-context Stefan Monnier
2017-12-11 16:18 ` Eli Zaretskii
2017-12-11 17:08 ` Stefan Monnier
2017-12-11 17:26 ` Stefan Monnier
2017-12-11 18:02 ` Eli Zaretskii
2017-12-11 18:53 ` Ingo Lohmar
2017-12-11 21:42 ` Dmitry Gutov
2017-12-09 17:56 ` [SUSPECTED SPAM] Re: [Emacs-diffs] scratch/widen-less a4ba846: Replace prog-widen with consolidating widen calls John Wiegley
2017-12-10 20:19 ` Dmitry Gutov
2017-12-10 20:38 ` Stefan Monnier
2017-12-10 21:41 ` Dmitry Gutov
2017-12-11 9:53 ` Tom Tromey
2017-12-11 15:31 ` Stefan Monnier
2017-12-10 20:39 ` Eli Zaretskii
2017-12-10 21:39 ` [SUSPECTED SPAM] Re: [Emacs-diffs] scratch/widen-less a4ab846: " John Wiegley
2017-12-10 21:43 ` Dmitry Gutov
2017-12-10 21:53 ` [SUSPECTED SPAM] Re: [Emacs-diffs] scratch/widen-less a4ba846: " Dmitry Gutov
2017-12-11 16:04 ` Eli Zaretskii
2017-12-11 16:25 ` Dmitry Gutov
2017-12-11 17:43 ` Eli Zaretskii
2017-12-11 18:22 ` Eli Zaretskii
2017-12-11 20:47 ` John Wiegley
2017-12-11 21:35 ` Dmitry Gutov
2017-12-11 21:43 ` John Wiegley
2017-12-14 9:32 ` Dmitry Gutov
2017-12-14 13:20 ` Dmitry Gutov
2017-12-15 11:56 ` Dmitry Gutov
2017-12-14 14:01 ` Stefan Monnier
2017-12-14 14:17 ` Dmitry Gutov
2017-12-14 14:32 ` Stefan Monnier
2017-12-14 15:17 ` Robert Weiner
2017-12-15 11:54 ` Dmitry Gutov
2017-12-15 11:54 ` Dmitry Gutov
2017-12-20 0:08 ` Dmitry Gutov
2017-12-20 2:41 ` Stefan Monnier
2017-12-20 19:13 ` John Wiegley
2017-12-20 22:30 ` Dmitry Gutov
2017-12-21 1:33 ` John Wiegley
2017-12-21 22:07 ` Dmitry Gutov
2017-12-21 23:49 ` John Wiegley
2017-12-11 17:21 ` Stefan Monnier
2017-12-11 18:04 ` Eli Zaretskii
2017-12-11 22:20 ` Stefan Monnier
2017-12-10 22:43 ` Dmitry Gutov
2017-12-10 23:30 ` Dmitry Gutov
2017-12-11 0:26 ` Dmitry Gutov
2017-12-04 21:46 ` Dmitry Gutov
2017-12-04 22:05 ` Stefan Monnier
2017-12-04 22:45 ` Dmitry Gutov
2017-12-05 6:03 ` Eli Zaretskii
2017-12-05 10:42 ` Dmitry Gutov
2017-12-05 17:49 ` Eli Zaretskii
2017-12-04 16:12 ` Eli Zaretskii
2017-12-04 16:49 ` Stefan Monnier
2017-12-04 17:28 ` Eli Zaretskii
2017-12-04 21:52 ` Dmitry Gutov
2017-12-05 5:08 ` Eli Zaretskii
2017-12-05 5:33 ` Eli Zaretskii
2017-12-05 10:55 ` Dmitry Gutov
2017-12-05 17:53 ` Eli Zaretskii
2017-12-05 18:40 ` Dmitry Gutov
2017-12-05 20:49 ` Eli Zaretskii
2017-12-05 23:16 ` Dmitry Gutov
2017-12-06 9:28 ` Eli Zaretskii
2017-12-06 13:36 ` Dmitry Gutov
2017-12-08 16:41 ` Eli Zaretskii
2017-12-09 15:17 ` Dmitry Gutov
2017-12-09 15:43 ` Eli Zaretskii
2017-12-10 19:59 ` Dmitry Gutov
2017-12-10 20:04 ` Eli Zaretskii
2017-12-05 12:55 ` Dmitry Gutov
2017-12-05 17:57 ` Eli Zaretskii
2017-12-05 18:54 ` Dmitry Gutov
2017-12-05 20:48 ` Eli Zaretskii
2017-12-05 21:08 ` Ingo Lohmar
2017-12-06 9:26 ` Eli Zaretskii
2017-12-06 13:37 ` Dmitry Gutov
2017-12-15 15:48 Wedler, Christoph
2017-12-16 15:00 ` Stefan Monnier
2017-12-16 17:34 ` Dmitry Gutov
2017-12-18 12:39 ` Wedler, Christoph
2017-12-18 14:50 ` Dmitry Gutov
2017-12-18 17:41 ` Wedler, Christoph
2017-12-19 0:27 ` Dmitry Gutov
2017-12-19 11:27 ` Wedler, Christoph
2017-12-20 0:07 ` Dmitry Gutov
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=20171201223529.GG3840@ACM \
--to=acm@muc.de \
--cc=dgutov@yandex.ru \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=spinuvit@gmail.com \
--cc=tom@tromey.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.