Subject: Re: bug#12597: 24.2.50; Cannot exit read-passwd by C-j/C-m/<return>

From: Stefan Monnier <[email-masked]>
Date: Sun, 07 Oct 2012 15:34:55 -0400

> Type M-: (read-passwd "> ") RET
> then you cannot finish the prompt by C-j nor C-m nor <return>.
> The only when I found is C-M-c (exit-recursive-edit).  This
> effects for example when typing password to send email using smtpmail.
> This is strange because minibuffer-local-map (parent of read-passwd-map)
> defines exit-minibuffer.

Thanks for the heads up.  Indeed, it got me stumped for a while until
I realized that defconst behaves funny during the dump (it purecopy's
its argument, so we get a snapshot of minibuffer-local-map, taken
before minibuffer-local-map has been populated).
I installed the patch below which seems to fix the problem,

        Stefan

--- lisp/subr.el	2012-10-06 17:29:15 +0000
+++ lisp/subr.el	2012-10-07 19:31:03 +0000
@@ -2143,7 +2143,9 @@
       (setq first nil))
     code))
 
-(defconst read-passwd-map
+(defvar read-passwd-map
+  ;; BEWARE: `defconst' would purecopy it, breaking the sharing with
+  ;; minibuffer-local-map along the way!
   (let ((map (make-sparse-keymap)))
     (set-keymap-parent map minibuffer-local-map)
     (define-key map "\C-u" #'delete-minibuffer-contents) ;bug#12570