unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: emacs-devel@gnu.org
Subject: Re: questions about correct reveal-mode usage to hide passwords
Date: Thu, 11 Jun 2020 18:31:36 +0000	[thread overview]
Message-ID: <zh99a1yv.fsf@lifelogs.com> (raw)
In-Reply-To: jwvy2ota403.fsf-monnier+emacs@gnu.org

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	other threads:[~2020-06-11 18:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 14:09 questions about correct reveal-mode usage to hide passwords Ted Zlatanov
2020-06-11 14:21 ` Clément Pit-Claudel
2020-06-11 17:33   ` Stefan Monnier
2020-06-11 17:43     ` Clément Pit-Claudel
2020-06-11 17:49       ` Stefan Monnier
2020-06-11 18:31         ` Ted Zlatanov [this message]
2020-06-11 19:51           ` Stefan Monnier
2020-06-12 16:17             ` Ted Zlatanov
2020-06-12 16:35               ` Clément Pit-Claudel
2020-06-12 17:08                 ` Ted Zlatanov
2020-06-16 18:09               ` Ted Zlatanov
2020-06-18 18:38                 ` Ted Zlatanov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=zh99a1yv.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).