Visitar URL original
completing-read-multi can't select all, resets after each selection · Issue #395 · radian-software/selectrum · GitHub
Skip to content

completing-read-multi can't select all, resets after each selection #395

Open

Description

@WorldsEndless

I used to use helm, and then ivy, to select addresses for emails I'm composing. I've now written it up using completing-read-multiple and at first it appears to work fine; indeed, there's no problem if I select only one. But I have problems with other major work flows:

  1. Search for all addresses that are part of my "newsletter" group (works fine; I see all those addresses)

2a. Fails: Try to select all of them at once (I can't find a "select all" key in standard completing-read-multiple; does it exist?)

2b. Press "TAB" to add one individually

  1. After adding that one option, I'm back to step 1: I need search again, re-enter "newsletter" etc.

How can I select all? Similarly, it seems like an undesirable workflow that hitting TAB always resets your Selectrum results.

Activity

  1. clemera commented on Jan 24, 2021

    @clemera
    Collaborator

    A select all funcitonality doesn't exist, I think adding it to our adapted version in Selectrum is a great idea.

    Similarly, it seems like an undesirable workflow that hitting TAB always resets your Selectrum results

    Hitting TAB adds another candidate to your results and you can proceed searching for more. Do you think we could do better? What behaviour are you looking for? Maybe the prompt should be selected after TAB so one can immediately exit with RET or proceed searching by typing.

  2. WorldsEndless commented on Jan 24, 2021

    @WorldsEndless
    Author

    Hitting TAB adds another candidate to your results and you can proceed searching for more. Do you think we could do better? What behaviour are you looking for? Maybe the prompt should be selected after TAB so one can immediately exit with RET or proceed searching by typing.

    My work flow is this:

    1. Start my completing-read-multiple
    2. type "newsletter", which reduces it appropriately
    3. Since there's no "select all", I choose one and press "tab"
    4. My prompt now includes the one I chose, followed by crm-separator
    5. I have to re-specify "newsletter" to find out who to add next

    My snippet:

          (let ((crm-separator "|"))
    	(insert (string-join
    		 (mapcar 'tsa/format-insert-email
    			 (completing-read-multiple "Select:" (tsa/get-address-names (bbdb-records))))
    		 ", "))) 
  3. changed the title [-]consulting-read-multi can't select all, resets after each selection[/-] [+]completing-read-multi can't select all, resets after each selection[/+] on Jan 24, 2021
  4. clemera commented on Jan 24, 2021

    @clemera
    Collaborator

    Thanks, as far as I understand we would only need to provide a select all functionality to make this use case more convenient. The reset is intentional and for the usual case it makes sense to keep it that way unless I am missing something. Keeping the prompt selected as I mentioned earlier might still be nice.

  5. clemera commented on Jan 24, 2021

    @clemera
    Collaborator

    After trying I also see now that if you want to select multiple candidates which share a common substring the reset is inconvenient. Maybe we could have a key to add a candidate but also keep the current search string this would also solve the use case when you don't want all but multiple ones with a same substring.

  6. clemera commented on Jan 24, 2021

    @clemera
    Collaborator

    For reference the following improvements for crm could be nice:

    • Add a command to select all
    • Add a command to add the current candidate but also keep the input, maybe a general restrict to matches command which I remember was requested for usual completion could be used, it would help also for the crm use case here.
    • Select the prompt after inserting a candidate
  7. WorldsEndless commented on Jan 25, 2021

    @WorldsEndless
    Author

    These are good. An addition that would be nice is a face to highlight elements that have already been selected, so it's easily visible.

  8. clemera commented on Jan 25, 2021

    @clemera
    Collaborator

    You probably did not notice that we already omit candidates which are selected.

  9. WorldsEndless commented on Jan 25, 2021

    @WorldsEndless
    Author
  10. clemera commented on Jan 27, 2021

    @clemera
    Collaborator

    Regarding the prompt selection I think it is better to stay consistent with how we handle it elsewhere (for example file completions). To finish your input you should press "RET" on the last candidate. If you "wrongly" typed "TAB" you can remove the last "," or select the prompt to submit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions