# HG changeset patch # User Noah Friedman # Date 772914094 0 # Node ID c22d7c5168f5d44937b12243f4c629664ab57259 # Parent 9f6348616e4d5d27bd5710f719ca5852ee79cc68 comint-password-prompt-regexp: New variable. comint-watch-for-password-prompt: Use it. diff -r 9f6348616e4d -r c22d7c5168f5 lisp/comint.el --- a/lisp/comint.el Wed Jun 29 18:06:09 1994 +0000 +++ b/lisp/comint.el Wed Jun 29 18:21:34 1994 +0000 @@ -219,6 +219,10 @@ 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 @@ (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))) ;;; Low-level process communication