unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: wkirschbaum@gmail.com, casouri@gmail.com, 62333@debbugs.gnu.org
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Date: Mon, 27 Mar 2023 01:00:20 +0300	[thread overview]
Message-ID: <9886ffa5-ead2-50d5-a325-f6704b736ada@yandex.ru> (raw)
In-Reply-To: <83v8inal29.fsf@gnu.org>

On 26/03/2023 13:01, Eli Zaretskii wrote:
>> Date: Sun, 26 Mar 2023 12:25:30 +0300
>> Cc: wkirschbaum@gmail.com, casouri@gmail.com, 62333@debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@yandex.ru>
>>
>> On 26/03/2023 08:04, Eli Zaretskii wrote:
>>>> Date: Sun, 26 Mar 2023 00:57:22 +0200
>>>> Cc: wkirschbaum@gmail.com, casouri@gmail.com, 62333@debbugs.gnu.org
>>>> From: Dmitry Gutov <dgutov@yandex.ru>
>>>>
>>>>> How does that work with features such as font-lock, which do widen?
>>>>
>>>> Using font-lock-dont-widen.
>>>
>>> That's only for font-lock.  Parsing was not on the table when that was
>>> introduced, so it doesn't have a similar mechanism.
>>
>> Parsing is on-demand, by font-lock and other features.
> 
> So you are suggesting to introduce kludges like font-lock-dont-widen
> in all of those places?

font-lock-dont-widen is a kludge, but that's largely determined by the 
way it's defined and used.

If we take indent-for-tab-command, for example, it doesn't have such a 
variable, and doesn't really need to: the top-level command calls 
'widen', and then indent-line-function (set by major mode and altered by 
e.g. mmm-mode) is free to impose its specific bounds.

I think, as far the immediate problem is concerned, blink-matching-paren 
could use the same route. And could even try to reuse 
show-paren-data-function instead of creating its own customization point.

> I don't even see how we will find them all in
> advance, let alone fix them or make sure they do what we want.

Just do it step-by-step.

The "grand unified theory of mixed major modes" has been attempted a few 
times in the past, and never reached anything practical. That's not to 
say nobody should try again, but they should keep that in mind.

>>> Again, I'm talking about using a parser library.  We may need to
>>> introduce a way of limiting the parser to a certain range of buffer
>>> text positions, independently of narrowing.
>>
>> Except it's already limited by narrowing.
> 
> Which is a fragile, semi-broken means, as we all know.

What is a broken mess, is user-level narrowing. And how the downstream 
code can never guess the purpose the narrowing was applied for.

>>> As we all know, narrowing
>>> is a problematic feature to use in Lisp programs, so maybe we should
>>> do this better in the case of parsers.  Then problems like this one
>>> could be solved more cleanly and simply.
>>
>> Narrowing problematic to use in Lisp?
> 
> Yes, because users can easily change narrowing.  We've had problems
> with that many times, and even some attempts at solving it, so why are
> you pretending you don't know about those deficiencies?

Because I suggested deprecating certain uses of it several times, and 
always got a "no" for an answer.

>>>> And anyway, I like I mentioned, this will break this common pattern as well:
>>>>
>>>>      (save-restriction
>>>>        (narrow-to-region ... some-limit-position)
>>>>        (forward-sexp))
>>>>
>>>> I've used it in ruby-syntax-propertize-percent-literal, for example.
>>>> Except with 'forward-list' rather than 'forward-sexp', but others can
>>>> use the latter.
>>>
>>> You want to repeat all the arguments we already brought up?
>>
>> You might choose to ignore a third-party mode, but breaking a common
>> pattern seems more dangerous.
> 
> ??? How does that follow from what I said?
> 
> Look, I'm trying to see how we could come up with an infrastructure
> that will support multiple modes and other similar features in the
> same buffer without relying on narrowing, thus bypassing the
> disadvantages and difficulties that come with narrowing.  I think we
> have a good chance here to come up with such a solution, specifically
> for features that us a parsing library.  If you aren't interested in
> discussing that, and think we should stick to narrowing, then this
> goes nowhere, and I'd rather bow out of it.

What I've seen here so far is you suggesting we go ahead and break the 
existing convention and then let "them" (third-party authors including 
myself) come up with a new working one.

My stance here is we shouldn't break it before we create a new one. And 
I'm happy to discuss it, of course. Just please don't expect me to take 
the initiative at this point.





  reply	other threads:[~2023-03-26 22:00 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 14:00 bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes Wilhelm Kirschbaum
2023-03-23  1:03 ` Dmitry Gutov
2023-03-23  3:03   ` Yuan Fu
2023-03-23  4:20     ` Dmitry Gutov
2023-03-23  7:13       ` Eli Zaretskii
2023-03-23 21:18         ` Yuan Fu
2023-03-23 21:30           ` Dmitry Gutov
2023-03-23 22:06           ` Dmitry Gutov
2023-03-23 23:59             ` Yuan Fu
2023-03-24  6:05               ` Eli Zaretskii
2023-03-24  7:34                 ` Yuan Fu
2023-03-25  1:51                   ` Dmitry Gutov
2023-03-25 12:34                     ` Eli Zaretskii
2023-03-25 13:00                       ` Dmitry Gutov
2023-03-25 13:14                         ` Eli Zaretskii
2023-03-25 13:44                           ` Dmitry Gutov
2023-03-25 14:09                             ` Eli Zaretskii
2023-03-25 14:18                               ` Dmitry Gutov
2023-03-25 14:41                                 ` Eli Zaretskii
2023-03-25 15:25                                   ` Dmitry Gutov
2023-03-25 15:57                                     ` Eli Zaretskii
2023-03-25 16:03                                       ` Dmitry Gutov
2023-03-25 16:24                                         ` Eli Zaretskii
2023-03-25 17:05                                           ` Dmitry Gutov
2023-03-25 17:40                                             ` Eli Zaretskii
2023-03-25 19:31                                               ` Yuan Fu
2023-03-25 23:29                                                 ` Dmitry Gutov
2023-03-26 22:52                                                   ` Yuan Fu
2023-03-27  1:29                                                     ` Dmitry Gutov
2023-03-26  4:28                                                 ` Eli Zaretskii
2023-03-26 22:57                                                   ` Yuan Fu
2023-03-27 13:32                                                     ` Eli Zaretskii
2023-03-27 18:43                                                       ` Yuan Fu
2023-03-25 22:57                                               ` Dmitry Gutov
2023-03-26  5:04                                                 ` Eli Zaretskii
2023-03-26  9:25                                                   ` Dmitry Gutov
2023-03-26 10:01                                                     ` Eli Zaretskii
2023-03-26 22:00                                                       ` Dmitry Gutov [this message]
2023-03-27  8:24                                                         ` Gregory Heytings
2023-03-27 13:39                                                           ` Eli Zaretskii
2023-03-27 20:05                                                             ` Gregory Heytings
2023-03-28 11:30                                                               ` Eli Zaretskii
2023-03-28 11:39                                                                 ` Gregory Heytings
2023-03-28 12:11                                                                   ` Eli Zaretskii
2023-03-28 12:25                                                                     ` Gregory Heytings
2023-03-28 12:36                                                                       ` Eli Zaretskii
2023-03-27 23:06                                                             ` Dmitry Gutov
2023-03-28 11:32                                                               ` Eli Zaretskii
2023-03-28 21:08                                                                 ` Dmitry Gutov
2023-03-29 11:08                                                                   ` Eli Zaretskii
2023-03-31  1:10                                                                     ` Dmitry Gutov
2023-03-31  1:27                                                                       ` Dmitry Gutov
2023-03-31  6:19                                                                       ` Eli Zaretskii
2023-03-31  7:46                                                                         ` Eli Zaretskii
2023-03-31 12:38                                                                           ` Dmitry Gutov
2023-03-31 13:03                                                                             ` Eli Zaretskii
2023-03-31 13:26                                                                               ` Dmitry Gutov
2023-03-31 12:46                                                                         ` Dmitry Gutov
2023-03-31 13:06                                                                           ` Eli Zaretskii
2023-03-31 18:43                                                                           ` Yuan Fu
2023-04-01  1:53                                                                             ` Dmitry Gutov
2023-04-01  5:47                                                                             ` Eli Zaretskii
2023-04-01 16:12                                                                               ` Dmitry Gutov
2023-04-02 22:08                                                                               ` Yuan Fu
2023-04-03 12:31                                                                                 ` Eli Zaretskii
2023-03-27 23:20                                                           ` Dmitry Gutov
2023-03-27 13:29                                                         ` Eli Zaretskii
2023-03-27 23:33                                                           ` Dmitry Gutov
2023-03-28 11:38                                                             ` Eli Zaretskii
2023-03-28 21:19                                                               ` Dmitry Gutov
2023-03-29 11:17                                                                 ` Eli Zaretskii
2023-03-30 15:50                                                                   ` Gregory Heytings
2023-03-30 16:04                                                                     ` Eli Zaretskii
2023-03-30 16:28                                                                       ` Gregory Heytings
2023-03-30 16:40                                                                         ` Eli Zaretskii
2023-03-30 17:27                                                                           ` Gregory Heytings
2023-03-30 17:47                                                                             ` Eli Zaretskii
2023-03-30 20:14                                                                               ` Gregory Heytings
2023-03-30 22:08                                                                                 ` Gregory Heytings
2023-03-31  6:15                                                                                   ` Eli Zaretskii
2023-03-31  1:25                                                                       ` Dmitry Gutov
2023-03-31  6:22                                                                         ` Eli Zaretskii
2023-03-31  1:17                                                                   ` 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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9886ffa5-ead2-50d5-a325-f6704b736ada@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=62333@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    --cc=wkirschbaum@gmail.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).