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

From: martin rudalics <[email-masked]>
Date: Sun, 13 Oct 2024 17:09:30 +0200

Hi Michael

 > I tried to reproduce your recipe, but I couldn't. Likely, I have a too
 > simple minded use of different Emacs windows. And a not customized mode
 > line. Note, that I'm not familiar with the windows machinery in Emacs at
 > all.

No customized mode line is needed.  Either with emacs -Q evaluate

(progn
   (set-window-parameter nil 'no-other-window t)
   (with-selected-window (split-window nil -5)
     (set-window-buffer nil (get-buffer-create "*text*"))
     (set-window-parameter nil 'no-other-window t)
     (read-passwd "PWD:")))

or with

emacs -Q --eval "(setq default-frame-alist '((minibuffer . nil)))

evaluate via M-:

(with-selected-window (get-buffer-window "*scratch*" t)
   (with-selected-window (split-window nil -5)
     (set-window-buffer nil (get-buffer-create "*text*"))
     (read-passwd "PWD:")))

In either case it's important that (1) there is no suitable window
"above" and (2) 'minibuffer-selected-window' doesn't return the largest
window on its frame.

martin