[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion 4a1d89f01e 246/313: Support -o vi and emac
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion 4a1d89f01e 246/313: Support -o vi and emacs even in single-process mode. |
Date: |
Sat, 3 Dec 2022 10:59:35 -0500 (EST) |
branch: elpa/bash-completion
commit 4a1d89f01eeda17402d4e94f5e0ba499ece05d72
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
Support -o vi and emacs even in single-process mode.
Changes to the default editing interface must be turned off or adapted
to when in single-process mode, too.
This changes also adds tests for both options in single and
multi-process mode.
---
bash-completion.el | 3 ++-
test/bash-completion-integration-test.el | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/bash-completion.el b/bash-completion.el
index cf6ede1a37..20a8abc7c0 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -379,6 +379,7 @@ returned."
(defun bash-completion--setup-bash-common (process)
"Setup PROCESS to be ready for completion."
(let (bash-major-version)
+ (bash-completion-send "set +o vi" process)
(bash-completion-send "complete -p" process)
(process-put process 'complete-p
(bash-completion-build-alist (bash-completion--get-buffer
process)))
@@ -1460,7 +1461,7 @@ Return the status code of the command, as a number."
(concat
commandline
(unless bash-completion-use-separate-processes
- "; echo \"--\v$?\"; history -d $((HISTCMD - 1))")
+ "; echo -e \"--\\v$?\"; history -d $((HISTCMD - 1))")
"\n"))
(if bash-completion-use-separate-processes
(unless (bash-completion--wait-for-regexp process
"\t-?[[:digit:]]+\v" timeout)
diff --git a/test/bash-completion-integration-test.el
b/test/bash-completion-integration-test.el
index 8976ce0d04..c767129a2b 100644
--- a/test/bash-completion-integration-test.el
+++ b/test/bash-completion-integration-test.el
@@ -333,4 +333,27 @@ for testing completion."
(should (equal '("batitita" "batitito")
(bash-completion_test-candidates "myprog blah titi")))))
+(ert-deftest bash-completion-integration-vioption-single-process-test ()
+ (bash-completion_test--with-bash-option "set -o vi" nil))
+
+(ert-deftest bash-completion-integration-vioption-multi-processes-test ()
+ (bash-completion_test--with-bash-option "set -o vi" t))
+
+(ert-deftest bash-completion-integration-emacsoption-single-process-test ()
+ (bash-completion_test--with-bash-option "set -o emacs" nil))
+
+(ert-deftest bash-completion-integration-emacsoption-multi-process-test ()
+ (bash-completion_test--with-bash-option "set -o emacs" t))
+
+(defun bash-completion_test--with-bash-option (turn-on-option
use-separate-process)
+ (bash-completion_test-with-shell-harness
+ (concat ; .bashrc
+ turn-on-option "\n"
+ "function _dummy { COMPREPLY=(Yooo); }\n"
+ "function dummy { echo $1; }\n"
+ "complete -F _dummy dummy\n")
+ use-separate-process
+ (should (equal "dummy 1 Yooo "
+ (bash-completion_test-complete "dummy 1 Y")))))
+
;;; bash-completion-integration-test.el ends here
- [nongnu] elpa/bash-completion 3bd30eea3f 208/313: Use the correct function to send string to completion process, (continued)
- [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
- [nongnu] elpa/bash-completion 0a757bd5f4 238/313: Test calling completion from non-comint and non-bash shell buffers., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c99083233f 241/313: Fix shell-type detection logic for remote processes., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 4a1d89f01e 246/313: Support -o vi and emacs even in single-process mode.,
ELPA Syncer <=
- [nongnu] elpa/bash-completion aec357fbf1 249/313: Test default completion with both value of use-separate-process., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 38c82e5d59 252/313: Conserve quotes even when expanding case-insensitively., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 6a66eeda45 253/313: Add test-case to cover tilde and tilde expansion., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion b9e519e2ad 263/313: Fix typo, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 2684ea9e46 264/313: Fix issue with case-insensitive completion., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 6d74dd30ba 266/313: Avoid interference from PROMPT_COMMAND in single process mode., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 23a3402844 270/313: Trying to disable the warning on MacOS that breaks the tests., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1598101f06 271/313: Remove the fallback to a separate process., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 18ed1504ce 274/313: Add test cases for TRAMP shell., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 23dbe5b537 276/313: Change minimum supported Emacs version from 24.1 to 24.3., ELPA Syncer, 2022/12/03