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

proced-filter-interactive not working with ivy-mode #1687

Closed
dakra opened this issue Jul 30, 2018 · 7 comments

Comments

@dakra
Copy link

commented Jul 30, 2018

When in proced you can change the filter with f (proced-filter-interactive)
This reads (completing-read "Filter: " proced-filter-alist nil t)
which works when ivy-mode is disabled but breaks enabled (doesn't show any completion options).

(I'm using latest Emacs master)

@abo-abo

This comment has been minimized.

Copy link
Owner

commented Jul 30, 2018

Looks like an Emacs bug to me. Here's what gets passed to completing-read-function:

((user (user . "\\`krehel\\'"))
 (user-running
  (user . "\\`krehel\\'")
  (state . "\\`[Rr]\\'"))
 (all)
 (all-running
  (state . "\\`[Rr]\\'"))
 (emacs
  (fun-all
   lambda (list)
   (proced-filter-children
    list
    5081))))

This is not compatible with the API of completing-read. From documentation of completing-read:

COLLECTION can be a list of strings, an alist, an obarray or a hash table.

@dakra

This comment has been minimized.

Copy link
Author

commented Jul 30, 2018

OK.
I filed a bug report: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32314

I'll leave this open until I get an answer there.
(Or you can close it already if you want of course)

@npostavs

This comment has been minimized.

Copy link

commented Jul 30, 2018

This is not compatible with the API of completing-read. From documentation of completing-read:

COLLECTION can be a list of strings, an alist, an obarray or a hash table.

Looks like an alist to me. Why do you think it's wrong?

@basil-conto

This comment has been minimized.

Copy link
Collaborator

commented Jul 30, 2018

This is not compatible with the API of completing-read.

It is, see (elisp) Basic Completion:

If COLLECTION is a list, the permissible completions are specified
by the elements of the list, each of which should be either a
string, or a cons cell whose CAR is either a string or a symbol (a
symbol is converted to a string using ‘symbol-name’).  If the list
contains elements of any other type, those are ignored.

Funnily enough, ivy-read handles symbol alists just fine:

(progn
  (setq unread-command-events '(?\C-m))
  (ivy-read "" '((a) (b) (c))))
  ;; => "a"
@abo-abo

This comment has been minimized.

Copy link
Owner

commented Jul 31, 2018

@npostavs

Looks like an alist to me. Why do you think it's wrong?

I thought it the alist's elements' cars were supposed to be only strings. But @basil-conto corrected me that they can also be symbols.

@abo-abo abo-abo closed this in 9386666 Jul 31, 2018

@abo-abo

This comment has been minimized.

Copy link
Owner

commented Jul 31, 2018

Should be fixed now, please test. And sorry for the confusion.

@dakra

This comment has been minimized.

Copy link
Author

commented Jul 31, 2018

@abo-abo The fix works for me. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.