[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion 2684ea9e46 264/313: Fix issue with case-in
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion 2684ea9e46 264/313: Fix issue with case-insensitive completion. |
Date: |
Sat, 3 Dec 2022 10:59:36 -0500 (EST) |
branch: elpa/bash-completion
commit 2684ea9e46e24dc70d03aa07f47b85b062998cca
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
Fix issue with case-insensitive completion.
Before this change, when matches have different cases, the "common
prefix" ended up being empty. completion-ignore-case needs to be set
correctly, after all, from the output of "bind -v".
---
bash-completion.el | 21 ++++++++++++---------
test/bash-completion-integration-test.el | 9 +++++++++
2 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/bash-completion.el b/bash-completion.el
index ba5ec5d701..02b021024b 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -441,6 +441,12 @@ returned."
(process-put process 'bash-major-version bash-major-version)
(bash-completion-send "bind -v 2>/dev/null" process)
+ (process-put process 'completion-ignore-case
+ (with-current-buffer (bash-completion--get-buffer process)
+ (save-excursion
+ (goto-char (point-min))
+ (and (search-forward "completion-ignore-case on" nil
'noerror) t))))
+
(process-put process 'setup-done t)))
;;; ---------- Inline functions
@@ -1584,15 +1590,12 @@ completion."
(bash-completion--complete comp process))))))
(setq last-str str
last-result result)
- ;; The below passes an empty string to try-completion,
- ;; all-completions and test-completion to not let them do
- ;; any further filtering.
- (funcall
- (cond
- ((null action) 'try-completion)
- ((eq action t) 'all-completions)
- (t 'test-completion))
- "" result predicate))))))
+ (let ((filtered-result (if predicate (mapcar predicate result)
result))
+ (completion-ignore-case (process-get process
'completion-ignore-case)))
+ (cond
+ ((null action) (try-completion "" filtered-result))
+ ((eq action t) filtered-result)
+ (t (test-completion "" filtered-result)))))))))
(provide 'bash-completion)
diff --git a/test/bash-completion-integration-test.el
b/test/bash-completion-integration-test.el
index 0c82c82d51..6ed2dc1c6f 100644
--- a/test/bash-completion-integration-test.el
+++ b/test/bash-completion-integration-test.el
@@ -46,6 +46,9 @@
"--noprofile"
"--rcfile" (expand-file-name "bashrc" test-env-dir)))
(completion-ignore-case nil)
+ (completion-in-region-function 'completion--in-region)
+ (completion-cycle-threshold 20)
+ (completion-styles '(basic partial-completion substring emacs22))
(explicit-shell-file-name bash-completion-prog)
(explicit-args-var (intern
(concat "explicit-"
@@ -398,6 +401,8 @@ for testing completion."
(insert "set completion-ignore-case on\n"))
(make-directory "Uppercase")
(make-directory "Another Uppercase")
+ (make-directory "libs")
+ (make-directory "Library")
(bash-completion_test-with-shell
(when (>= (bash-completion_test-bash-major-version) 4)
;; Case insensitive completion is done by compgen which, under
@@ -407,6 +412,10 @@ for testing completion."
(should (equal "ls some/" (bash-completion_test-complete "ls So")))
(should (equal "ls Uppercase/" (bash-completion_test-complete "ls Up")))
(should (equal "ls Uppercase/" (bash-completion_test-complete "ls up")))
+
+ (should (equal "ls libs/" (bash-completion_test-complete "ls li")))
+ (should (equal "ls libs/" (bash-completion_test-complete "ls Li")))
+
(should (equal "ls Another\\ Uppercase/" (bash-completion_test-complete
"ls Ano")))
(should (equal "ls Another\\ Uppercase/" (bash-completion_test-complete
"ls ano")))
(should (equal "ls \"Another Uppercase/" (bash-completion_test-complete
"ls \"Ano")))
- [nongnu] elpa/bash-completion 2178030cdf 225/313: Allow running unit and integration tests separately., (continued)
- [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, 2022/12/03
- [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 <=
- [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
- [nongnu] elpa/bash-completion c3797e0d09 277/313: Avoid running the same completion multiple times., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0210d346f1 279/313: Make bash-completion-use-separate-processes default to nil., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7a1f127851 292/313: Test and fix the dynamic table function that's returned., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3dbbd1beff 293/313: Fix tests to run under Emacs 24.3., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion d47edb9d41 294/313: Bump version to 3.1, a bugfix release., ELPA Syncer, 2022/12/03