Mercurial > emacs
comparison lisp/comint.el @ 8087:c22d7c5168f5
comint-password-prompt-regexp: New variable.
comint-watch-for-password-prompt: Use it.
author | Noah Friedman <friedman@splode.com> |
---|---|
date | Wed, 29 Jun 1994 18:21:34 +0000 |
parents | 5b9bbe66631c |
children | c830f54843c2 |
comparison
equal
deleted
inserted
replaced
8086:9f6348616e4d | 8087:c22d7c5168f5 |
---|---|
216 "*If non-nil, assume that the subprocess echoes any input. | 216 "*If non-nil, assume that the subprocess echoes any input. |
217 If so, delete one copy of the input so that only one copy eventually | 217 If so, delete one copy of the input so that only one copy eventually |
218 appears in the buffer. | 218 appears in the buffer. |
219 | 219 |
220 This variable is buffer-local.") | 220 This variable is buffer-local.") |
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.") | |
221 | 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. |
225 This function is called when return is typed while the point is in old text. | 229 This function is called when return is typed while the point is in old text. |
1387 (comint-send-string proc "\n")))) | 1391 (comint-send-string proc "\n")))) |
1388 | 1392 |
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 |
1399 | 1404 |
1400 (defvar comint-input-chunk-size 512 | 1405 (defvar comint-input-chunk-size 512 |