From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Schmitt Newsgroups: gmane.emacs.devel Subject: Re: set-text-properties and jit-lock-mode Date: Mon, 22 Feb 2016 08:29:15 +0100 Message-ID: References: <20160221190438.GB2220@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1456126225 15441 80.91.229.3 (22 Feb 2016 07:30:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Feb 2016 07:30:25 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 22 08:30:19 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 1aXkwk-0004u4-F3 for ged-emacs-devel@m.gmane.org; Mon, 22 Feb 2016 08:30:18 +0100 Original-Received: from localhost ([::1]:47445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXkwj-0004Dz-RB for ged-emacs-devel@m.gmane.org; Mon, 22 Feb 2016 02:30:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXkw3-0003fW-E5 for emacs-devel@gnu.org; Mon, 22 Feb 2016 02:29:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXkw0-0000iZ-8I for emacs-devel@gnu.org; Mon, 22 Feb 2016 02:29:35 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:39263) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXkw0-0000iV-1h for emacs-devel@gnu.org; Mon, 22 Feb 2016 02:29:32 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aXkvy-0004Ez-OO for emacs-devel@gnu.org; Mon, 22 Feb 2016 08:29:30 +0100 Original-Received: from charm-ecran.irisa.fr ([131.254.101.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Feb 2016 08:29:30 +0100 Original-Received: from alan.schmitt by charm-ecran.irisa.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Feb 2016 08:29:30 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: charm-ecran.irisa.fr User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:YamszZHWqLc64EfmrCfg4zewDj0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:200441 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-02-21 20:04, Alan Mackenzie writes: >> 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. > > At a guess, what's happening here is this: your `set-text-properties' > does indeed work. But setting text properties is a buffer change. So > `before-change-functions' and `after-change-functions' will both be > executed. `a-c-f' contains `jit-lock-after-change', which helpfully > refontifies the line for you. All this happens before the screen is > redisplayed. > > If you bind these hooks to nil around your call, I think it will work: > > (let (before-change-functions after-change-functions) > (set-text-properties 192 195 (list 'face 'italic))) Thanks a lot for the suggestion, but unfortunately it does not work. I guess some other function must be re-fontifying the text. Alan =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 Monthly Athmospheric CO=E2=82=82 (2016-01, Mauna Loa Obs.): 402.52 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJWyrjLAAoJEAQNCjtO0uXHWAEIAI1rxVhFTJELxx139MJ6WaQ6 lwtd6O10Sbs8/KzytwiZfxiJjxvHPWb9vtIMMcx/yCY/cH9a01vPOKhffyn6Cl5V +TY/HQ/5nGlvku7KXsJRsnEx+M8kffqxrhadicH9Ye/OYMnAtsnc10NJEHqUfYHO Cy3VFcitSx7r13yN3SfhLBTv22mMVsy3CrrBppZ84kr7OP11qylc8j0i35PoxarE nhhJ/J5TFOuVb2BO84yCmWD6o5uCdceQyCK2+4gd8H9V3ABKI+d/2QlCWqCUuSkc p18a0vDUAVsNT/zN3/cx7lE/Pkk9PYUets62VvGCnWkaZDDp95W8rzJ7OZoE6wA= =vsEU -----END PGP SIGNATURE----- --=-=-=--