Subject: bug#73768: 'read-passwd-mode' can clobber user defined mode lines

From: Michael Albinus <[email-masked]>
Date: Fri, 18 Oct 2024 11:23:52 +0200

martin rudalics <[email-masked]> writes:

>> I haven't seen any application in the wild which offers cascaded
>> password input. What would be the use case for this? My feeling is, that
>> this is a misuse. We might not forbid it, but we might show a warning.
>
> Then why does 'read-passwd' deliberately offer it via
>
>             (let ((enable-recursive-minibuffers t)
>
> If it's a misuse, it should rather bind it to nil.

This is not offered for cascaded password input. It is enabled for
recursive use of the minibuffer for any purpose. For example, while
typing the password, you need to check somehing else via 'M-:'. This is
possible now.

> Another mystery: After
>
> commit de88ed8646383301f20f8340e13d43e5918310fa
> Author: Lars Ingebrigtsen <[email-masked]>
> Date:   Sun Oct 13 05:15:18 2019 +0200
>
>     Hide passwords more in `read-password'
>
>     * lisp/subr.el (read-password--hide-password): Factor out (bug#17127).
>     (read-passwd): Use it in post-command-hook instead of
>     after-change-functions to ensure that we hide the password no
>     matter what inserts text.
>
> entering 'read-passwd' does
>
>             (add-hook 'post-command-hook #'read-passwd--hide-password nil t))
>
> while exiting still does
>
>               ;; Not sure why but it seems that there might be cases where the
>               ;; minibuffer is not always properly reset later on, so undo
>               ;; whatever we've done here (bug#11392).
>               (remove-hook 'after-change-functions
>                            #'read-passwd--hide-password 'local)
>
> If that fix of Bug#11392 (or Bug#11397) were really needed, then we
> should remove read-password--hide-password from 'post-command-hook' now.
> But there were no bug reports in the last four years so probably that
> bug was fixed by other means.  In either case the current 'remove-hook'
> is a noop now.

Hmm, yes. While adding read-passwd-mode, I didn't check all settings in
read-passwd. Likely these settings are superfluous now. I will check in
master once the other patch has arrived it.

> martin

Best regards, Michael.