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

Support multiple candidate selection #17

Closed
bdarcus opened this issue Mar 7, 2021 · 0 comments · Fixed by #18
Closed

Support multiple candidate selection #17

bdarcus opened this issue Mar 7, 2021 · 0 comments · Fixed by #18
Labels
enhancement New feature or request help wanted Extra attention is needed refactor
Milestone

Comments

@bdarcus
Copy link
Contributor

bdarcus commented Mar 7, 2021

In helm-bibtex, when presented with a list of candidates, one can do the following:

  • hit control-space to mark multiple candidates
  • hit tab to access action options, or return to run default

Screenshot from 2021-03-07 02-54-08

In my view, this is an almost ideal UX for selecting and acting on multiple candidates (though arguably the selected candidates should then be grouped at the top of the list).

That will then pass multiple keys to the relevant functions, and for the insert-at-point commands, those functions take care of the formatting; in some cases they are comma-separated inline, and in others (like inserting BibTeX entries), they are separated by newlines.

So how to do this here?

The obvious answer is to change the read function to use completing-read-multiple.

But the selectrum UI support for multiple selection is not really optimized for examples like this with very long candidates. Same for icomplete-vertical, which uses a similar UI.

I did, however, submit an enhancement request to selectrum to support this case. No code yet, but I'm optimistic we will see it.

So it would be good to resolve this on our end before this happens, so we can test and contribute feedback.

Seems we would also need to get embark to support multiple (see comment).

@bdarcus bdarcus changed the title Passing mulitple keys to insert functions? Passing multiple keys to insert functions? Mar 7, 2021
bdarcus added a commit that referenced this issue Mar 7, 2021
Selectrum needs to be enhanced make to sure the UX for selecting
multiple (long) candidates is elegant. But this is how it should be.

Addresses #17.
@bdarcus bdarcus changed the title Passing multiple keys to insert functions? Support multiple candidate selection Mar 8, 2021
@bdarcus bdarcus added this to the v0.1 milestone Mar 8, 2021
@bdarcus bdarcus added enhancement New feature or request help wanted Extra attention is needed labels Mar 8, 2021
@bdarcus bdarcus linked a pull request Mar 9, 2021 that will close this issue
@bdarcus bdarcus pinned this issue Mar 9, 2021
bdarcus added a commit that referenced this issue Mar 9, 2021
Selectrum needs to be enhanced make to sure the UX for selecting
multiple (long) candidates is elegant. But this is how it should be.

Addresses #17.
bdarcus added a commit that referenced this issue Mar 9, 2021
Selectrum needs to be enhanced make to sure the UX for selecting
multiple (long) candidates is elegant. But this is how it should be.

Addresses #17.
bdarcus added a commit that referenced this issue Mar 9, 2021
The bibtex-completion functions all take multiple keys as input, and
some of them (notably the "input" ones) lose functionality without
support for this.

Hence, this changes the core read function to using
'completing-read-multiple'.

Addresses #17.
bdarcus added a commit that referenced this issue Mar 9, 2021
The bibtex-completion functions all take multiple keys as input, and
some of them (notably the "input" ones) lose functionality without
support for this.

Hence, this changes the core read function to using
'completing-read-multiple'.

Addresses #17.
bdarcus added a commit that referenced this issue Mar 9, 2021
The bibtex-completion functions all take multiple keys as input, and
some of them (notably the "input" ones) lose functionality without
support for this.

Hence, this changes the core read function to using
'completing-read-multiple'.

Addresses #17.
bdarcus added a commit that referenced this issue Mar 9, 2021
The bibtex-completion functions all take multiple keys as input, and
some of them (notably the "input" ones) lose functionality without
support for this.

Hence, this changes the core read function to using
'completing-read-multiple'.

Addresses #17.
bdarcus added a commit that referenced this issue Mar 10, 2021
The bibtex-completion functions all take multiple keys as input, and
some of them (notably the "input" ones) lose functionality without
support for this.

Hence, this changes the core read function to using
'completing-read-multiple'.

Addresses #17.
bdarcus added a commit that referenced this issue Mar 10, 2021
The bibtex-completion functions all take multiple keys as input, and
some of them (notably the "input" ones) lose functionality without
support for this.

Hence, this changes the core read function to using
'completing-read-multiple'.

Addresses #17.
bdarcus added a commit that referenced this issue Mar 10, 2021
The bibtex-completion functions all take multiple keys as input, and
some of them (notably the "input" ones) lose functionality without
support for this.

Hence, this changes the core read function to using
'completing-read-multiple'.

Addresses #17.
bdarcus added a commit that referenced this issue Mar 11, 2021
The bibtex-completion functions all take multiple keys as input, and
some of them (notably the "input" ones) lose functionality without
support for this.

Hence, this changes the core read function to use
'completing-read-multiple'.

In order to do that, it also sets the 'crm-separator' to ampersand, 
since default comma won't work for these data.

Many thanks to @oantolin for help on the read function.

Addresses #17.

cc oantolin/embark#176 (comment)
@bdarcus bdarcus reopened this Mar 11, 2021
@bdarcus bdarcus closed this as completed Mar 11, 2021
@bdarcus bdarcus unpinned this issue Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant