From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#41897: 28.0.50; JavaScript comment filling with mhtml-mode Date: Fri, 26 Jun 2020 00:20:07 +0300 Message-ID: References: <20200623191713.GC6957@ACM> <4c6a9c40-a72c-1413-4e08-c7097f8bc407@yandex.ru> <20200624174333.GA8870@ACM> <20200625163301.GA10342@ACM> <20200625180722.GC10342@ACM> <20200625191359.GD10342@ACM> <70532224-5beb-b311-648c-fda352de88cb@yandex.ru> <20200625201100.GE10342@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="95170"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 Cc: Simen =?UTF-8?Q?Heggest=C3=B8yl?= , 41897@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 25 23:21:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joZJ1-000Of0-I0 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Jun 2020 23:21:11 +0200 Original-Received: from localhost ([::1]:40290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joZJ0-0008WC-Fa for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Jun 2020 17:21:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joZIs-0008W0-UR for bug-gnu-emacs@gnu.org; Thu, 25 Jun 2020 17:21:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58063) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1joZIs-0002qx-LG for bug-gnu-emacs@gnu.org; Thu, 25 Jun 2020 17:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1joZIs-0002eP-HF for bug-gnu-emacs@gnu.org; Thu, 25 Jun 2020 17:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jun 2020 21:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41897 X-GNU-PR-Package: emacs Original-Received: via spool by 41897-submit@debbugs.gnu.org id=B41897.159312002110071 (code B ref 41897); Thu, 25 Jun 2020 21:21:02 +0000 Original-Received: (at 41897) by debbugs.gnu.org; 25 Jun 2020 21:20:21 +0000 Original-Received: from localhost ([127.0.0.1]:41372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1joZIC-0002cL-NM for submit@debbugs.gnu.org; Thu, 25 Jun 2020 17:20:20 -0400 Original-Received: from mail-ed1-f46.google.com ([209.85.208.46]:39809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1joZI8-0002bt-MA for 41897@debbugs.gnu.org; Thu, 25 Jun 2020 17:20:19 -0400 Original-Received: by mail-ed1-f46.google.com with SMTP id g1so5342638edv.6 for <41897@debbugs.gnu.org>; Thu, 25 Jun 2020 14:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=gfURV45MZ39Px05QfC1DMaMs5IbVlpnUnMROnaSxhGM=; b=JN4hJvn4qUmp+htZyXS6Csw3QdFYRcZ9cKH2cX4qh5uCTuOnY6/OLjRbuwmIWzkQ/C 73BmcboLWAwn/K2eWAEnYsP2GA6FJQSeeTGVI4OJNdKoO4ODbXKl1ms9Ee7p0gfGIZJR L7nQgy6Oqqaaz5Bwc7QnS11CDSbBkxlkE70q8Br7hB4u/47fOgEk0swTgAKS7qnnYMx6 B1y9oN05WchbcLIx4d8XJnBDyxmO9MgorZEmE1jP2VzlHWHMuWv/linbz12/jYQTs3zV n38HCkzQsYzJaeEgPnOmHRepswiXiAiSqvXpZHeUpABW8WWJclMM3fKXVVOC1ZdUOhJq btQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gfURV45MZ39Px05QfC1DMaMs5IbVlpnUnMROnaSxhGM=; b=b1p1NTZ3+T+EmBcSSskwC8BT21AoZNXMQH5IyW3kJUPvyv7LTz9CvRdZZFM/pzQQ2A ZWgJXqXjyQhy8JAugUN36AfVw/j0BTQ95XGcHhsFH8+HeqHIRn04xeQk0Q9hUD9XDzvt Kp2IfxJrwtstf7Fi+sELaePlaHfHW2rCVpe4OfQdRRH0/lhv+cE/4v3cYEtNx3d6DK9c 7KOcwIBKkutXL021Mtm5jS3hLA5DMDHPd0v8Fcq/kqRIX3dj45vegVvoGFktzjNSexPm 5V9rPozqr8bO/heRy8HQy0zSWOqRfR5wlm2oJXTubBc3nU+V7eFDIwUnVzVKUE52LThv /QQw== X-Gm-Message-State: AOAM530qUOVO5nKn1O38yxVffpl2KiDeo+WQtNhl4iof7EiKQoRyaf+h 7UIHiCAKleJmz+iw5E+/SNiP+Ph5 X-Google-Smtp-Source: ABdhPJzjS8qNhBptqVWtpASNw1rzhAkVvBLDXQnJR9C95C8bq38HaDvqV9n9UJvKhFNpCLbBkHtBnw== X-Received: by 2002:a05:6402:31b8:: with SMTP id dj24mr193448edb.188.1593120010513; Thu, 25 Jun 2020 14:20:10 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id y21sm17246101ejp.32.2020.06.25.14.20.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Jun 2020 14:20:09 -0700 (PDT) In-Reply-To: <20200625201100.GE10342@ACM> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:182396 Archived-At: On 25.06.2020 23:11, Alan Mackenzie wrote: > Sluggish performance isn't about "usually" and 98% of the time; it's > about unusual constellations and the other 2%. Still, a slow-ish fill-paragraph is nowhere near as bad as, say, slowdown during typing. >>> 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? > >> That would be something every user that configures a submode class using >> js-mode have to be aware of. That's not easy to document, or even if we >> made sure it's documented, to be sure that users read it. > > Are you telling me that mmm-mode couldn't keep a watch out for js-mode, > leaving other libraries untroubled? Again, the trouble here appears to > arise from using something (a mode) without first initialising it. Sounds like special-casing js-mode, before-change-functions and this particular function all together. Basically, like a magic constant in the code. This is ultimately doable, but I'm not sure how to write a patch for it which wouldn't leave me feeling dirty after. >> These do seem to be the options: some C core support (though I'm not >> clear on the particulars of the proposed design), or switching from >> ad-hoc caches to syntax-propertize-function and and associated >> syntax-ppss cache. > > The syntax-propertize-function approach is poor design. It restricts the > use of the syntax-table text property too much. syntax-ppss has had a > troubled history and doesn't do the right thing in narrowed buffers. It > advertises itself as a magic wand which does everything, but when you've > been enticed into committing your SW to it, you then find out it's less > than magic, and you've got to call ugly functions by hand at strange > times, and are restricted in how and when you can use it. Despite certain edge cases, I've had a lot of success with it. Both in major modes, and in mmm-mode thanks to it.