GNU bug report logs - #41897
28.0.50; JavaScript comment filling with mhtml-mode

Previous Next

Package: emacs;

Reported by: Simen Heggestøyl <simenheg <at> runbox.com>

Date: Tue, 16 Jun 2020 17:10:01 UTC

Severity: normal

Found in version 28.0.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


Message #83 received at 41897 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Tom Tromey <tom <at> tromey.com>
Cc: Simen Heggestøyl <simenheg <at> runbox.com>, acm <at> muc.de,
 41897 <at> debbugs.gnu.org
Subject: Re: bug#41897: 28.0.50; JavaScript comment filling with mhtml-mode
Date: Fri, 26 Jun 2020 16:46:02 +0000
Hello, Tom.

On Thu, Jun 25, 2020 at 14:49:57 -0600, Tom Tromey wrote:
> >>>>> "Alan" == Alan Mackenzie <acm <at> muc.de> 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).




This bug report was last modified 5 years and 42 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.