[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line
From: |
Alan Mackenzie |
Subject: |
Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language |
Date: |
Fri, 20 Aug 2021 10:48:04 +0000 |
Hello, Basil.
On Thu, Aug 19, 2021 at 01:15:04 +0100, Basil L. Contovounesios wrote:
[ .... ]
> Tonight, I tried the following approach instead (in an unedited source
> tree):
> 0. C-x p c make TEST_LOAD_EL=no test/electric-tests RET
> 1. M-! pkill -SIGUSR2 -f ert-run-tests RET
> I repeated this a few times, and the *emacs-compilation* buffer reliably
> contained the same backtrace:
> --8<---------------cut here---------------start------------->8---
> Test electric-layout-plainer-c-mode-use-c-style backtrace:
> c-tnt-chng-cleanup(nil [(nil . t) #<buffer *Test buffer (electric-la
> #f(compiled-function () #<bytecode 0x1ce6cae08acf>)()
> c-point-syntax()
> electric-layout-for-c-style-du-jour(123)
> electric-layout-post-self-insert-function-1()
> electric-layout-post-self-insert-function()
> self-insert-command(1 123)
> funcall-interactively(self-insert-command 1 123)
> call-interactively(self-insert-command)
> #f(compiled-function () #<bytecode -0x8b013aec04deab5>)()
> ert--call-with-test-buffer(nil #f(compiled-function () #<bytecode -0
> #f(compiled-function () #<bytecode -0x10479e86da51cfc>)()
> ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
> ert-run-test(#s(ert-test :name electric-layout-plainer-c-mode-use-c-
> ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
> ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
> ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
> ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
> eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
> command-line-1(("-L" ":." "-L" "./../../elpa/packages/url-http-ntlm/
> command-line()
> normal-top-level()
> Test electric-layout-plainer-c-mode-use-c-style condition:
> Buffer: *Test buffer (electric-layout-plainer-c-mode-use-c-style)*
> (quit)
> QUIT 5/478 electric-layout-plainer-c-mode-use-c-style (54.497779 sec)
> --8<---------------cut here---------------end--------------->8---
> Sprinkling some prints in c-tnt-chng-cleanup revealed that the following
> loop never terminates:
> (let ((undo-in-progress t))
> (while (not (eq (setq buffer-undo-list
> (primitive-undo 1 buffer-undo-list))
> saved-undo-list))))
> HTH,
That helps a great deal, thanks!
The problem is a bug in c-point-syntax. There, there is
(i) an invocation of c-save-buffer-state, which binds buffer-undo-list
to t, followed by
(ii) an invocation of c-tentative-buffer-changes, which pushes nil onto
buffer-undo-list (simulating an undo group) giving (nil t).
(iii) A { is typed into the buffer, giving buffer-undo-list now as
something like ((5128 . 5129) nil t).
At this point garbage collection occurs. This strips the tail of
buffer-undo-list, leaving ((5128 . 5129)).
(iv) In c-tnt-chng-cleanup, primitive-undo is repeated infinitely,
since buffer-undo-list will never become the expected value (nil t).
The problem would appear to be the invalid value ((5128 . 5129) nil t) in
buffer-undo-list.
I'll see what I can do about this tonight.
> --
> Basil
--
Alan Mackenzie (Nuremberg, Germany).
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, (continued)
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Alan Mackenzie, 2021/08/15
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Lars Ingebrigtsen, 2021/08/16
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Basil L. Contovounesios, 2021/08/17
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Basil L. Contovounesios, 2021/08/17
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Lars Ingebrigtsen, 2021/08/18
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Basil L. Contovounesios, 2021/08/18
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Alan Mackenzie, 2021/08/18
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Alan Mackenzie, 2021/08/18
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Alan Mackenzie, 2021/08/18
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Basil L. Contovounesios, 2021/08/18
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language,
Alan Mackenzie <=
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Alan Mackenzie, 2021/08/20
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Basil L. Contovounesios, 2021/08/20
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Alan Mackenzie, 2021/08/21
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Eli Zaretskii, 2021/08/21
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Alan Mackenzie, 2021/08/21
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Eli Zaretskii, 2021/08/21
- Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language, Basil L. Contovounesios, 2021/08/18