[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: password.el: A minor mode to hide sensitive information (passwords)
Re: password.el: A minor mode to hide sensitive information (passwords) using overlays.
Wed, 21 Nov 2012 16:59:27 +0100
2012/11/21 Michael Albinus <address@hidden>:
> Jürgen Hötzel <address@hidden> writes:
>> Hi Michael,
> Hi Jürgen,
>> I introduced a new custom variable password-mode-password-prefix-regexs:
>> So you can change this.
> That looks much better now. Maybe you could polish a little bit the
> default. I would make the colon optional, then .netrc or .authinfo files
> are supported out of the box. And maybe you shall allow any space class
> characters after the prefix. My proposal for a default value would be
> '("Password:?[[:space:]]+" "Passwort:?[[:space:]]+")
Thanks. That makes sense: Done.
> You might also mention in the docstring of that custom option, that the
> regexps must not contain parentheses for grouping, otherwise your match
> wouldn't work. Shy groups are OK.
Thanks. Also done.
> Another minor annoyance is, that your code is activated only in case of
> *inserting* a character. I have no simple solution at hand, because
> there isn't a hook when deleting a character. Maybe you could remap keys
> <delete-char> and <backspace> for the password string region, but I
> don't know whether this covers all use cases.
> Delete/undo is also problematic, because you don't know first hand which
> password to enter as confirmation.
> An alternative approach could be to mark the region which contains the
> password with the `read-only' property and catch the `text-read-only'
> error, which is raised when somebody tries to modify this region. In the
> error handler, you could call your password change mechanery.
Yes, there is no easy solution. I implemented it using the overlay insert hook,
because i can easily distinguish my overlays from other overlays and
to fiddle with user key bindings which may be already customized.
I did not knew about the 'read-only' option: Thanks. I will check it out!