bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12117: read-passwd deletes prompt


From: Juri Linkov
Subject: bug#12117: read-passwd deletes prompt
Date: Tue, 07 Aug 2012 03:04:17 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (x86_64-pc-linux-gnu)

> Hmm... I guess the problem is even more general: any minibuffer input
> during insert-file-contents will suffer from it (granted, there usually
> isn't much minibuffer input during such calls, luckily).
>
> Maybe read-from-minibuffer should let-bind inhibit-read-only to nil?
> That sounds ugly, tho.

Since there is not much minibuffer input during insert-file-contents
(one is known at the moment) then perhaps it would be safer to fix
just these places specific to insert-file-contents:

=== modified file 'lisp/epa.el'
--- lisp/epa.el 2012-06-08 16:39:49 +0000
+++ lisp/epa.el 2012-08-07 00:01:14 +0000
@@ -589,6 +589,10 @@ (defun epa-display-verify-result (verify
 (make-obsolete 'epa-display-verify-result 'epa-display-info "23.1")
 
 (defun epa-passphrase-callback-function (context key-id handback)
+  ;; Bind `inhibit-read-only' to nil because `find-file-noselect-1' binds
+  ;; it to t (for `insert-file-contents') that allows the user to delete
+  ;; characters in the read-only minibuffer prompt in `read-passwd'.
+  (let ((inhibit-read-only nil))
   (if (eq key-id 'SYM)
       (read-passwd
        (format "Passphrase for symmetric encryption%s: "
@@ -603,7 +607,7 @@ (defun epa-passphrase-callback-function
        (let ((entry (assoc key-id epg-user-id-alist)))
         (if entry
             (format "Passphrase for %s %s: " key-id (cdr entry))
-          (format "Passphrase for %s: " key-id)))))))
+            (format "Passphrase for %s: " key-id))))))))
 
 (defun epa-progress-callback-function (_context what _char current total
                                               handback)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]