[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion 7186a18cad 012/313: Integrated into comm
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion 7186a18cad 012/313: Integrated into comm |
Date: |
Sat, 3 Dec 2022 10:59:11 -0500 (EST) |
branch: elpa/bash-completion
commit 7186a18cadef47f0406b6b56c11de9166d64a0c5
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
Integrated into comm
---
bash-complete.el | 11 +++++++----
bash-complete_test.el | 14 +++++++-------
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/bash-complete.el b/bash-complete.el
index 3f9292f379..0a2547d2f3 100644
--- a/bash-complete.el
+++ b/bash-complete.el
@@ -52,7 +52,9 @@ Call bash to do the completion."
(defun bash-complete-quote (word)
(if (string-match "^[a-zA-Z0-9_.-]*$" word)
word
- (concat "'" (replace-regexp-in-string "'" "\\\'" word :literal t) "'")))
+ (concat "'"
+ (replace-regexp-in-string "'" "'\\''" word :literal t)
+ "'")))
(defun bash-complete-split (start end pos)
"Split LINE like bash would do, keep track of current word at POS.
@@ -122,8 +124,9 @@ completion environment (COMP_LINE, COMP_POINT, COMP_WORDS,
COMP_CWORD) and
calls compgen.
The result is a list of candidates, which might be empty."
-
- )
+ (bash-complete-send (concat (bash-complete-generate-line line pos words
cword) " 2>/dev/null"))
+ (with-current-buffer (bash-complete-buffer)
+ (split-string (buffer-string) "\n" t)))
(defun bash-complete-require-process ()
;; TODO(szermatt): if this fails, kill process and complain
@@ -136,8 +139,8 @@ The result is a list of candidates, which might be empty."
"--noediting"))
(set-process-query-on-exit-flag bash-complete-process nil)
(bash-complete-send "PS1='\v'")
+ (bash-complete-send "function __bash_complete_wrapper { eval
$__BASH_COMPLETE_WRAPPER; }")
(bash-complete-send "complete -p")
- (bash-complete-send "function __bash_complete_wrapper { eval
$__BASH_COMPLETE_WRAPPER }")
(bash-complete-build-alist (process-buffer bash-complete-process)))
bash-complete-process)
diff --git a/bash-complete_test.el b/bash-complete_test.el
index 41b93c7356..3969b7303c 100644
--- a/bash-complete_test.el
+++ b/bash-complete_test.el
@@ -34,7 +34,7 @@
("bash-complete-join escape quote"
(bash-complete-join '("a" "hel'lo" "world" "b" "c"))
- "a 'hel\\'lo' world b c")
+ "a 'hel'\\''lo' world b c")
("bash-complete-join escape space"
(bash-complete-join '("a" "hello world" "b" "c"))
@@ -72,7 +72,7 @@
("bash-complete-split single quotes"
(sz-testutils-with-buffer
- '("a 'hello world' b c")
+ '("a \"hello world\" b c")
(bash-complete-split 1 (line-end-position) 0))
'(nil . ("a" "hello world" "b" "c")))
@@ -159,13 +159,13 @@ garbage
(bash-complete-quote "hello")
"hello")
- ("bash-complete-quote not necessary"
+ ("bash-complete-quote space"
(bash-complete-quote "hello world")
"'hello world'")
- ("bash-complete-quote not necessary"
+ ("bash-complete-quote quote"
(bash-complete-quote "hell'o")
- "'hell\\'o'")
+ "'hell'\\''o'")
("bash-complete-generate-line no custom completion"
(let ((bash-complete-alist nil))
@@ -180,12 +180,12 @@ garbage
("bash-complete-generate-line custom completion function"
(let ((bash-complete-alist '(("zorg" . ("-F" "__zorg")))))
(bash-complete-generate-line "zorg worl" 7 '("zorg" "worl") 1))
- "__BASH_COMPLETE_WRAPPER='COMP_LINE=\\'zorg worl\\'; COMP_POS=7;
COMP_CWORD=1; COMP_WORDS=( zorg worl ); __zorg \"$@\"' compgen -F
__bash_complete_wrapper worl")
+ "__BASH_COMPLETE_WRAPPER='COMP_LINE='\\''zorg worl'\\''; COMP_POS=7;
COMP_CWORD=1; COMP_WORDS=( zorg worl ); __zorg \"$@\"' compgen -F
__bash_complete_wrapper worl")
("bash-complete-generate-line custom completion command"
(let ((bash-complete-alist '(("zorg" . ("-C" "__zorg")))))
(bash-complete-generate-line "zorg worl" 7 '("zorg" "worl") 1))
- "__BASH_COMPLETE_WRAPPER='COMP_LINE=\\'zorg worl\\'; COMP_POS=7;
COMP_CWORD=1; COMP_WORDS=( zorg worl ); __zorg \"$@\"' compgen -F
__bash_complete_wrapper worl")
+ "__BASH_COMPLETE_WRAPPER='COMP_LINE='\\''zorg worl'\\''; COMP_POS=7;
COMP_CWORD=1; COMP_WORDS=( zorg worl ); __zorg \"$@\"' compgen -F
__bash_complete_wrapper worl")
)))
- [nongnu] elpa/bash-completion 2a937b3763 255/313: Don't let Emacs post-filter completions built by bash., (continued)
- [nongnu] elpa/bash-completion 2a937b3763 255/313: Don't let Emacs post-filter completions built by bash., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion e95867c993 256/313: completion-table-with-cache captures and restore buffer and variables., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 747920fdbf 265/313: Avoid having to set BASH_COMPLETION., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f15176ee59 267/313: Fix to properly evaluate PROMPT_COMMAND after restoring it., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion b4ae893243 268/313: Test prompt and history manipulation, fix $? in prompt., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 20feaf909d 258/313: Fix markdown markup., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 8713edbb92 269/313: Mention that completion works with bash 5, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 4b80c75c43 272/313: Take current directory from shell when in single-process mode., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion ea5cc15b99 273/313: Let status code of compgen through when in single-process mode., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 12da4f0e91 289/313: Better handle slow completion functions., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7186a18cad 012/313: Integrated into comm,
ELPA Syncer <=
- [nongnu] elpa/bash-completion e81c478032 020/313: bash-complete -> bash-completion, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 8270e09294 023/313: pass words as command-line arguments to the function, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 482383dcd7 021/313: handle slash for directory, usable completion, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion cd2ec103d1 026/313: Expand directory names with quotes and spaces, but no further, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1d7af7e40d 027/313: Remove debug messages, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion dda4697cfb 029/313: included bash-completion into google env, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 21eabde7f9 045/313: Reimplemented split, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3c58afdb0d 033/313: expand file names in colon-separated paths, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 5501cb63cf 042/313: Turn off mail warning, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0dcf43f91e 041/313: don't run integration tests by default, ELPA Syncer, 2022/12/03