From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Newsgroups: gmane.emacs.bugs Subject: bug#34764: prettify-symbols-mode pollutes font-lock-extra-keywords Date: Tue, 5 Mar 2019 22:50:28 -0500 Message-ID: References: <42355266-99e2-403a-8dd2-8a5320659d1b@gmail.com> <733dfaa9-55c2-4eb6-be1f-e1e880285546@default> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="162430"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 To: Drew Adams , 34764@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 06 04:51:16 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 1h1NaL-000g8G-DA for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Mar 2019 04:51:13 +0100 Original-Received: from localhost ([127.0.0.1]:53785 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1NaK-00078m-99 for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Mar 2019 22:51:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1NaB-00078h-Cg for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2019 22:51:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1NaA-0002pv-HR for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2019 22:51:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48347) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1NaA-0002pj-CR for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2019 22:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h1NaA-0003KP-23 for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2019 22:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Mar 2019 03:51: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.155184423912747 (code B ref 34764); Wed, 06 Mar 2019 03:51:02 +0000 Original-Received: (at 34764) by debbugs.gnu.org; 6 Mar 2019 03:50:39 +0000 Original-Received: from localhost ([127.0.0.1]:33658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1NZm-0003JX-Ot for submit@debbugs.gnu.org; Tue, 05 Mar 2019 22:50:39 -0500 Original-Received: from mail-qt1-f172.google.com ([209.85.160.172]:45277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1NZk-0003Iy-5z for 34764@debbugs.gnu.org; Tue, 05 Mar 2019 22:50:37 -0500 Original-Received: by mail-qt1-f172.google.com with SMTP id d18so11388828qtg.12 for <34764@debbugs.gnu.org>; Tue, 05 Mar 2019 19:50:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=6Ut6iVGkDeeGz8ghw9wVK3OksxhskDiCjLUbAnB5zAY=; b=qU+PG/ntSDiFMPoezFRFwjnZOOV2KDmv3RKzgAYudVIwwuRyOkgZYzS5rU/plnWbFM YX8gss4HdQwmx4tTRFvLKpcEEufGb44C9h2WyR7Po3536MleYSlpcjp8qpSwBvnxUzHJ jrgUemMdN6+O0JyyMaGonbzFkRtbPO96VEtn7LH8x5sqfjnEnhhVV7HDjLukBEJkbvhF Qfl9lSZ70/+Eo/MjzRu/NSUQ4pJEMVozEhX2EkzKebYzaE/CBAM0uIvn4o557zQVEIyO vbOlKWJrBoX+lWNsU6+S7l26GXN/uM13TjyYxMMWb2Gl+WAWBdZI39YAer+fv0fnf75Y bd5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=6Ut6iVGkDeeGz8ghw9wVK3OksxhskDiCjLUbAnB5zAY=; b=F3/hbhMhcNRxE8XvZhasEq9FRQpmf53TInWHO9M/WkfQ+NFzTK/bU/5RiI6rFLhoCw t5sTZo6dN/6LMnP95EciaLAyB2QvicRSEWhv9FyO835jrycrb6vAcfWXIKvuFEW+5Tp0 7gaZftqMRANbtNoP4MmtvVp78xo+Arh/X7ToQqx8mSgzyAeTwm5ZiBqqZpXs6VbZcjmR h914Ty0gq3H7kF4v1nY7xVXml8n+yq9vkDeLmUo6aZ0ge/dFKWmN4h8lUqKUuE4AJU7E EUZRU+BFwKOyHW6Qt3wgYeLC446J9blUESmHVjDBK2xVjMpxj+yUBB1S0rOHLSW76FqE fegQ== X-Gm-Message-State: APjAAAXPXUz7sd7CEVR3jAo0GcyG5AG4woI69S1RDfzqwztqHxeehtPC sizqzJXMGSW/Tpc+BofRqCcMp3Iq X-Google-Smtp-Source: APXvYqyOOp4yUwqjERWAz3tBcSrG7fotDwZ7o7JOAVqeMbZgCYQSeugZPiIXrzOtWkViqizjcHfD6g== X-Received: by 2002:ac8:19e3:: with SMTP id s32mr3943276qtk.287.1551844230384; Tue, 05 Mar 2019 19:50:30 -0800 (PST) Original-Received: from ?IPv6:2601:184:4180:66e7:68f1:6275:fdcf:c833? ([2601:184:4180:66e7:68f1:6275:fdcf:c833]) by smtp.googlemail.com with ESMTPSA id i33sm309472qti.74.2019.03.05.19.50.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2019 19:50:29 -0800 (PST) In-Reply-To: <733dfaa9-55c2-4eb6-be1f-e1e880285546@default> Content-Language: en-GB 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:156084 Archived-At: Hi Drew, On 05/03/2019 18.54, Drew Adams wrote: > 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. Thanks for pointing this out. I agree that it's an issue, though fairly orthogonal to the specific issue I created the bug for (the two properties I would like to see removed from fl-extra-managed-props are both adequately prefixed with `prettify-symbol-'). > 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? Indeed, this general problem has dogged me in a number of plugins I wrote, too. > 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. I never thought about this solution. This is great actually! I'm aware of char-property-alias-alist, but I never quite realized that it provided an elegant solution to the problem of restoring font-lock-extra-managed-props when disabling a minor mode (the only user in the emacs source tree seems to befont-lock). Is that the mechanism you had in mind? > 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. Right, I think that approach is doomed, because modes are not enable and disabled in a well-parenthesized manner (you can enable A, enable B, disable A, and disable B) Thanks for the cool idea about char-property-alias-alist! Clément.