From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Newsgroups: gmane.emacs.bugs Subject: bug#25672: Font-locking issues when font-lock-fontified is nil (Was: What to do when font-lock-flush + font-lock-ensure do less than font-lock-fontify-buffer? on emacs-devel) Date: Thu, 9 Feb 2017 16:22:21 -0500 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Okm9eQ9Eo94jb5XbthjHF5igpqgF3E8JV" X-Trace: blaine.gmane.org 1486675393 18184 195.159.176.226 (9 Feb 2017 21:23:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 9 Feb 2017 21:23:13 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 Cc: monnier@iro.umontreal.ca To: 25672@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 09 22:23:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbwBH-0004Us-QL for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Feb 2017 22:23:08 +0100 Original-Received: from localhost ([::1]:40273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbwBN-0005jo-0g for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Feb 2017 16:23:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbwBG-0005jf-M9 for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2017 16:23:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbwBC-0002CC-NH for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2017 16:23:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35306) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cbwBC-0002Bl-Jw for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2017 16:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cbwBC-0005oR-2U; Thu, 09 Feb 2017 16:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-Sender: "Debbugs-submit" Resent-CC: monnier@iro.umontreal.ca, bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Feb 2017 21:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25672 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: monnier@iro.umontreal.ca Original-Received: via spool by submit@debbugs.gnu.org id=B.148667536422304 (code B ref -1); Thu, 09 Feb 2017 21:23:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Feb 2017 21:22:44 +0000 Original-Received: from localhost ([127.0.0.1]:33504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbwAt-0005nf-PL for submit@debbugs.gnu.org; Thu, 09 Feb 2017 16:22:44 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbwAs-0005nT-8c for submit@debbugs.gnu.org; Thu, 09 Feb 2017 16:22:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbwAl-0001ko-PN for submit@debbugs.gnu.org; Thu, 09 Feb 2017 16:22:37 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:35093) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cbwAl-0001kk-M5 for submit@debbugs.gnu.org; Thu, 09 Feb 2017 16:22:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbwAk-0005d7-EX for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2017 16:22:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbwAg-0001kY-FS for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2017 16:22:34 -0500 Original-Received: from mout.kundenserver.de ([212.227.17.13]:56878) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cbwAg-0001kM-3g for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2017 16:22:30 -0500 Original-Received: from [18.111.113.197] ([18.111.113.197]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.184]) with ESMTPSA (Nemesis) id 0MHYCK-1cYcmt49ro-003Nh0 for ; Thu, 09 Feb 2017 22:22:28 +0100 X-Provags-ID: V03:K0:vB3C6VcVmSNAGDMQVvzteuWNXu1lWegpq1d7FUMYZIUfJwJadFY dRvRT+HHtX12nmM6fKGyX3GSoExuiW6EwN97nJqyptuIR406pzlcbjxsOiOK2RJR1V2Zz3h RxH13TDmpBmKJB/MpTiesNbbrUOfsLVlvAFToUDstyMeXpNu2gxIM9k8jqnUkgsEY2An5WS 4pfP1FRqhgByrEp+9C44g== X-UI-Out-Filterresults: notjunk:1;V01:K0:2vS36jkP5Dk=:s9K5TIoW36P5NxefQuW3iZ kzvk6FrpYemTx9yNTK0SP8pZd+e9cZInpmpNvL286EgiyPA0eW8SXwLhHLuimaHri6MDieX71 XEaBpwemwll8QOm+Rtzmvd0e6OR1ydmdd6SE7dHNkmJSYWFfs0OSWA2rFoSiooYv9t9puILSl O5YMvznlMr0elpZOhAzQSQBH7NTOmAgXyzBwQdOv34SeXmAikbGgwH3GKu6bpmWJ7ijj+UwXA coJldMSA+ot4XkzGGutJDeZkBBmY6Q5zuYEoP4+hjftJ9z/v+cedJ7ezMIZ+NQz6NeK7G0uUw fTKDMM45h1l/3vi+xtSZ/hnAp3h2Jx8doypdzxZ0ms5uTzgzrUrdFZkIKg/LfWjSGWf7+aqtt 2oMM9Xq8PLJ380pcZmr2EQlA/Tx1gOAaJlm8JFpuANow/vcoL9Uv8MIMpxDltMW2ncOpL+fD6 fTLDpZGLSRu4A0MWoEdIFFFni9G82KfosG7gkq00l/emsa9GmoFzoAmq+H9B0pnUZfQOEN/6w aRucxNs7MpPZw4yQOqGU0NqLzvJfiNX8jg3/OnSi0NX/CsiS+do9ovuu5a1vtQbTgvWUERBv4 u83uQnSqNmEx9+SHGkAyU6rNwgtl9fHYbWYR3kJiqGPf3pGp4dJkRfA0vVVJNb7uY9lKV45vf dL5YgBdsjbwl7dDZz7FrpSpRz2Pe/l0ufwY3L9hoaMKP30Rgsg148nEZZ0KXq/22AjRk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129163 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Okm9eQ9Eo94jb5XbthjHF5igpqgF3E8JV Content-Type: multipart/mixed; boundary="ctCMwkF30xll0jqNfl4VK4PbOkb9rfrsw"; protected-headers="v1" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: bug-gnu-emacs@gnu.org Message-ID: Subject: Font-locking issues when font-lock-fontified is nil (Was: What to do when font-lock-flush + font-lock-ensure do less than font-lock-fontify-buffer? on emacs-devel) --ctCMwkF30xll0jqNfl4VK4PbOkb9rfrsw Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Debbugs-CC: monnier@iro.umontreal.ca Hi bug-gnu-emacs, Sorry for the long delay in opening this. This is a follow-up to the Ema= cs-devel thread "What to do when font-lock-flush + font-lock-ensure do le= ss than font-lock-fontify-buffer?", where Stefan asked me to open a bug r= eport. My original question was this: > IIUC the proper way in Emacs 25 to signal changes that require a > refontification to font-lock is to call font-lock-flush. This doesn't a= lways > do as much as font-lock-fontify-buffer does, though. In particular, wh= en the > font-lock-fontified variable is nil (which does happen, though I don't = know > why; I don't know what this variable is for), then calling font-lock-fo= ntify > buffer does refontify the whole buffer, but font-lock-flush and > font-lock-ensure don't seem to do anything. What's the proper way to m= ark a > buffer for refontification (and refontify the visible portion) immediat= ely in > 25? And here's is my original test case: (with-current-buffer (get-buffer-create "temp") (erase-buffer) (setq-default prettify-symbols-unprettify-at-point 'right-edge) (emacs-lisp-mode) (prettify-symbols-mode) (insert "lambda\n\nlambda") (pop-to-buffer (current-buffer))) Moving around in this buffer unprettifies and reprettifies =E2=80=98l= ambda=E2=80=99s into =E2=80=98=CE=BB=E2=80=99s as the point moves in and = out of them. Setting =E2=80=98font-lock-fontified=E2=80=99 to nil breaks = that mechanism (the =E2=80=98=CE=BB=E2=80=99s are unprettified but no rep= rettified), and no series of =E2=80=98font-lock-flush=E2=80=99 and =E2=80= =98font-lock-ensure=E2=80=99 will reprettify them. Eli remarked the following: > However, please explain why font-lock-ensure-function calls > font-lock-DEFAULT-fontify-buffer. If it's supposed to be good for any = mode, why > does it call the default fontification? > > As a matter of fact, if I replace the font-lock-default-fontify-buffer > call with a call to font-lock-fontify-buffer, the problem described by > the OP goes away. That is why I said what I said. And Stefan answered: > I haven't seen the beginning of the thread, but if that fixes the > problem, then I think it's a good change. > > To go back to the previous question. I guess I used > font-lock-default-fontify-buffer because the whole point is to get rid > of all the misuses of font-lock-fontify-buffer, but I think in this cas= e > it's indeed the right thing to do. Then Stefan said: > > Should I open a bug report about this? > Yes. And put me in X-Debbugs-Cc. Done :) Thanks, Cl=C3=A9ment. --ctCMwkF30xll0jqNfl4VK4PbOkb9rfrsw-- --Okm9eQ9Eo94jb5XbthjHF5igpqgF3E8JV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYnN2NAAoJEPqg+cTm90wjiKkP/i5BtES8GqK+H5EaTpcHi+FT 8/7bZkqzhguSDKiF4/cukmMKTg6XUA1AiAcJ+4BEoc50MQNw0BJxRrYXm95KO3kx kJr5SfPT7LbXMLCYU6LSWhuimFtMUwwJvteAFogXqq129MwI4HTKWT7or4M8RVi4 bm8HOYC7R4hqwn1ZnA7irOhc+mzPRD3CWymfbyh6UiIy09NtUM6jFznV4M0Y2TWF xu5+kK9+3b5rIi5Zao7gSmlyaT0x/yxFFMB/A30E4H3id3O2Jvg8cXFD6lxwn7DG vWNdg33hYHjOwRwvSEePzpe3jJfom7UOrOkB3rspvNP5K87P7UpghIPNJnz+Pghk 2icN3JPlYV40GySIuuNYzd10QLlR78PXw/5LD5CKlSHevD/KqmR1HMztC+sWXk1Z hC6YK1lZJFM9Y0kZxBTNqhBaDSB6gDtO7c0LFybYygwwN5zCPY7wzEbSyIYthylz kW49zaom2rjPWN04mOXdBcoeh76NSpv8JFAPw1lvWPnjd9TeLbjgBxYL+5tL/fWo lSDC+nCmeCHfxh0oWlTfggXJSWbe2/Acqhjp7fxDzgqCJAWWORyC5kieI8ce4nOq f74dIG0y/FhUJeCDNdvS+mZGh3h6K7Rxd8dTEXEeLZVdOnvRBpR6RYrEtULFqmVB 8OgxrQ2wl3uSInYVMf8R =DkUe -----END PGP SIGNATURE----- --Okm9eQ9Eo94jb5XbthjHF5igpqgF3E8JV--