From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#34764: prettify-symbols-mode pollutes font-lock-extra-keywords Date: Tue, 5 Mar 2019 15:54:26 -0800 (PST) Message-ID: <733dfaa9-55c2-4eb6-be1f-e1e880285546@default> References: <42355266-99e2-403a-8dd2-8a5320659d1b@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="50381"; mail-complaints-to="usenet@blaine.gmane.org" To: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel , 34764@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 06 00:55:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1Ju1-000D1B-P1 for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Mar 2019 00:55:17 +0100 Original-Received: from localhost ([127.0.0.1]:51202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1Ju0-0006B8-Ha for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Mar 2019 18:55:16 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1Jtn-00068s-T1 for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2019 18:55:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1Jtm-00012G-Su for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2019 18:55:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48297) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1Jtm-000126-Nf for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2019 18:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h1Jtm-0006CZ-Gn for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2019 18:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Mar 2019 23:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34764 X-GNU-PR-Package: emacs Original-Received: via spool by 34764-submit@debbugs.gnu.org id=B34764.155183007723797 (code B ref 34764); Tue, 05 Mar 2019 23:55:02 +0000 Original-Received: (at 34764) by debbugs.gnu.org; 5 Mar 2019 23:54:37 +0000 Original-Received: from localhost ([127.0.0.1]:33608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1JtM-0006Bl-Se for submit@debbugs.gnu.org; Tue, 05 Mar 2019 18:54:37 -0500 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:41736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1JtK-0006BW-Bp for 34764@debbugs.gnu.org; Tue, 05 Mar 2019 18:54:35 -0500 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x25NsSiI129369; Tue, 5 Mar 2019 23:54:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=c+OYY0EYI6Tmvs+Y9ERR7Ny8AlB55Tswx7zRMcEdPaQ=; b=xOd7vp2QP5/lWEutoZfXhNdvWFpo/Q5d23O7WDiqLjcBx8rwdvx5AVltWXZXxepvioYe j82klNXJ9uPvz11Utxn8SEOo6S0CMbORLVYFwtOU+zWSwmkiIzY4i3NAQpCIPF384Uyx i64yEhp2bVh+gCkEZ7n/PGKy/mFV0M7oPR/YpR45LcRkHT2hrPmuair7T95BPqNFLjFO 5SWWMh60NO5UnsUAO044YfjtqCcVk0jIwzGKivf7eJxcTJ06b3+2vGTg9qzHdO4vH998 jEoUeFm3qYGHjOVbbOupiDKAhjrwdelIVc5R0BLhX3jwW55IVMbnnNDmu9bLKgGNDpZt Qw== Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2qyfbe8yra-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Mar 2019 23:54:28 +0000 Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x25NsRuV000397 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 5 Mar 2019 23:54:27 GMT Original-Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x25NsRWB020720; Tue, 5 Mar 2019 23:54:27 GMT In-Reply-To: <42355266-99e2-403a-8dd2-8a5320659d1b@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4810.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9186 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=925 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903050154 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: 209.51.188.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:156080 Archived-At: > I'm a bit puzzled by the implementation: >=20 > (remove-hook 'post-command-hook > #'prettify-symbols--post-command-hook t) > (when prettify-symbols--keywords > (font-lock-remove-keywords nil prettify-symbols--keywords) > (setq prettify-symbols--keywords nil)) > (when (memq 'composition font-lock-extra-managed-props) > (setq font-lock-extra-managed-props > (delq 'composition font-lock-extra-managed-props)) > (with-silent-modifications > (remove-text-properties (point-min) (point-max) > '(composition nil)))))) I'm ignorant wrt prettify-symbols stuff. But to me it smells like a bug for some optional code (e.g. a mode) to change a general setting such as `composition' for `font-lock-extra-managed-props' etc. when it's done. Should prettify-* assume it's the only code that cares about property `composition'? Or that it was the one that added/set it in the first place? Typically, I use a library-specific property instead (e.g. `my-composition') and do whatever is needed to give that property an effect like the general (global) property, without interfering with that general property. Maybe that's not appropriate for prettify-*. Dunno. Or I keep track of the initial state before adding `composition', and then reset that property only if it wasn't used to begin with (i.e., restore its value). But that's not foolproof either, since some other code can affect things after prettify-* is turned on, so restoring to the state before it was turned on isn't necessarily TRT. Maybe such a save/restore approach is not easy/possible for prettify-*. Dunno.