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

From: martin rudalics <[email-masked]>
Date: Sat, 12 Oct 2024 15:56:11 +0200

Hi Michael

 > Could you please provide a short recipe I could play with?

No, otherwise I would have attached it to my initial post.  It happens
when I run ssh-add in a shell buffer.  But it's not 100% reproducible
and for most of my buffers (car mode-line-format) is invariably "%e".
But I use a separate minibuffer frame so

(window-in-direction 'above (minibuffer-window))

should reliably return nil and (minibuffer-selected-window) would be
used.  'eldoc-mode' is nil so I doubt that it could interfere with its
own ideas about modifying the mode line when I'm in the minibuffer and
possibly prepend the second eye icon I occasionally see.

I'll try to play around with this myself so I can tell you more on what
goes on.

 >> In either case, it would be nice to make showing the eye icon
 >> customizable by the user.  I found no way to do that.
 >
 > I'll see what's possible. FTR, non-graphical alternatives are already
 > defined in read-passwd--show-password-icon and
 > read-passwd--hide-password-icon.
 >
 > Could you pls give an example what you would like as replacement?

Why can't you make that a full-fledged option 'read-passwd-show-icon'
and initialize it to 'graphics-only'?  And why can't you make the icon
part of the prompt with some clickable text or overlay property?  Think
of users who turn mode lines off in some buffers at least.

Thanks, martin