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: Different fontification in temp buffer Date: Sat, 19 Jan 2019 17:48:51 -0700 Message-ID: <36cc3b65-2459-bf32-37f1-2bd538fafe07@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 1547945343 211790 195.159.176.228 (20 Jan 2019 00:49:03 GMT) X-Complaints-To: usenet@ciao.gmane.org NNTP-Posting-Date: Sun, 20 Jan 2019 00:49:03 +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 developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 20 01:49:02 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 1gl1II-000t58-RD for ged-emacs-devel@m.gmane.org; Sun, 20 Jan 2019 01:48:59 +0100 Original-Received: from localhost ([127.0.0.1]:33512 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gl1IR-0001g0-79 for ged-emacs-devel@m.gmane.org; Sat, 19 Jan 2019 19:49:07 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gl1IK-0001fs-CG for emacs-devel@gnu.org; Sat, 19 Jan 2019 19:49:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gl1II-0008Ev-JQ for emacs-devel@gnu.org; Sat, 19 Jan 2019 19:48:59 -0500 Original-Received: from zed.grinta.net ([109.74.203.128]:48282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gl1IH-0008Dq-9z for emacs-devel@gnu.org; Sat, 19 Jan 2019 19:48:58 -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 53B11E315D for ; Sun, 20 Jan 2019 00:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=grinta.net; s=mail; t=1547945335; bh=sgdabsyKdq3UAIwJ9WdDQTqgKh4yjuzuR9MSonhApA4=; h=To:From:Subject:Date:From; b=HSFYDN9OgWWFPTfFduSdODSwEWDzXOeF1xy1M92wWIKEN2nwKuVRPu3c7AR+VrhwS nhjqdZWW/f9xkQxzPwHNhBdrNAJrUIIfqR57erFTaF8NGlYZuS02tOJjWkbmJruOdh GVZYyAzXFugWTk6iWI3L1yzFG0YAq8XufKzD8U+E= Openpgp: preference=signencrypt 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:232517 Archived-At: Hello, 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. In particular: (with-temp-buffer (insert string) (fundamental-mode) (beancount-mode) (font-lock-ensure) (buffer-string)) and (with-current-buffer (generate-new-buffer "*test*") (insert string) (fundamental-mode) (beancount-mode) (font-lock-ensure) (buffer-string)) strangely result in two different results. Why is it so? Thank you. Cheers, Dan