emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: questions about correct reveal-mode usage to hide passwords


From: Ted Zlatanov
Subject: Re: questions about correct reveal-mode usage to hide passwords
Date: Thu, 11 Jun 2020 18:31:36 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

On Thu, 11 Jun 2020 13:49:00 -0400 Stefan Monnier <monnier@iro.umontreal.ca> 
wrote: 

>>> I'd recommend using jit-lock rather than font-lock.
>>> It might be a case of bikeshedding, but I think it will be both easier
>>> to implement and more robust.
>> 
>> Hmm.  I meant font-lock-keywords and text properties (which will benefit
>> from jit-lock, of course), rather than hooking up directly into jit-lock and
>> using overlays.  Is there something wrong with the text-properties approach?

SM> It's just that using `font-lock-keywords` is fiddly, and then you also
SM> have to set `font-lock-extra-managed-props`, ...
SM> And next thing you know a user wants to use your thing but doesn't want
SM> font-lock coloring, ...

jit-lock seems to require lots of extra work compared to adapting
prettify-symbols-mode and asking the user to add extra settings.
jit-lock is not tied to regexp lookups, which is OK with me (a scanning
function is better for my specific need, since secrets are often
contextual).

The cleanest example I saw was glasses.el but that mode doesn't reveal
the transformed text when you're inside the text.

Is there an example using jit-lock that behaves like
prettify-symbols-mode in the following cases?

* transforms the text when outside it
* temporarily shows the original text when inside it or on its right edge
* updates when the user makes changes

Thank you again
Ted




reply via email to

[Prev in Thread] Current Thread [Next in Thread]