bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#51665: 28.0.50; [PATCH] Get electric-tests to pass


From: Lars Ingebrigtsen
Subject: bug#51665: 28.0.50; [PATCH] Get electric-tests to pass
Date: Sun, 07 Nov 2021 21:19:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Jim Porter <jporterbugs@gmail.com> writes:

> I've been tinkering with this and I *think* the issue is with the hook
> I added at global scope:
>
>   (add-hook 'c-mode-hook (lambda () (c-toggle-comment-style -1)))

In general, doing an add-hook with a non-symbol function isn't
supported -- it may end up adding the function more than once if it
first loads the uncompiled file, and then loads the compiled file, I
think?  (Because the lambda will have been turned into a byte-code
object.)  So it seems logical that inhibiting byte compilation also made
the problem go away.

Anyway, your patch is the right fix here, so I've pushed it to Emacs 29
now.

> (As an aside, I vaguely recall adding that hook at global scope
> because multiple tests failed without it, but it was a while since I
> wrote that patch and I may be misremembering. In any case, it seems
> that at least today, changing the comment style is only needed for
> that one test, so I think it makes sense to do it in a fixture solely
> for that test.)

Seems to work for me too here.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]