why `counsel-M-x` doesn't use `ivy-format-function` #150

bixuanzju opened this Issue Jun 18, 2015 · 1 comment


None yet

2 participants


I have following lines in my config (stolen from your blog ;)

  (setq ivy-format-function 'eh-ivy-format-function)

  (defun eh-ivy-format-function (cands)
    (let ((i -1))
       (lambda (s)
         (concat (if (eq (cl-incf i) ivy--index)
                     "> "
                   "  ")
       cands "\n")))

I like this little arrow indicating which line i am on. But counsel-M-x seems ignoring this.

@abo-abo abo-abo added a commit that closed this issue Jun 19, 2015
@abo-abo Make counsel-M-x respect ivy-format-function
* counsel.el (counsel--format-function-M-x): Remove defun.
(counsel--M-x-transformer): New defun.
(counsel-M-x): Temporarily bind `ivy-format-function' to apply
`counsel--M-x-transformer' beforehand.

* ivy.el (ivy-format-function-arrow): Update style.

Fixes #150
@abo-abo abo-abo closed this in a5e49ff Jun 19, 2015
abo-abo commented Jun 19, 2015

Thanks, fixed. I also updated ivy-format-function-arrow to the body of eh-ivy-format-function.

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