From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: questions about correct reveal-mode usage to hide passwords Date: Thu, 11 Jun 2020 18:31:36 +0000 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: References: <4973bec9-0abf-8f55-0b60-0879b6fe1fa7@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="21015"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:ab1hqCnGvhVuK2u63T2ZoUX0AFs= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 11 20:32:26 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jjS02-0005N0-4y for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Jun 2020 20:32:26 +0200 Original-Received: from localhost ([::1]:47170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjS01-0007fw-6s for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Jun 2020 14:32:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjRzQ-0006hR-AO for emacs-devel@gnu.org; Thu, 11 Jun 2020 14:31:48 -0400 Original-Received: from ciao.gmane.io ([159.69.161.202]:58792) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjRzO-0001BI-Pa for emacs-devel@gnu.org; Thu, 11 Jun 2020 14:31:47 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jjRzK-0004QF-Vs for emacs-devel@gnu.org; Thu, 11 Jun 2020 20:31:42 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never Received-SPF: pass client-ip=159.69.161.202; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/11 13:58:43 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252126 Archived-At: On Thu, 11 Jun 2020 13:49:00 -0400 Stefan Monnier 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