[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion 7965b914da 160/313: Re-enable directory ex
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion 7965b914da 160/313: Re-enable directory expansion for custom completion. fixes #23 |
Date: |
Sat, 3 Dec 2022 10:59:26 -0500 (EST) |
branch: elpa/bash-completion
commit 7965b914da4483af8872f359eef9686b7a53b97a
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
Re-enable directory expansion for custom completion. fixes #23
I tured off directory expansion (adding a trailing /) by mistake when
refactoring the expansion code. While doing directory expansion is not
necessarily always the right thing to do with custom completion, it
usually is. This commit turns it back on.
issue #19 should allow properly configuring this behavior
command-by-command.
---
bash-completion.el | 2 +-
test/bash-completion-test.el | 15 ++++++++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/bash-completion.el b/bash-completion.el
index 269230afbc..63955c81b5 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -837,7 +837,7 @@ for directory name detection to work."
(eq ?/ last-char))
(setq suffix ""))
((and
- (memq completion-type '(command default wordbreak))
+ (memq completion-type '(command default wordbreak custom))
(file-accessible-directory-p
(expand-file-name (bash-completion-unescape
open-quote (concat parsed-prefix rest))
diff --git a/test/bash-completion-test.el b/test/bash-completion-test.el
index 5983e5e775..5532da53e0 100644
--- a/test/bash-completion-test.el
+++ b/test/bash-completion-test.el
@@ -915,7 +915,7 @@ before calling `bash-completion-dynamic-complete-nocomint'.
'("--color=")
(nth 2 (bash-completion-dynamic-complete-nocomint 3
(point))))))))
-(ert-deftest bash-completion-single-custom-completion-as-directory ()
+(ert-deftest bash-completion-single-custom-completion-as-directory-explicit ()
(--with-fake-bash-completion-send
(setq bash-completion-alist '(("ls" "compgen" "args")))
(push "somedir/\n" --send-results)
@@ -925,6 +925,19 @@ before calling `bash-completion-dynamic-complete-nocomint'.
'("somedir/")
(nth 2 (bash-completion-dynamic-complete-nocomint 3
(point))))))))
+(ert-deftest bash-completion-single-custom-completion-as-directory-implicit ()
+ (--with-fake-bash-completion-send
+ (setq bash-completion-alist '(("ls" "compgen" "args")))
+ ;; note that adding a / after a completion is not always the right thing
+ ;; to do. See github issue #19.
+ (push "/tmp/test/somedir" --directories)
+ (push "somedir\n" --send-results)
+ (insert "$ ls some")
+ (let ((bash-completion-nospace nil))
+ (should (equal
+ '("somedir/")
+ (nth 2 (bash-completion-dynamic-complete-nocomint 3
(point))))))))
+
(ert-deftest bash-completion-custom-completion-with-fallback ()
(--with-fake-bash-completion-send
(setq bash-completion-alist '(("ls" "compgen" "args")))
- [nongnu] elpa/bash-completion bac0fb55f1 124/313: More integration test cleanup made possible by the move to ert., (continued)
- [nongnu] elpa/bash-completion bac0fb55f1 124/313: More integration test cleanup made possible by the move to ert., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion b49dbe1457 127/313: Don't require obsolete and unused cl., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0af9a70ff9 130/313: Merge pull request #16 from tarsius/master, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion d673bf1ed0 132/313: Merge pull request #17 from svend/bash-flags, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1659c7ca38 126/313: Quoting fix: fix parentheses in a file name, improve double quoting within, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 432c2d15c9 142/313: Add a space after the completion candidate for single completion., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0f3f8c22b4 146/313: Add a space after a single custom completion., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion eacb8061e3 147/313: Fallback to filename completion when custom completion didn't find, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 081d03bedc 156/313: Fix issue #21 completion bug, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1c2153d287 159/313: Call make-obsolete with three arguments, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7965b914da 160/313: Re-enable directory expansion for custom completion. fixes #23,
ELPA Syncer <=
- [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