[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion ce59fb017a 202/313: Fallback to the use of
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion ce59fb017a 202/313: Fallback to the use of a separate process if an error occurs |
Date: |
Sat, 3 Dec 2022 10:59:30 -0500 (EST) |
branch: elpa/bash-completion
commit ce59fb017affb0ab18c8ecb861b73b61e72dc088
Author: montag451 <montag451@laposte.net>
Commit: montag451 <montag451@laposte.net>
Fallback to the use of a separate process if an error occurs
---
bash-completion.el | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/bash-completion.el b/bash-completion.el
index 79d4b62c7f..295c067d9e 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -150,8 +150,11 @@ BASH completion is only available in the environment for
which
When set to a non-nil value, separate processes will be used to
perform completion. If nil, the process associated with the
-current buffer is used to perform completion. If no process is
-associated with the current buffer, a separate process is used."
+current buffer is used to perform completion. Even when this
+variable is set to nil, a separate process can be used to perform
+completion when:
+- no process is associated with the current buffer
+- an error occurred while trying to get completions"
:type 'boolean
:group 'bash-completion)
@@ -480,6 +483,17 @@ When doing completion outside of a comint buffer, call
(if (fboundp 'completion-table-with-cache)
'completion-table-with-cache 'completion-table-dynamic))
+(defun bash-completion--complete (comp process)
+ (condition-case err
+ (bash-completion-comm comp process)
+ (error (if (not bash-completion-use-separate-processes)
+ ;; try again with a separate process
+ (let* ((bash-completion-use-separate-processes t)
+ (process (bash-completion-require-process)))
+ (bash-completion-comm comp process))
+ ;; re-throw the error
+ (signal (car err) (cdr err))))))
+
;;;###autoload
(defun bash-completion-dynamic-complete-nocomint
(comp-start comp-pos &optional dynamic-table)
@@ -522,8 +536,8 @@ Returns (list stub-start stub-end completions) with
(lambda (_)
(let ((bash-completion-use-separate-processes
use-separate-processes))
- (bash-completion-comm comp process))))
- (bash-completion-comm comp process)))))))
+ (bash-completion--complete comp process))))
+ (bash-completion--complete comp process)))))))
(defun bash-completion--find-last (elt array)
"Return the position of the last intance of ELT in array or nil."
- [nongnu] elpa/bash-completion 6aedd69000 164/313: Delete duplicates when extracting candidates. fixes #26, (continued)
- [nongnu] elpa/bash-completion 6aedd69000 164/313: Delete duplicates when extracting candidates. fixes #26, ELPA Syncer, 2022/12/03
- [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 <=
- [nongnu] elpa/bash-completion 24f78df106 203/313: Improve output handling, ELPA Syncer, 2022/12/03
- [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