Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

completing-read doesn't show or select candidate correctly if differently cased #1331

Closed
cosmicexplorer opened this issue Jan 11, 2016 · 1 comment

Comments

@cosmicexplorer
Copy link
Contributor

Two failure cases (at least, differences from completing-read-default that look like errors):

(let ((completion-ignore-case nil))
  (helm--completing-read-default
   "hey: " '("wow" "nice" "yay")))

Inserting WOW into the helm buffer and pressing RET returns "", and it should return "WOW" unless I'm mistaken. The same occurs with REQUIRE-MATCH set to 'confirm or anything else except t.

(let ((completion-ignore-case t))
  (helm--completing-read-default
   "hey: " '("wow" "nice" "yay")))

Inserting "W" should also show "wow" as a candidate because of completion-ignore-case (as it does with completing-read-default), but it doesn't. It also returns "" here when "WOW" is the helm-pattern; it should return "WOW" (in accordance with completing-read-default).

I'll try to look into these soon but I'm not super familiar with the codebase so it'll take me a bit. Are either of these supposed to be happening?

@thierryvolpiatto
Copy link
Member

Danny McClanahan notifications@github.com writes:

Two failure cases (at least, differences from completing-read-default that look like errors):

(let ((completion-ignore-case nil))
(helm--completing-read-default

First of all, please do not use helm--completing-read-default, it is for
internal use, use instead completing-read with helm-mode enabled.

"hey: " '("wow" "nice" "yay")))

Inserting WOW into the helm buffer and pressing RET returns "", and it
should return "WOW" unless I'm mistaken.

Helm is ignoring completion-ignore-case, it is using the following
variables:

For generic completion i.e completing-read and read-file-name and
friends:

  • helm-comp-read-case-fold-search
  • helm-file-name-case-fold-search (used also in native helm files
    related commands)

For helm more generally:

  • helm-case-fold-search

Both helm-comp-read-case-fold-search and helm-file-name-case-fold-search
are set by default to the default value of helm-case-fold-search which
is 'smart which see.

See following examples:

(let ((helm-comp-read-case-fold-search t))
(completing-read "test: " '("wow" "nice" "yay")))

(let ((helm-case-fold-search t))
(helm :sources (helm-build-in-buffer-source "test"
:data '("wow" "nice" "yay"))
:buffer "helm test"))

(let ((helm-case-fold-search t))
(helm :sources (helm-build-sync-source "test"
:candidates '("wow" "nice" "yay"))
:buffer "helm test"))

Thierry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants