[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#28785: 27.0.50; Wishlist: There should be a mode for .netrc and .aut
From: |
Lars Ingebrigtsen |
Subject: |
bug#28785: 27.0.50; Wishlist: There should be a mode for .netrc and .authinfo |
Date: |
Sat, 21 Sep 2019 11:10:22 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Does anybody remember whether this really was the conclusion, or whether
> there's another framework for hiding stuff that should be used?
Found it. Ted asked and Stefan M answered.
So the solution is to extend reveal-mode with a `display' thing and then
use that.
> > 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
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no