[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Different fontification in temp buffer
From: |
Daniele Nicolodi |
Subject: |
Re: Different fontification in temp buffer |
Date: |
Sun, 20 Jan 2019 08:55:18 -0700 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
Hi Noam,
On 20/01/2019 06:57, Noam Postavsky wrote:
> On Sat, 19 Jan 2019 at 21:14, Daniele Nicolodi <address@hidden> wrote:
>>
>> On 19/01/2019 17:48, Daniele Nicolodi wrote:
>
>>> I'm hacking on a minor mode and I'm writing unit tests for the
>>> fontification feature. I am encountering a strange issue: the
>>> fontification is different if execute in a temp buffer or in a regular
>>> buffer.
>
>> Investigating further, the difference between the two cases is that
>> with-temp-buffer creates a buffer that does not keep undo information.
>
> It's not about undo info, but rather that font-lock mode doesn't turn
> on in temp buffers.
>
> See in the definition of font-lock-mode:
> http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/font-core.el?h=emacs-26.1#n135
>
> ;; Don't turn on Font Lock mode if we don't have a display (we're running a
> ;; batch job) or if the buffer is invisible (the name starts with a space).
> (when (or noninteractive (eq (aref (buffer-name) 0) ?\s))
> (setq font-lock-mode nil))
I'm explicitly turning on font-lock mode with (font-lock-ensure). The
buffer is indeed fontified, but apparently with a different syntax
table. However, I don't fully understand what beancount-mode does with
the syntax table, thus I cannot exclude a bug there.
Cheers,
Dan
Re: Different fontification in temp buffer, Stefan Monnier, 2019/01/20