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
* counsel.el (counsel-set-variable): Add prefix arg behavior. #1643
Conversation
Filter out vars without custom-type properties.
(lambda (var) | ||
(get (intern var) 'custom-type)) | ||
vars) | ||
vars)) |
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.
AKA
(ivy-read "Set variable: " (counsel-variable-list)
:predicate (and current-prefix-arg
(lambda (varname)
(get (intern varname) 'custom-type)))
:history 'counsel-set-variable-history
:preselect (ivy-thing-at-point)
:sort t
:caller 'counsel-set-variable)
(Any reason :sort
and :caller
weren't already specified?)
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.
@basil-conto That version is nicer but it doesn't work for me.
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.
@justbur Can you please elaborate?
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.
@basil-conto Yes, sorry. With your version a prefix arg does not seem to have any affect on the list of candidates, while my initial version did eliminate candidates in my tests. I'm not sure why
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.
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.
Oh, seems to be #1158.
Thanks. |
counsel.el (counsel-set-variable): Use custom-variable-p instead of inspecting the custom-type property, which is only set when a defcustom has a :type. Re: abo-abo#1643
counsel.el (counsel-set-variable): Use custom-variable-p instead of inspecting the custom-type property, which is only set when a defcustom has a :type. Re: #1643
Filter out vars without custom-type properties.