[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ert batch-mode error
From: |
Stefan Monnier |
Subject: |
Re: Ert batch-mode error |
Date: |
Mon, 13 Apr 2020 13:47:50 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>> But looking at yasnippet-tests.el, I'm not sure what's going on:
>> the only case where font-lock seems to be relevant is
>> `do-yas-org-native-tab-in-source-block` (and it already uses
>> `font-lock-ensure` when available). So (barring compatibility with
>> Emacs<24 for which you still need the non-font-lock-ensure version),
>> would the patch below still perform the tests correctly?
>
> As far as I can tell, the problem actually seems to be 24.3 specific,
> so yes, assuming you meant <=24 rather than <24. In 24.3, the
> following triggers an error when run interactively, but there is no
> error in --batch mode, or when using with-temp-buffer (this is a
> reduction from yasnippet's example-for-issue-474 test). That was the
> motivation for adding yas--with-font-locked-temp-buffer (and I just
> threw it in for all cc-mode related tests, just in case).
>
> (setq debug-on-error t)
> (with-current-buffer (get-buffer-create "foo") ;with-temp-buffer
> (c-mode)
> (insert "#include <foo>\n")
> (narrow-to-region (point) (point))
> (insert "`\"TODO: \"`")
> (delete-region (point-min) (point-max))
> (insert "TODO: "))
So, IIUC example-for-issue-474 failed in Emacs-24.3, because of a bug in
CC-mode. Not sure why yasnippet cares, but in any case, I'd recommend
you put a comment there to clarify it.
Stefan