improve completion #1245

merged 5 commits into from Feb 22, 2014

1 participant

Magit member

Also see #1220.

tarsius added some commits Feb 22, 2014
@tarsius tarsius magit-completing-read-function: sort choices by preference 26e7d30
@tarsius tarsius magit-{ido,iswitchb}-completion-read: doc-string cosmetics 50cb068
@tarsius tarsius magit-prompt-with-default: new function
Split `magit-prompt-with-default' from `magit-builtin-completing-read'
so that it could also be used by other `completing-read' replacements
and wrappers.
@tarsius tarsius magit-completing-read: be strict about REQUIRE-MATCH
`completing-read's REQUIRE-MATCH means "require the user to exit with
a match, but there are exceptions in which case an empty string is
returned".  That's not so useful because every caller has to check
for that empty string.

Previously `magit-builtin-completing-read' did detect that case and
raise an error if `completing-read' returned an empty string.  Now
we do this in `magit-completing-read' so that this sanity check is
applied regardless of what `magit-completing-read-function' is used.

Remove equivalent checks from `magit-read-remote-branch' and
`magit-read-rev'.  Now that we do this in the correct place we no
longer have to do it in several places.
@tarsius tarsius magit-completing-read: better doc-string 05ea5db
@tarsius tarsius merged commit 05ea5db into next Feb 22, 2014
@tarsius tarsius deleted the n/completion-1 branch Feb 22, 2014
@tarsius tarsius added this to the 2.1.0 milestone Feb 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment