[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 0c170c6: Simplify comint-watch-for-password-prompt
From: |
Lars Ingebrigtsen |
Subject: |
master 0c170c6: Simplify comint-watch-for-password-prompt |
Date: |
Mon, 22 Feb 2021 09:47:38 -0500 (EST) |
branch: master
commit 0c170c64b178da1df05d953d993e992b8bdc2502
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Simplify comint-watch-for-password-prompt
* lisp/comint.el (comint-watch-for-password-prompt): Simplify by
using `string-trim'.
---
lisp/comint.el | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/lisp/comint.el b/lisp/comint.el
index ea69c3b..5c307fe 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -104,6 +104,7 @@
(require 'ring)
(require 'ansi-color)
(require 'regexp-opt) ;For regexp-opt-charset.
+(eval-when-compile (require 'subr-x))
;; Buffer Local Variables:
;;============================================================================
@@ -2430,14 +2431,11 @@ This function could be in the list
`comint-output-filter-functions'."
(when (let ((case-fold-search t))
(string-match comint-password-prompt-regexp
(replace-regexp-in-string "\r" "" string)))
- (when (string-match "^[ \n\r\t\v\f\b\a]+" string)
- (setq string (replace-match "" t t string)))
- (when (string-match "\n+\\'" string)
- (setq string (replace-match "" t t string)))
(let ((comint--prompt-recursion-depth (1+ comint--prompt-recursion-depth)))
(if (> comint--prompt-recursion-depth 10)
(message "Password prompt recursion too deep")
- (comint-send-invisible string)))))
+ (comint-send-invisible
+ (string-trim string "[ \n\r\t\v\f\b\a]+" "\n+"))))))
;; Low-level process communication
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 0c170c6: Simplify comint-watch-for-password-prompt,
Lars Ingebrigtsen <=