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: Wed, 6 Mar 2019 07:37:54 -0800 (PST) Message-ID: <675352ab-203d-45eb-afe4-0a09021c967f@default> References: <42355266-99e2-403a-8dd2-8a5320659d1b@gmail.com> <733dfaa9-55c2-4eb6-be1f-e1e880285546@default> <69cbd68d-71c8-4f03-a6e1-d6f0bec26900@default> <4ef305f9-6501-c360-b635-63d5574abd55@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="131562"; 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 16:39:28 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 1h1Ydk-000Y9L-7w for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Mar 2019 16:39:28 +0100 Original-Received: from localhost ([127.0.0.1]:35097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1Ydj-00083d-9g for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Mar 2019 10:39:27 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1YdU-0007xU-IC for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 10:39:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1YdQ-0006O7-7w for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 10:39:09 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49275) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1YdK-0006Km-HJ for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 10:39:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h1YdK-0001kI-8H for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 10:39: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: Wed, 06 Mar 2019 15:39: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.15518866906652 (code B ref 34764); Wed, 06 Mar 2019 15:39:02 +0000 Original-Received: (at 34764) by debbugs.gnu.org; 6 Mar 2019 15:38:10 +0000 Original-Received: from localhost ([127.0.0.1]:34586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1YcU-0001jE-DS for submit@debbugs.gnu.org; Wed, 06 Mar 2019 10:38:10 -0500 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:38376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1YcS-0001ix-4B for 34764@debbugs.gnu.org; Wed, 06 Mar 2019 10:38:08 -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 x26FXs45081265; Wed, 6 Mar 2019 15:38:02 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=0Ua8A5UP+AJdETudetvKzwNun3o5ld4TNNAASRFQn5s=; b=yETMyaa9ASFs36lvFnq10gHSsWr6u0DEWZZOWwlYSnRjyx8no3A/MowUM3XNGkt5K8Y+ v8fsl1C9lGfcsuzSYxnfRWtMbKRX9igar+lbQF085JNs6QYXigwwPz6CMWby4AwhSDmk D7twBGlQgDPkPkTI4ZwNQMoixs8V8uzwwvmbPp2UynDp8SCmNNefl7cumzeMb8LiYEWA Fx50AwlMk2H5Cj72h7lxBXBQXSlYMQ0dOAD2h35IysekUniluNV3Ux+DpjddfBWtToIY a8xbdYFYhObtPitIEeFXoe/Vh3Ft21lGQK95m2qObVEht9iTidORyoS++HZjkmif4fqn 7g== Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2qyfbecr9h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 06 Mar 2019 15:38:01 +0000 Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x26FbtlB008063 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 6 Mar 2019 15:37:56 GMT Original-Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x26FbtLO016618; Wed, 6 Mar 2019 15:37:55 GMT In-Reply-To: <4ef305f9-6501-c360-b635-63d5574abd55@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=9187 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=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903060108 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:156097 Archived-At: > > No, in fact I wasn't aware of `char-property-alias-alist'. ;-) > > > > I just meant in some way to try to have a library-specific > > property control or replace a general property. I don't > > have in mind a general mechanism for doing that. >=20 > Font font-lock-extra-managed-props, at least, char-property-alias-alist > seems perfect: you can declare my-abc to be an alias of abc, add my-abc > to char-property-alias-alist when the minor mode gets activated, remove > it when it gets deactivated, and as a bonus when clearing fontification > font-lock will only clear the instances of abc that it applied itself. > Very neat. Yes, font-lock is a special case, because it already deals in such a general way with a _list_ of properties, "managing" them similarly. Beyond that, one's code needs, one way or another, to ensure that a library-specific property can have the effect of the general, global one. That's not built-in, AFAIK. _________ There is another case, which I forgot to mention, where there is something general and built-in, but not only for properties. That's `buffer-invisibility-spec'. By that I mean that you can add your own entries to that spec, and you can remove them. Other entries are not affected. (There are even specific functions to add and remove.) Something similar happens with hooks. These are all places/constructs designed to be modified by more than one library for more than one purpose. They are all, in a general sense, "hooks". Another example, in the realm of properties, is the exceptional way we treat property `face': code generally handles both the case where the property value is a single symbol (e.g. `lazy-highlight') and the case where the value is a list of such. Again: easy to add and remove, without affecting what might be there from other code. A property whose value is expected/allowed to be a list of values, each of which can determine the behavior, is more flexible. Whether this could or should be generalized, I don't know. But it sure is easier to keep the effects of some code (e.g. a mode) separate in the cases where we've planned ahead for a list of behavior-modifying entries rather than just a single such.