diff options
| author | Noah Friedman | 1994-06-29 18:21:34 +0000 |
|---|---|---|
| committer | Noah Friedman | 1994-06-29 18:21:34 +0000 |
| commit | 654d89d78e7fe04721f4d9f7f788d8bbc783632f (patch) | |
| tree | 3e7a11a7a802f09cce5af48411eb6645c4f4e43d | |
| parent | 5286a84274ebfd70d0659739f8ff4e4fd532c9a7 (diff) | |
| download | emacs-654d89d78e7fe04721f4d9f7f788d8bbc783632f.tar.gz emacs-654d89d78e7fe04721f4d9f7f788d8bbc783632f.zip | |
comint-password-prompt-regexp: New variable.
comint-watch-for-password-prompt: Use it.
| -rw-r--r-- | lisp/comint.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 3a343303598..469c8c12fcd 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -219,6 +219,10 @@ appears in the buffer. | |||
| 219 | 219 | ||
| 220 | This variable is buffer-local.") | 220 | This variable is buffer-local.") |
| 221 | 221 | ||
| 222 | (defvar comint-password-prompt-regexp "\\b[Pp]assword:\\s *\\'" | ||
| 223 | "*Regexp matching prompts for passwords in the inferior process. | ||
| 224 | This is used by comint-watch-for-password-prompt.") | ||
| 225 | |||
| 222 | ;;; Here are the per-interpreter hooks. | 226 | ;;; Here are the per-interpreter hooks. |
| 223 | (defvar comint-get-old-input (function comint-get-old-input-default) | 227 | (defvar comint-get-old-input (function comint-get-old-input-default) |
| 224 | "Function that returns old text in comint mode. | 228 | "Function that returns old text in comint mode. |
| @@ -1389,10 +1393,11 @@ Security bug: your string can still be temporarily recovered with | |||
| 1389 | (defun comint-watch-for-password-prompt (string) | 1393 | (defun comint-watch-for-password-prompt (string) |
| 1390 | "Prompt in the minibuffer for password and send without echoing. | 1394 | "Prompt in the minibuffer for password and send without echoing. |
| 1391 | This function uses `send-invisible' to read and send a password to the buffer's | 1395 | This function uses `send-invisible' to read and send a password to the buffer's |
| 1392 | process if STRING contains a password prompt (matches \"^[Pp]assword:\\\\s *\\\\'\"). | 1396 | process if STRING contains a password prompt defined by |
| 1397 | `comint-password-prompt-regexp'. | ||
| 1393 | 1398 | ||
| 1394 | This function could be in the list `comint-output-filter-functions'." | 1399 | This function could be in the list `comint-output-filter-functions'." |
| 1395 | (if (string-match "^[Pp]assword:\\s *\\'" string) | 1400 | (if (string-match comint-password-prompt-regexp string) |
| 1396 | (send-invisible nil))) | 1401 | (send-invisible nil))) |
| 1397 | 1402 | ||
| 1398 | ;;; Low-level process communication | 1403 | ;;; Low-level process communication |