[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion b307dc24c3 005/313: keep cword
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion b307dc24c3 005/313: keep cword |
Date: |
Sat, 3 Dec 2022 10:58:59 -0500 (EST) |
branch: elpa/bash-completion
commit b307dc24c3e8ab20e41aeca32c5c7ac3d8ecebb0
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
keep cword
---
bash-complete.el | 6 ++++--
bash-complete_test.el | 14 +++++++-------
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/bash-complete.el b/bash-complete.el
index 06df1d4b3a..8af7b5619b 100644
--- a/bash-complete.el
+++ b/bash-complete.el
@@ -38,7 +38,9 @@ Return a list containing the words and the number of the word
at POS, the current word: ( (word1 word2 ...) . wordnum )"
(save-excursion
(goto-char start)
- (nreverse (bash-complete-split-0 start end pos nil ""))))
+ (let ((accum (cons nil nil)))
+ (setq accum (bash-complete-split-0 start end pos accum ""))
+ (cons (car accum) (nreverse (cdr accum))))))
(defun bash-complete-split-0 (start end pos accum straccum)
(let ( (char-start (char-after))
@@ -76,7 +78,7 @@ at POS, the current word: ( (word1 word2 ...) . wordnum )"
;; word end
(t
(when straccum
- (push straccum accum))
+ (setcdr accum (cons straccum (cdr accum))))
(skip-chars-forward " \t\n\r" end)
(if (< (point) end)
(bash-complete-split-0 (point) end pos accum "")
diff --git a/bash-complete_test.el b/bash-complete_test.el
index 3c6f9447b6..d3403a7343 100644
--- a/bash-complete_test.el
+++ b/bash-complete_test.el
@@ -32,43 +32,43 @@
(sz-testutils-with-buffer
'("a hello world b c")
(bash-complete-split 1 (line-end-position) 0))
- '("a" "hello" "world" "b" "c"))
+ '(nil . ("a" "hello" "world" "b" "c")))
("bash-complete-split escaped space"
(sz-testutils-with-buffer
'("a hello\\ world b c")
(bash-complete-split 1 (line-end-position) 0))
- '("a" "hello world" "b" "c"))
+ '(nil . ("a" "hello world" "b" "c")))
("bash-complete-split double quotes"
(sz-testutils-with-buffer
'("a \"hello world\" b c")
(bash-complete-split 1 (line-end-position) 0))
- '("a" "hello world" "b" "c"))
+ '(nil . ("a" "hello world" "b" "c")))
("bash-complete-split double quotes escaped"
(sz-testutils-with-buffer
'("a \"-\\\"hello world\\\"-\" b c")
(bash-complete-split 1 (line-end-position) 0))
- '("a" "-\"hello world\"-" "b" "c"))
+ '(nil . ("a" "-\"hello world\"-" "b" "c")))
("bash-complete-split single quotes"
(sz-testutils-with-buffer
'("a 'hello world' b c")
(bash-complete-split 1 (line-end-position) 0))
- '("a" "hello world" "b" "c"))
+ '(nil . ("a" "hello world" "b" "c")))
("bash-complete-split single quotes escaped"
(sz-testutils-with-buffer
'("a '-\\'hello world\\'-' b c")
(bash-complete-split 1 (line-end-position) 0))
- '("a" "-'hello world'-" "b" "c"))
+ '(nil . ("a" "-'hello world'-" "b" "c")))
("bash-complete-split complex quote mix"
(sz-testutils-with-buffer
'("a hel\"lo w\"o'rld b'c d")
(bash-complete-split 1 (line-end-position) 0))
- '("a" "hello world bc" "d"))
+ '(nil . ("a" "hello world bc" "d")))
)))
- [nongnu] elpa/bash-completion ec557d8949 123/313: shell-command.el is unnecessary, and has probably been so for years..., (continued)
- [nongnu] elpa/bash-completion ec557d8949 123/313: shell-command.el is unnecessary, and has probably been so for years..., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 318e32979f 135/313: Display completion progress message only if completion takes too long., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 2378b04eeb 140/313: More easily call bash-completion-dynamic-complete-nocomint, faking bash, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 43348d0be1 143/313: Bugfixes: remove references to nonexistent variables, such as, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 583d1dde61 151/313: Remove usage of seq-position with a custom implementation., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 664452aca2 157/313: Merge pull request #22 from kfogel/21-fix-completion-re-21149fdc, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion ad8d72c626 162/313: README nit pick ; ), ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c494a89070 168/313: Run tests under Emacs 24.1: alias letf to cl-letf., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f523a290a6 169/313: Make the integration tests run on Emacs 24.1., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion bbff4fa527 172/313: Merge branch 'master' of github.com:szermatt/emacs-bash-completion, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion b307dc24c3 005/313: keep cword,
ELPA Syncer <=
- [nongnu] elpa/bash-completion a79137cc86 004/313: escaped quotes, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 581864111e 039/313: integration test harness, process buffer cleanup, hidden buffer, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3e1481741c 031/313: remove messages, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0d360a45cd 017/313: fixed test case, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c28492a749 036/313: wordbreak before and after, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 8b02aafc67 046/313: separators, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 2390d5cdf3 061/313: more commends and documentation; still need a commentary section, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c0f7c20a6b 094/313: added license and missing test dependency, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion a2d322fb79 054/313: Added customization group, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 983f5c28e9 106/313: Merge pull request #2 from frankpzh/patch-1, ELPA Syncer, 2022/12/03