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

* counsel.el (counsel-set-variable): Add prefix arg behavior. #1643

Closed
wants to merge 1 commit into from

Conversation

@justbur
Copy link
Contributor

commented Jun 29, 2018

Filter out vars without custom-type properties.

* counsel.el (counsel-set-variable): Add prefix arg behavior.
Filter out vars without custom-type properties.
(lambda (var)
(get (intern var) 'custom-type))
vars)
vars))

This comment has been minimized.

Copy link
@basil-conto

basil-conto Jun 29, 2018

Collaborator

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?)

This comment has been minimized.

Copy link
@justbur

justbur Jun 29, 2018

Author Contributor

@basil-conto That version is nicer but it doesn't work for me.

This comment has been minimized.

Copy link
@basil-conto

basil-conto Jun 29, 2018

Collaborator

@justbur Can you please elaborate?

This comment has been minimized.

Copy link
@justbur

justbur Jun 29, 2018

Author Contributor

@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

This comment has been minimized.

Copy link
@basil-conto

basil-conto Jun 29, 2018

Collaborator

@justbur Looks like there is a bug with Ivy where the :predicate is never called for some reason. I won't be able to investigate until tomorrow, so unless you care to investigate before then, I suspect @abo-abo will just merge as is.

This comment has been minimized.

Copy link
@basil-conto

basil-conto Jun 29, 2018

Collaborator

Oh, seems to be #1158.

@abo-abo abo-abo closed this in 89679c2 Jul 3, 2018

@abo-abo

This comment has been minimized.

Copy link
Owner

commented Jul 3, 2018

Thanks.

basil-conto added a commit to basil-conto/swiper that referenced this pull request Aug 7, 2018
Use custom-variable-p in counsel-set-variable
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
abo-abo added a commit that referenced this pull request Aug 8, 2018
Use custom-variable-p in counsel-set-variable
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.