[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion 24f78df106 203/313: Improve output handlin
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion 24f78df106 203/313: Improve output handling |
Date: |
Sat, 3 Dec 2022 10:59:30 -0500 (EST) |
branch: elpa/bash-completion
commit 24f78df106af0aa47da25cb82aa5fac3b106e396
Author: montag451 <montag451@laposte.net>
Commit: montag451 <montag451@laposte.net>
Improve output handling
---
bash-completion.el | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/bash-completion.el b/bash-completion.el
index 295c067d9e..bffd8c683e 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -403,6 +403,7 @@ returned."
(defun bash-completion--output-filter (output)
(with-current-buffer (bash-completion--get-buffer nil)
+ (goto-char (point-max))
(insert output)
""))
@@ -1319,6 +1320,13 @@ and would like bash completion in Emacs to take these
changes into account."
(setq bash-completion-processes (delq entry bash-completion-processes)))
running))
+(defun bash-completion--wait-for-output (process output-regex timeout)
+ (let ((no-timeout t))
+ (while (and no-timeout
+ (not (re-search-backward output-regex nil t)))
+ (setq no-timeout (accept-process-output process timeout)))
+ no-timeout))
+
(defun bash-completion--send-separate-process (commandline &optional process
timeout)
;; (message commandline)
@@ -1357,20 +1365,15 @@ and would like bash completion in Emacs to take these
changes into account."
(with-current-buffer (bash-completion--get-buffer process)
(erase-buffer)
(comint-send-string process (concat commandline "; echo -e \"\v$?\""
"\n"))
- (while (not (save-excursion
- (forward-line 0)
- (re-search-forward prompt-regex nil t)))
- (unless (accept-process-output process timeout)
- (error (concat
- "Timeout while waiting for an answer from "
- "bash-completion process.\nProcess output: <<<EOF\n%sEOF")
- (buffer-string))))
- (forward-line 0)
- (delete-region (point) (point-max))
+ (unless (bash-completion--wait-for-output process prompt-regex timeout)
+ (error (concat
+ "Timeout while waiting for an answer from "
+ "bash-completion process.\nProcess output: <<<EOF\n%sEOF")
+ (buffer-string)))
(search-backward "\v")
(let* ((status-code (string-to-number
(buffer-substring-no-properties
- (point) (line-end-position)))))
+ (1+ (point)) (line-end-position)))))
(delete-region (point) (point-max))
(if (string=
"124"
- [nongnu] elpa/bash-completion 58447c67bf 206/313: Merge the send functions, (continued)
- [nongnu] elpa/bash-completion 58447c67bf 206/313: Merge the send functions, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion d6c28d3132 302/313: Add a troubleshooting section to README.md, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion d550256e3f 306/313: Disable flakey test for now., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion a8f7de1e91 173/313: Merge remote-tracking branch 'montag451/remote-shell-support-rebase', ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 9521f79b33 176/313: Display the emacs command run by the tests., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion fc3f762d16 177/313: Track and support options -o default, filenames and nospace., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c6df9be78d 182/313: Store the alist as process property., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion fefe5ae88e 191/313: Introduce bash-completion-remote-prog., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion d99ad71050 199/313: Add a new option to disable the use of separate processes to perform completion, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion ce59fb017a 202/313: Fallback to the use of a separate process if an error occurs, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 24f78df106 203/313: Improve output handling,
ELPA Syncer <=
- [nongnu] elpa/bash-completion cc9a3dcab4 204/313: Stop cluttering the Bash history, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0a6fa499ad 207/313: Fix one parameter name of bash-completion--wait-for-prompt, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3bd30eea3f 208/313: Use the correct function to send string to completion process, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion fd2f8e277e 211/313: Improve prompt detection, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion ac3bd404e8 220/313: Fix typos (#40), ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f31bb46ff4 222/313: Making sure that line editing is turned off (#42), ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3210a44081 224/313: Makefile allows specifying the path to bash., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 2178030cdf 225/313: Allow running unit and integration tests separately., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c564aff656 229/313: Add workflow for testing on MacOS with BASH 3., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion ba8be293a4 226/313: Added test workflow to run tests on multiple versions of Emacs., ELPA Syncer, 2022/12/03