]> git.eshelyaron.com Git - emacs.git/commitdiff
comint-password-prompt-regexp: New variable.
authorNoah Friedman <friedman@splode.com>
Wed, 29 Jun 1994 18:21:34 +0000 (18:21 +0000)
committerNoah Friedman <friedman@splode.com>
Wed, 29 Jun 1994 18:21:34 +0000 (18:21 +0000)
comint-watch-for-password-prompt: Use it.

lisp/comint.el

index 3a343303598433e27e8d86135b07d53d6183a70d..469c8c12fcddd59102cdd6ae9792eaab6b774614 100644 (file)
@@ -219,6 +219,10 @@ appears in the buffer.
 
 This variable is buffer-local.")
 
+(defvar comint-password-prompt-regexp "\\b[Pp]assword:\\s *\\'"
+  "*Regexp matching prompts for passwords in the inferior process.
+This is used by comint-watch-for-password-prompt.")
+
 ;;; Here are the per-interpreter hooks.
 (defvar comint-get-old-input (function comint-get-old-input-default)
   "Function that returns old text in comint mode.
@@ -1389,10 +1393,11 @@ Security bug: your string can still be temporarily recovered with
 (defun comint-watch-for-password-prompt (string) 
   "Prompt in the minibuffer for password and send without echoing.
 This function uses `send-invisible' to read and send a password to the buffer's
-process if STRING contains a password prompt (matches \"^[Pp]assword:\\\\s *\\\\'\").
+process if STRING contains a password prompt defined by 
+`comint-password-prompt-regexp'.
 
 This function could be in the list `comint-output-filter-functions'."
-  (if (string-match "^[Pp]assword:\\s *\\'" string)
+  (if (string-match comint-password-prompt-regexp string)
       (send-invisible nil)))
 \f
 ;;; Low-level process communication