aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-10-05 19:47:26 -0700
committerGlenn Morris2012-10-05 19:47:26 -0700
commitd5acb99a199d83cde1a43482709c3e9d4ec34b2f (patch)
treeea01bf87c817c04984c1a3fe7a7b06e005531662
parent123ec157692a9e776056d66f447c5fee59b72b13 (diff)
downloademacs-d5acb99a199d83cde1a43482709c3e9d4ec34b2f.tar.gz
emacs-d5acb99a199d83cde1a43482709c3e9d4ec34b2f.zip
* subr.el (read-passwd): Allow C-u to erase entry.
Fixes: debbugs:12570
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/subr.el12
2 files changed, 14 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 861022aae88..0d793285246 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12012-10-06 Glenn Morris <rgm@gnu.org>
2
3 * subr.el (read-passwd): Allow C-u to erase entry. (Bug#12570)
4
12012-10-06 Julian Scheid <julians37@gmail.com> (tiny change) 52012-10-06 Julian Scheid <julians37@gmail.com> (tiny change)
2 6
3 * color.el (color-hsl-to-rgb): Fix incorrect results for 7 * color.el (color-hsl-to-rgb): Fix incorrect results for
diff --git a/lisp/subr.el b/lisp/subr.el
index b0ffb0db746..72bedc69c3c 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2182,8 +2182,16 @@ by doing (clear-string STRING)."
2182 (set (make-local-variable 'post-self-insert-hook) nil) 2182 (set (make-local-variable 'post-self-insert-hook) nil)
2183 (add-hook 'after-change-functions hide-chars-fun nil 'local)) 2183 (add-hook 'after-change-functions hide-chars-fun nil 'local))
2184 (unwind-protect 2184 (unwind-protect
2185 (let ((enable-recursive-minibuffers t)) 2185 (let ((enable-recursive-minibuffers t)
2186 (read-string prompt nil t default)) ; t = "no history" 2186 (map minibuffer-local-map)
2187 result)
2188 (define-key map "\C-u" ; bug#12570
2189 (lambda () (interactive) (delete-minibuffer-contents)))
2190 (setq result
2191 ;; t = no history.
2192 (read-from-minibuffer prompt nil map nil t default))
2193 (if (and (equal "" result) default) default
2194 result))
2187 (when (buffer-live-p minibuf) 2195 (when (buffer-live-p minibuf)
2188 (with-current-buffer minibuf 2196 (with-current-buffer minibuf
2189 ;; Not sure why but it seems that there might be cases where the 2197 ;; Not sure why but it seems that there might be cases where the