[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion e7869dd68d 200/313: Fix a bug when no proc
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion e7869dd68d 200/313: Fix a bug when no process is associated with the current buffer |
Date: |
Sat, 3 Dec 2022 10:59:30 -0500 (EST) |
branch: elpa/bash-completion
commit e7869dd68dd4690a8536d9977c282af46fbbf955
Author: montag451 <montag451@laposte.net>
Commit: montag451 <montag451@laposte.net>
Fix a bug when no process is associated with the current buffer
When `bash-completion-use-separate-processes' is nil and no buffer is
associated with the current buffer, use a separate completion
process.
---
bash-completion.el | 42 ++++++++++++++++++++++++++----------------
1 file changed, 26 insertions(+), 16 deletions(-)
diff --git a/bash-completion.el b/bash-completion.el
index 881810df2c..480f48b776 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -487,21 +487,31 @@ Returns (list stub-start stub-end completions) with
or a function, if DYNAMIC-TABLE is non-nil, a lambda such as the one
returned by `completion-table-dynamic'"
(when bash-completion-enabled
- (let* ((process (bash-completion-require-process))
- (comp (bash-completion--parse
- comp-start comp-pos
- (process-get process 'wordbreaks)
- (process-get process 'bash-major-version)))
- (stub-start (bash-completion--stub-start comp)))
- (bash-completion--customize comp process)
- (list
- stub-start
- comp-pos
- (if dynamic-table
- (bash-completion--completion-table-with-cache
- (lambda (_)
- (bash-completion-comm comp process)))
- (bash-completion-comm comp process))))))
+ (let ((bash-completion-use-separate-processes
+ bash-completion-use-separate-processes)
+ (process (bash-completion-require-process)))
+ (when (and (not process) (not bash-completion-use-separate-processes))
+ ;; no process associated with the current buffer, create a
+ ;; separate completion process
+ (setq bash-completion-use-separate-processes t)
+ (setq process (bash-completion-require-process)))
+ (let* ((comp (bash-completion--parse
+ comp-start comp-pos
+ (process-get process 'wordbreaks)
+ (process-get process 'bash-major-version)))
+ (stub-start (bash-completion--stub-start comp))
+ (use-separate-processes bash-completion-use-separate-processes))
+ (bash-completion--customize comp process)
+ (list
+ stub-start
+ comp-pos
+ (if dynamic-table
+ (bash-completion--completion-table-with-cache
+ (lambda (_)
+ (let ((bash-completion-use-separate-processes
+ use-separate-processes))
+ (bash-completion-comm comp process))))
+ (bash-completion-comm comp process)))))))
(defun bash-completion--find-last (elt array)
"Return the position of the last intance of ELT in array or nil."
@@ -1103,7 +1113,7 @@ is set to t."
(defun bash-completion--require-same-process ()
"Setup the process associated with the current buffer and return it."
(let ((process (get-buffer-process (current-buffer))))
- (unless (process-get process 'complete-p)
+ (unless (or (not process) (process-get process 'complete-p))
(bash-completion--setup-bash-common process))
process))
- [nongnu] elpa/bash-completion a223260f2d 181/313: Get rid of bash-completion-alist completely., (continued)
- [nongnu] elpa/bash-completion a223260f2d 181/313: Get rid of bash-completion-alist completely., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 4f13e00702 183/313: Execute wordbreak completion "properly", as part of the normal, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 34221c1fdd 185/313: Make bash-completion-enable-caching the default, remove the, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 8c3995aa98 187/313: run_tests.sh displays the bash command to test against., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3eba6922e6 190/313: Use executable-find instead of hardcoding /bin/bash., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1d41c58bd5 192/313: Send initialization command as one string, as long as possible., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c5d4f92e6d 195/313: Still EMACS_BASH_COMPLETE using setenv for local processes., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 24088ede85 196/313: Explicitly mention compatibility with Bash 3 and 4., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0f6466eeb4 197/313: Tell minibuffer not to delay after displaying a message while, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0c4557a5ed 193/313: Integration test for default completion (-D)., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion e7869dd68d 200/313: Fix a bug when no process is associated with the current buffer,
ELPA Syncer <=
- [nongnu] elpa/bash-completion 80be2f37a9 205/313: Check the buffer uses comint-mode before using the same process, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 28ec870dd1 019/313: only one -complete method, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 6a0ada6278 038/313: completed test cases, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7d6236e6e7 100/313: ignore .elc files, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1aff6d8806 084/313: comment about shell-command, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f5384c6176 051/313: A little refactoring, test case for wordbreak completion, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 6f7c2b8b4f 080/313: removed initial version, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion a2cf41d7fc 102/313: put in accidentally removed blank line from README, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion a8b652d00a 058/313: commented all functions, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion b4fe25b51c 060/313: update tests for latest refactorings, ELPA Syncer, 2022/12/03