From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Hiding passords in authinfo Date: Sun, 14 Oct 2018 16:55:14 -0400 Message-ID: References: <87bmelj0p4.fsf@mouse.gnus.org> <83sh18twoe.fsf@gnu.org> <87bmelj0p4.fsf@mouse.gnus.org> <87vacthkpc.fsf@mouse.gnus.org> <1sctj9q1.fsf@lifelogs.com> <3ea6abeb-49c6-81b1-5cf2-ec9abf14fcf6@gmail.com> <866fec51-cd9b-7bbf-9e31-b71bf9786efc@gmail.com> <1s91z1rs.fsf@lifelogs.com> <83sh18twoe.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1539550441 17292 195.159.176.226 (14 Oct 2018 20:54:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 14 Oct 2018 20:54:01 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 14 22:53:57 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBnOd-0004PE-Hv for ged-emacs-devel@m.gmane.org; Sun, 14 Oct 2018 22:53:56 +0200 Original-Received: from localhost ([::1]:49492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBnQj-0001Xn-MQ for ged-emacs-devel@m.gmane.org; Sun, 14 Oct 2018 16:56:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34675) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBnQ3-0001Xg-Nf for emacs-devel@gnu.org; Sun, 14 Oct 2018 16:55:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBnPz-0002R2-QH for emacs-devel@gnu.org; Sun, 14 Oct 2018 16:55:23 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:45471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBnPw-0002NH-D2; Sun, 14 Oct 2018 16:55:17 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w9EKtEEl027827; Sun, 14 Oct 2018 16:55:15 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 61E0C69B41; Sun, 14 Oct 2018 16:55:14 -0400 (EDT) In-Reply-To: (Ted Zlatanov's message of "Sun, 14 Oct 2018 19:31:23 +0000") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6394=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6394> : inlines <6930> : streams <1801318> : uri <2730368> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230391 Archived-At: > Right. I tried to find a standard way to do the hiding part, especially > one that would work with `reveal-mode`, and failed. Would doing it with > `jit-lock-register` work with `reveal-mode` automatically? reveal-mode doesn't care which mechanism you use to add the `invisible` property, so doing it with jit-lock-register will neither help nor hinder the use of reveal-mode. The current constraint of reveal-mode is that it only works for text hidden using the `invisible' property, and only if that property is applied via an overlay. It might very well be too restrictive for your use case (e.g. you might prefer to hide the passwords by replacing them with ******* or something like that, which requires the use of a `display` rather than `invisible` property, and you might also prefer to use a text-property rather than an overlay), but my suggestion was to extend reveal-mode to be able to handle such cases. You can see in reveal-open-new-overlays what tests are applied before "opening" an overlay: (and inv ;; There's an `invisible' property. Make sure it's ;; actually invisible, and ellipsized. (and (consp buffer-invisibility-spec) (cdr (assq inv buffer-invisibility-spec))) (or (setq open (or (overlay-get ol 'reveal-toggle-invisible) (and (symbolp inv) (get inv 'reveal-toggle-invisible)) (overlay-get ol 'isearch-open-invisible-temporary))) (overlay-get ol 'isearch-open-invisible) (and (consp buffer-invisibility-spec) (cdr (assq inv buffer-invisibility-spec)))) (overlay-put ol 'reveal-invisible inv)) It could test for the presence of the `display` property (and maybe check for the presence of a reveal-specific property like reveal-toggle-invisible above, so that it doesn't reveal any and all `display` properties but only those that were designed to be revealed). Stefan