Skip to content

Change to completing-read-multiple#18

Merged
bdarcus merged 1 commit intomainfrom
read-multiple
Mar 11, 2021
Merged

Change to completing-read-multiple#18
bdarcus merged 1 commit intomainfrom
read-multiple

Conversation

@bdarcus
Copy link
Contributor

@bdarcus bdarcus commented Mar 7, 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.

Addresses #17.

see oantolin/embark#176 (comment)

@bdarcus bdarcus changed the title Change to completing-read-multiple Change to completing-read-multiple Mar 9, 2021
@bdarcus bdarcus added help wanted Extra attention is needed enhancement New feature or request labels Mar 9, 2021
@bdarcus bdarcus mentioned this pull request Mar 9, 2021
@bdarcus bdarcus linked an issue Mar 9, 2021 that may be closed by this pull request
@bdarcus bdarcus force-pushed the read-multiple branch 8 times, most recently from f5bf979 to a6f4860 Compare March 10, 2021 00:11
@Yevgnen
Copy link
Contributor

Yevgnen commented Mar 10, 2021

Hi, at a quick glance, without UI changes of selectrum, I thinks it's a bit hard to achieve (better UE).

I see that selectrum-completing-read-multiple overrides completing-read-multiple.

I've thought maybe we could insert the bibtex keys (which are much shorter) as selected items but selectrum seems insert the candidate (which is the formated citation) directly with no possible transformation.

Personally, selecting multiple items in minibuffer is not that convenient for me. I prefer to show only 7~10 items in minibuffer due to a limited display. I used to use ivy-mark to selecting multiple items but I rarely used it. Whether to keep the selected items in the top is also another UE issue. Operating multiple items in a separate buffer like ivy-occur or embark-collect seems much better for me. I see that helm-bibtex seems use a large window to display window to display bibtex items, I think it works closely like working in a separate buffer. But the difference is, one need to keep the 'input session' for selecting items when using helm-bibtex, but working in a separator need not.

Maybe I'm wrong since I'm not a very experience user in ivy and helm.

How do you think?

@bdarcus
Copy link
Contributor Author

bdarcus commented Mar 10, 2021

I agree the current multiple select UI in selectrum is not well suited to this ATM.

I've thought maybe we could insert the bibtex keys (which are much shorter) as selected items but selectrum seems insert the candidate (which is the formated citation) directly with no possible transformation.

Yes, that's correct. If you haven't already, see radian-software/selectrum#489.

The idea @clemera suggested there would be a huge improvement.

radian-software/selectrum#489 (comment)

The changes to the function I pushed last night, which are almost working, were suggested by the embark author. He thinks it should work fine with embark, and so also the ivy-occur-like embark-collect.

But we still need to use multiple in order for that to work.

If you select four items in the collect buffer, and run insert-bibtex, this should correctly work. Otherwise, you'd have to separately run the command four times, and likely manually deal with the formatting that the commands handle instead.

@bdarcus bdarcus marked this pull request as draft March 10, 2021 13:28
@bdarcus
Copy link
Contributor Author

bdarcus commented Mar 10, 2021

This actually now should work. You just have to use the ampersand separator instead of comma.

@bdarcus bdarcus marked this pull request as ready for review March 10, 2021 18:43
@bdarcus
Copy link
Contributor Author

bdarcus commented Mar 10, 2021

FYI, embark integration doesn't generate errors, @oantolin, but also doesn't generate correct output with multiple selections.

If I select two candidates, for example, and run embark-act, only one gets output.

Is there something else I need to do so embark knows how to handle the custom crm-separator? I was assuming, based on what you wrote earlier, that this should just work.

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 bdarcus removed the help wanted Extra attention is needed label Mar 10, 2021
@bdarcus bdarcus merged commit 97a3845 into main Mar 11, 2021
@bdarcus
Copy link
Contributor Author

bdarcus commented Mar 11, 2021

I merged this. We can test further and see if we can figure out the embark piece.

@bdarcus bdarcus deleted the read-multiple branch March 11, 2021 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support multiple candidate selection

3 participants