[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/subr.el
From: |
Richard M . Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/subr.el |
Date: |
Sun, 17 Oct 2004 03:09:10 -0400 |
Index: emacs/lisp/subr.el
diff -c emacs/lisp/subr.el:1.419 emacs/lisp/subr.el:1.420
*** emacs/lisp/subr.el:1.419 Sat Oct 16 15:29:46 2004
--- emacs/lisp/subr.el Sun Oct 17 06:59:15 2004
***************
*** 1212,1262 ****
code))
(defun read-passwd (prompt &optional confirm default)
! "Read a password, prompting with PROMPT. Echo `.' for each character typed.
! End with RET, LFD, or ESC. DEL or C-h rubs out. C-u kills line.
! If optional CONFIRM is non-nil, read password twice to make sure.
! Optional DEFAULT is a default password to use instead of empty input."
! (if confirm
! (let (success)
! (while (not success)
! (let ((first (read-passwd prompt nil default))
! (second (read-passwd "Confirm password: " nil default)))
! (if (equal first second)
! (progn
! (and (arrayp second) (clear-string second))
! (setq success first))
! (and (arrayp first) (clear-string first))
! (and (arrayp second) (clear-string second))
! (message "Password not repeated accurately; please start over")
! (sit-for 1))))
! success)
! (let ((pass nil)
! (c 0)
! (echo-keystrokes 0)
! (cursor-in-echo-area t))
! (while (progn (message "%s%s"
! prompt
! (make-string (length pass) ?.))
! (setq c (read-char-exclusive nil t))
! (and (/= c ?\r) (/= c ?\n) (/= c ?\e)))
! (clear-this-command-keys)
! (if (= c ?\C-u)
! (progn
! (and (arrayp pass) (clear-string pass))
! (setq pass ""))
! (if (and (/= c ?\b) (/= c ?\177))
! (let* ((new-char (char-to-string c))
! (new-pass (concat pass new-char)))
(and (arrayp pass) (clear-string pass))
! (clear-string new-char)
! (setq c ?\0)
! (setq pass new-pass))
! (if (> (length pass) 0)
! (let ((new-pass (substring pass 0 -1)))
(and (arrayp pass) (clear-string pass))
! (setq pass new-pass))))))
! (message nil)
! (or pass default ""))))
;; This should be used by `call-interactively' for `n' specs.
(defun read-number (prompt &optional default)
--- 1212,1270 ----
code))
(defun read-passwd (prompt &optional confirm default)
! "Read a password, prompting with PROMPT, and return it.
! If optional CONFIRM is non-nil, read the password twice to make sure.
! Optional DEFAULT is a default password to use instead of empty input.
!
! This function echoes `.' for each character that the user types.
! The user ends with RET, LFD, or ESC. DEL or C-h rubs out. C-u kills line.
! C-g quits; if `inhibit-quit' was non-nil around this function,
! then it returns nil if the user types C-g.
!
! Once the caller uses the password, it can erase the password
! by doing (clear-string STRING)."
! (with-local-quit
! (if confirm
! (let (success)
! (while (not success)
! (let ((first (read-passwd prompt nil default))
! (second (read-passwd "Confirm password: " nil default)))
! (if (equal first second)
! (progn
! (and (arrayp second) (clear-string second))
! (setq success first))
! (and (arrayp first) (clear-string first))
! (and (arrayp second) (clear-string second))
! (message "Password not repeated accurately; please start over")
! (sit-for 1))))
! success)
! (let ((pass nil)
! (c 0)
! (echo-keystrokes 0)
! (cursor-in-echo-area t))
! (while (progn (message "%s%s"
! prompt
! (make-string (length pass) ?.))
! (setq c (read-char-exclusive nil t))
! (and (/= c ?\r) (/= c ?\n) (/= c ?\e)))
! (clear-this-command-keys)
! (if (= c ?\C-u)
! (progn
(and (arrayp pass) (clear-string pass))
! (setq pass ""))
! (if (and (/= c ?\b) (/= c ?\177))
! (let* ((new-char (char-to-string c))
! (new-pass (concat pass new-char)))
(and (arrayp pass) (clear-string pass))
! (clear-string new-char)
! (setq c ?\0)
! (setq pass new-pass))
! (if (> (length pass) 0)
! (let ((new-pass (substring pass 0 -1)))
! (and (arrayp pass) (clear-string pass))
! (setq pass new-pass))))))
! (message nil)
! (or pass default "")))))
;; This should be used by `call-interactively' for `n' specs.
(defun read-number (prompt &optional default)
***************
*** 1822,1835 ****
(defmacro with-local-quit (&rest body)
"Execute BODY, allowing quits to terminate BODY but not escape further.
! When a quit terminates BODY, `with-local-quit' requests another quit when
! it finishes. That quit will be processed in turn, the next time quitting
! is again allowed."
(declare (debug t) (indent 0))
`(condition-case nil
(let ((inhibit-quit nil))
,@body)
! (quit (setq quit-flag t))))
(defmacro combine-after-change-calls (&rest body)
"Execute BODY, but don't call the after-change functions till the end.
--- 1830,1843 ----
(defmacro with-local-quit (&rest body)
"Execute BODY, allowing quits to terminate BODY but not escape further.
! When a quit terminates BODY, `with-local-quit' returns nil but
! requests another quit. That quit will be processed, the next time quitting
! is allowed once again."
(declare (debug t) (indent 0))
`(condition-case nil
(let ((inhibit-quit nil))
,@body)
! (quit (setq quit-flag t) nil)))
(defmacro combine-after-change-calls (&rest body)
"Execute BODY, but don't call the after-change functions till the end.
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Eli Zaretskii, 2004/10/08
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Kim F . Storm, 2004/10/09
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Kim F . Storm, 2004/10/11
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Stefan Monnier, 2004/10/13
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Richard M . Stallman, 2004/10/16
- [Emacs-diffs] Changes to emacs/lisp/subr.el,
Richard M . Stallman <=
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Simon Josefsson, 2004/10/25
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Stefan Monnier, 2004/10/28
- [Emacs-diffs] Changes to emacs/lisp/subr.el, Simon Josefsson, 2004/10/29