GNU bug report logs - #12117
read-passwd deletes prompt

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Thu, 2 Aug 2012 08:25:01 UTC

Severity: minor

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 12117 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 12117 <at> debbugs.gnu.org
Subject: Re: bug#12117: read-passwd deletes prompt
Date: Tue, 07 Aug 2012 03:04:17 +0300
> 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)




This bug report was last modified 12 years and 285 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.