[Top][All Lists]

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

Re: Different fontification in temp buffer

From: Noam Postavsky
Subject: Re: Different fontification in temp buffer
Date: Sun, 20 Jan 2019 08:57:23 -0500

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:

  ;; 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))

reply via email to

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