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

From: martin rudalics <[email-masked]>
Date: Thu, 17 Oct 2024 20:10:19 +0200

> I gave it another try. The appended patch dosn't add the password icon
 > to mode-line-format, but to global-mode-string. By this, we don't bother
 > to find the corresponding window to a given minibuffer.

I think this is the best idea I've seen so far here.  Users can switch
frames and windows in some arbitrary manner and the eye is always there.
As long as you are satisfied with seeing the eye at the end of the mode
line which for narrow windows can be hidden.  Have you considered using
'mode-line-front-space' instead?

 > This doesn't solve the problem of cascaded password input, but that's
 > another game.

I would append another eye just as the current code does and remove one
when the password has been read.  And whenever a password has been read
make sure to hide passwords.  Ideally, we could also give at most one of
the eyes (the left- or rightmost one) the visible status.  And to make
everything foolproof we could make sure all eyes are removed as soon as
'minibuffer-depth' drops to zero.

martin