[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion 4581a7823f 189/313: Bash 4: set COMP_TYPE
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion 4581a7823f 189/313: Bash 4: set COMP_TYPE and COMP_KEY to TAB, to let completion functions |
Date: |
Sat, 3 Dec 2022 10:59:29 -0500 (EST) |
branch: elpa/bash-completion
commit 4581a7823f0148871aea0244053aba119614de6f
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
Bash 4: set COMP_TYPE and COMP_KEY to TAB, to let completion functions
know they should do the full tab completion.
This improves bash 4 compatibility and avoids functions written for
bash 4 to be confused as to which type of completion they should run.
Issue #32
---
bash-completion.el | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/bash-completion.el b/bash-completion.el
index 1d9652eb37..a649d81bbc 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -915,7 +915,7 @@ is set to t."
(if (bash-completion-is-running)
(cdr (assoc remote bash-completion-processes))
;; start process
- (let ((process) (oldterm (getenv "TERM")) (cleanup t))
+ (let ((process) (oldterm (getenv "TERM")) (cleanup t)
(bash-major-version))
(unwind-protect
(progn
(setenv "EMACS_BASH_COMPLETE" "t")
@@ -944,13 +944,6 @@ is set to t."
(when (file-exists-p (bash-completion--expand-file-name
start-file))
(process-send-string process (concat ". " start-file "\n"))))
(bash-completion-send "PROMPT_COMMAND='';PS1='\t$?\v'" process
bash-completion-initial-timeout)
- (bash-completion-send (concat "function __bash_complete_wrapper
{"
- " eval $__BASH_COMPLETE_WRAPPER;"
- " n=$?; if [[ $n = 124 ]]; then"
- " echo -n \""
- bash-completion-wrapped-status
- "\"; return 1; "
- " fi; }") process)
;; attempt to turn off unexpected status messages from bash
;; if the current version of bash does not support these options,
;; the commands will fail silently and be ignored.
@@ -969,15 +962,25 @@ is set to t."
(process-put process 'complete-p
(bash-completion-build-alist (process-buffer
process)))
(bash-completion-send "echo -n ${BASH_VERSINFO[0]}" process)
- (process-put process 'bash-major-version
- (with-current-buffer (process-buffer process)
- (string-to-number (buffer-substring-no-properties
- (point-min) (point-max)))))
+ (setq bash-major-version
+ (with-current-buffer (process-buffer process)
+ (string-to-number (buffer-substring-no-properties
+ (point-min) (point-max)))))
+ (bash-completion-send (concat "function __bash_complete_wrapper
{"
+ (if (>= bash-major-version 4)
+ " COMP_TYPE=9; COMP_KEY=9;" "")
+ " eval $__BASH_COMPLETE_WRAPPER;"
+ " n=$?; if [[ $n = 124 ]]; then"
+ " echo -n \""
+ bash-completion-wrapped-status
+ "\"; return 1; "
+ " fi; }") process)
(bash-completion-send "echo -n ${COMP_WORDBREAKS}" process)
(process-put process 'wordbreaks
(with-current-buffer (process-buffer process)
(buffer-substring-no-properties
(point-min) (point-max))))
+ (process-put process 'bash-major-version bash-major-version)
(push (cons remote process) bash-completion-processes)
(setq cleanup nil)
process)
- [nongnu] elpa/bash-completion 2c0b8d6a6e 163/313: Merge pull request #27 from vorburger/patch-1, (continued)
- [nongnu] elpa/bash-completion 2c0b8d6a6e 163/313: Merge pull request #27 from vorburger/patch-1, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0c77c64b50 174/313: Disable bash-completion-enable-caching if completion-table-with-cache, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion b281e1e181 008/313: bash-complete-add-to-alist, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1144ae69a9 056/313: documented the tokenizer, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 376dd532e2 057/313: modre documentation, up until wordbreak, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion fd7e0e6fbe 078/313: added documentation, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion dd34b278bf 069/313: stopping at point; the easy way, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 8756e80737 184/313: Replace 'options' in the completion struct with 'nospace'., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 2c4cb6edd2 186/313: Replace bash-completion-integration-test with a higher-level test for, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0aed19067b 188/313: When using Bash 4, split words as Bash 4 does., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 4581a7823f 189/313: Bash 4: set COMP_TYPE and COMP_KEY to TAB, to let completion functions,
ELPA Syncer <=
- [nongnu] elpa/bash-completion 802eb4e5a8 194/313: Set EMACS_BASH_COMPLETE even on remote (tramp) completion., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion fbdc78b877 198/313: Support compopt when using Bash 4., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f1bd3d528f 201/313: Improve some docstrings, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion fa49dbb382 209/313: Improve status code retrieval, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7822d84812 223/313: Added Cask with ert-runner to compile and run test., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 31a01859b2 227/313: Do not run tests under Emacs 24.1., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 21471cc542 228/313: Report result of running the test workflow on README.md., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 98a2a21be7 234/313: Provide a way of refreshing the completion table., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 4fcddf83c9 242/313: Make /etc/bash_completion scripts work with escaped spaces., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 2dbc7e61f6 248/313: Extend bash-completion-refresh to refresh everything, test it., ELPA Syncer, 2022/12/03