all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: "Clément Pit-Claudel" <cpitclaudel@gmail.com>, 34764@debbugs.gnu.org
Subject: bug#34764: prettify-symbols-mode pollutes font-lock-extra-keywords
Date: Tue, 5 Mar 2019 15:54:26 -0800 (PST)	[thread overview]
Message-ID: <733dfaa9-55c2-4eb6-be1f-e1e880285546@default> (raw)
In-Reply-To: <42355266-99e2-403a-8dd2-8a5320659d1b@gmail.com>

> I'm a bit puzzled by the implementation:
> 
> (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.





  reply	other threads:[~2019-03-05 23:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-05 22:15 bug#34764: prettify-symbols-mode pollutes font-lock-extra-keywords Clément Pit-Claudel
2019-03-05 23:54 ` Drew Adams [this message]
2019-03-06  3:50   ` Clément Pit-Claudel
2019-03-06  6:23     ` Drew Adams
2019-03-06  6:50       ` Clément Pit-Claudel
2019-03-06 15:37         ` Drew Adams
2019-10-30 19:30         ` Lars Ingebrigtsen
2019-10-30 20:57           ` Clément Pit-Claudel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=733dfaa9-55c2-4eb6-be1f-e1e880285546@default \
    --to=drew.adams@oracle.com \
    --cc=34764@debbugs.gnu.org \
    --cc=cpitclaudel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.