From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniele Nicolodi Newsgroups: gmane.emacs.devel Subject: Re: Different fontification in temp buffer Date: Sun, 20 Jan 2019 08:55:18 -0700 Message-ID: <34163f7b-3db3-16fc-77f5-7662493eb73a@grinta.net> References: <36cc3b65-2459-bf32-37f1-2bd538fafe07@grinta.net> <240a311e-ec17-8c91-74c1-d30fd4da2809@grinta.net> NNTP-Posting-Host: ciao.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: ciao.gmane.org 1547999751 99791 195.159.176.228 (20 Jan 2019 15:55:51 GMT) X-Complaints-To: usenet@ciao.gmane.org NNTP-Posting-Date: Sun, 20 Jan 2019 15:55:51 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 20 16:55:49 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1glFRs-000PwJ-Ca for ged-emacs-devel@m.gmane.org; Sun, 20 Jan 2019 16:55:48 +0100 Original-Received: from localhost ([127.0.0.1]:41346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glFRr-0003IW-3g for ged-emacs-devel@m.gmane.org; Sun, 20 Jan 2019 10:55:47 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glFRl-0003IQ-GD for emacs-devel@gnu.org; Sun, 20 Jan 2019 10:55:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1glFRj-0007ms-BO for emacs-devel@gnu.org; Sun, 20 Jan 2019 10:55:40 -0500 Original-Received: from zed.grinta.net ([109.74.203.128]:49032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glFRa-0007LV-Nw for emacs-devel@gnu.org; Sun, 20 Jan 2019 10:55:32 -0500 Original-Received: from black.hsd1.co.comcast.net (c-98-245-163-4.hsd1.co.comcast.net [98.245.163.4]) (Authenticated sender: daniele) by zed.grinta.net (Postfix) with ESMTPSA id E8928E3C0B for ; Sun, 20 Jan 2019 15:55:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=grinta.net; s=mail; t=1547999722; bh=MPGY3VTLuGQkNTBkB6vUYbeHUwOmAl825uxPiRgAyOo=; h=Subject:To:References:From:Date:In-Reply-To:From; b=NhUWkdy+NfSOr+CWZJ/q2oIKEhfjqKr6SEEIEmtIz8SHUEhf9iD244uhAlgZ7TXsX kkmr+NiYiQV2kWzuxRcHQs8fNRxS8EjJo8gyIcB57meFhP+k2halG8oqlYEBz2HiDN Vv1ouO4CFs6u1m93ZEcp+tR5WmH/bqAPBSD1Sds4= Openpgp: preference=signencrypt In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 109.74.203.128 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232541 Archived-At: Hi Noam, On 20/01/2019 06:57, Noam Postavsky wrote: > On Sat, 19 Jan 2019 at 21:14, Daniele Nicolodi 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