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

Avoid nil for the default argument of ‘completing-read’. #1419

Closed
wants to merge 1 commit into from

Conversation

Copy link
Member

@cpitclaudel cpitclaudel left a 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))))
Copy link
Member

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))
Copy link
Member

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?

@cpitclaudel
Copy link
Member

Closing as this patch has gone stale. If the original concerns can be addressed, I'll be happy to have a new look.

@cpitclaudel
Copy link
Member

I created a separate PR, #1706, with a different fix

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

Successfully merging this pull request may close these issues.

Take completing-read quirk into account
2 participants