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
Avoid nil for the default argument of ‘completing-read’. #1419
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first change looks suspicious, and I think the second one looks wrong :/ Can you clarify why they are needed?
@@ -1384,7 +1384,8 @@ to the default levels." | |||
(flycheck-error-list-current-errors))) | |||
(levels-with-defaults (append '(info warning error) levels)) | |||
(uniq-levels (seq-uniq levels-with-defaults)) | |||
(level (flycheck-completing-read prompt uniq-levels nil))) | |||
(level (flycheck-completing-read prompt uniq-levels | |||
(car uniq-levels)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This look wrong: we do want to offer an empty entry (it corresponds to setting a nil level)
@@ -1364,7 +1364,7 @@ a default on its own." | |||
(flycheck-defined-checkers property)))) | |||
(default (and default (symbol-name default))) | |||
(input (flycheck-completing-read | |||
prompt candidates default | |||
prompt candidates (or default (car candidates)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code below explicitly deals with the case of no checker selected case, so do we really need this?
Closing as this patch has gone stale. If the original concerns can be addressed, I'll be happy to have a new look. |
I created a separate PR, #1706, with a different fix |
This avoids the quirk described at
https://github.com/DarwinAwardWinner/ido-completing-read-plus#why-does-ret-sometimes-not-select-the-first-completion-on-the-list--why-is-there-an-empty-entry-at-the-beginning-of-the-completion-list--what-happened-to-old-style-default-selection.
Fixes #1418