From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: set-text-properties and jit-lock-mode Date: Sun, 21 Feb 2016 22:30:31 +0200 Message-ID: <83d1rpn6vs.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1456086657 24030 80.91.229.3 (21 Feb 2016 20:30:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Feb 2016 20:30:57 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Schmitt Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 21 21:30:52 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aXaea-0000di-Md for ged-emacs-devel@m.gmane.org; Sun, 21 Feb 2016 21:30:52 +0100 Original-Received: from localhost ([::1]:43928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXaeZ-0002oq-Sm for ged-emacs-devel@m.gmane.org; Sun, 21 Feb 2016 15:30:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXaeW-0002oL-GZ for emacs-devel@gnu.org; Sun, 21 Feb 2016 15:30:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXaeR-0000qU-Ep for emacs-devel@gnu.org; Sun, 21 Feb 2016 15:30:48 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXaeQ-0000qQ-RM; Sun, 21 Feb 2016 15:30:43 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4344 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aXaeQ-0002K5-4m; Sun, 21 Feb 2016 15:30:42 -0500 In-reply-to: (message from Alan Schmitt on Sun, 21 Feb 2016 19:02:31 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:200403 Archived-At: > From: Alan Schmitt > Date: Sun, 21 Feb 2016 19:02:31 +0100 > > The problem: if jit-lock-mode it t, then using set-text-properties to > change the face does not work. > > To reproduce: start emacs with -Q. In the scratch buffer, type "foo". > Then evaluate: > (set-text-properties 192 195 (list 'face 'italic)) > > Nothing changes, and when I do a `describe-char' on one letter of "foo" > I don't see the face. > > If I then evaluate > (setq jit-lock-mode nil) > (set-text-properties 192 195 (list 'face 'italic)) > > then I see the face change to italic, confirmed by `describe-char'. > > As `set-text-properties' is a function in C, I don't know how to look at > its source (any pointers on how to do this would be great). You don't need to look at its source. The documentation clearly says that it completely replaces the property list of the specified region with the properties you specify as its arguments. > Is it supposed not to work for faces when jit-lock is on? Yes. Font-lock overwrites the 'face' text properties with its own, because it uses set-text-properties.