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: Fri, 26 Jun 2020 16:46:02 +0000 Message-ID: <20200626164602.GB9041@ACM> References: <20200620171827.7855.qmail@mail.muc.de> <87d05ta8z9.fsf@simenheg@gmail.com> <20200622191750.GA11506@ACM> <87v9jeeuq2.fsf@tromey.com> 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="128053"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Simen =?UTF-8?Q?Heggest=C3=B8yl?= , acm@muc.de, 41897@debbugs.gnu.org To: Tom Tromey Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 26 19:01:03 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 1jorip-000XFV-Cv for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Jun 2020 19:01:03 +0200 Original-Received: from localhost ([::1]:38104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jorio-0002qD-7X for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Jun 2020 13:01:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jorVI-0004Vz-EX for bug-gnu-emacs@gnu.org; Fri, 26 Jun 2020 12:47:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59680) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jorVG-00082h-3X for bug-gnu-emacs@gnu.org; Fri, 26 Jun 2020 12:47:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jorVG-0000Nh-0S for bug-gnu-emacs@gnu.org; Fri, 26 Jun 2020 12:47: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: Fri, 26 Jun 2020 16:47:01 +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.15931899741407 (code B ref 41897); Fri, 26 Jun 2020 16:47:01 +0000 Original-Received: (at 41897) by debbugs.gnu.org; 26 Jun 2020 16:46:14 +0000 Original-Received: from localhost ([127.0.0.1]:42993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jorUT-0000Md-TR for submit@debbugs.gnu.org; Fri, 26 Jun 2020 12:46:14 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:63696 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1jorUQ-0000MM-Ky for 41897@debbugs.gnu.org; Fri, 26 Jun 2020 12:46:12 -0400 Original-Received: (qmail 31148 invoked by uid 3782); 26 Jun 2020 16:46:03 -0000 Original-Received: from acm.muc.de (p4fe15a5a.dip0.t-ipconnect.de [79.225.90.90]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Fri, 26 Jun 2020 18:46:02 +0200 Original-Received: (qmail 9554 invoked by uid 1000); 26 Jun 2020 16:46:02 -0000 Content-Disposition: inline In-Reply-To: <87v9jeeuq2.fsf@tromey.com> 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:182412 Archived-At: Hello, Tom. On Thu, Jun 25, 2020 at 14:49:57 -0600, Tom Tromey wrote: > >>>>> "Alan" == Alan Mackenzie writes: > Alan> (ii) An enhancement to CC Mode, used by mhtml-mode and js-mode, which > Alan> invalidates a CC Mode cache used by the filling code. This gets rid of > Alan> a few strange looking bugs; > I wonder if js-mode can be changed not to use cc-mode like this. The main filling function in CC Mode is 390 lines long. It deals with lots of special cases, like comment markers being or not being on lines by themselves, and so on. It's understandable to want to reuse it rather than copying it into a js-... function. > Looking at js.el, it seems like this is the origin of a use of advice > in-core, which is generally frowned upon: > ;; FIXME: Such redefinitions are bad style. We should try and use some other > ;; way to get the same result. > (defun js--fill-c-advice (js-fun) > ... Funnily enough, as CC Mode maintainer, I don't find this artifice particularly objectionable. Advice has its uses, even in the core. > Tom -- Alan Mackenzie (Nuremberg, Germany).