From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#41897: 28.0.50; JavaScript comment filling with mhtml-mode Date: Sat, 27 Jun 2020 11:06:48 +0000 Message-ID: <20200627110648.GA5155@ACM> References: <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=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="122035"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Simen =?UTF-8?Q?Heggest=C3=B8yl?= , acm@muc.de, 41897@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 27 13:08: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 1jp8gt-000VgU-6W for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Jun 2020 13:08:11 +0200 Original-Received: from localhost ([::1]:41510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jp8gs-0001Q0-6F for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Jun 2020 07:08:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jp8gk-0001Po-WB for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2020 07:08:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jp8gk-0003uN-Mq for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2020 07:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jp8gk-0005Eu-Hk for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2020 07:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Jun 2020 11:08: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.159325602920077 (code B ref 41897); Sat, 27 Jun 2020 11:08:02 +0000 Original-Received: (at 41897) by debbugs.gnu.org; 27 Jun 2020 11:07:09 +0000 Original-Received: from localhost ([127.0.0.1]:43537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jp8fh-0005DI-Lr for submit@debbugs.gnu.org; Sat, 27 Jun 2020 07:07:09 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:48771 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1jp8fg-0005D4-FD for 41897@debbugs.gnu.org; Sat, 27 Jun 2020 07:06:57 -0400 Original-Received: (qmail 38959 invoked by uid 3782); 27 Jun 2020 11:06:49 -0000 Original-Received: from acm.muc.de (p2e5d5209.dip0.t-ipconnect.de [46.93.82.9]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Sat, 27 Jun 2020 13:06:49 +0200 Original-Received: (qmail 7195 invoked by uid 1000); 27 Jun 2020 11:06:48 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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:182435 Archived-At: Hello, Dmitry. On Fri, Jun 26, 2020 at 00:20:07 +0300, Dmitry Gutov wrote: > 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. We're talking about a long pause at the end of each line when typing in a longish block comment whilst auto-fill-mode is enabled. > >>> 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. If I understand correctly, there is already special case code for js-mode anyway, in mmm-erb.el. The :creation-hook for js-mode is currently set to mmm-erb-mark-as-special, a function shared with ruby-mode. Would it really be all that distressing to write a new :creation-hook for js-mode which additionally initialises the part of CC Mode which needs it? We'd be talking about something like (defun mmm-js-init () "Doc string." (overlay-put mmm-current-overlay 'mmm-special-tag t) (c-foreign-init-lit-pos-cache) (add-hook 'before-change-functions #'c-foreign-truncate-lit-pos-cache nil t)) . Would that really be so bad? It would even be possible to move the explicit add-hook into a small function in CC Mode and call that instead. But I think it's better to see the add-hook where it might make a difference. That's all assuming I've understood mmm-mode properly. [ .... ] -- Alan Mackenzie (Nuremberg, Germany).