unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniele Nicolodi <daniele@grinta.net>
To: emacs-devel@gnu.org
Subject: Re: Different fontification in temp buffer
Date: Sun, 20 Jan 2019 08:55:18 -0700	[thread overview]
Message-ID: <34163f7b-3db3-16fc-77f5-7662493eb73a@grinta.net> (raw)
In-Reply-To: <CAM-tV-8a+PtfOVuv0zpxR9xGBHb+76xFftrHu59MHxijBsGecA@mail.gmail.com>

Hi Noam,

On 20/01/2019 06:57, Noam Postavsky wrote:
> On Sat, 19 Jan 2019 at 21:14, Daniele Nicolodi <daniele@grinta.net> 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



  reply	other threads:[~2019-01-20 15:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-20  0:48 Different fontification in temp buffer Daniele Nicolodi
2019-01-20  2:14 ` Daniele Nicolodi
2019-01-20 13:57   ` Noam Postavsky
2019-01-20 15:55     ` Daniele Nicolodi [this message]
2019-01-20 17:56       ` Noam Postavsky
2019-01-20 18:32         ` Daniele Nicolodi
2019-01-21  2:51 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34163f7b-3db3-16fc-77f5-7662493eb73a@grinta.net \
    --to=daniele@grinta.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).