Subject: Re: bug#20116: 24.4.91; [PATCH]Don't use iswitchb in erc.

From: Stefan Monnier <[email-masked]>
Date: Mon, 16 Mar 2015 09:07:12 -0400

> Using completing-read allow ido user to use ido, helm users helm etc...

Indeed, thanks.

> +  (switch-to-buffer
> +   (completing-read "Switch-to: "
> +                    (mapcar 'buffer-name
> +                            (erc-buffer-list
> +                             nil
> +                             (when arg erc-server-process)))
> +                    nil t nil nil
> +                    (when (boundp 'erc-modified-channels-alist)
> +                      (buffer-name (caar (last erc-modified-channels-alist)))))))  

Compared to `C-x b' this loses the ability to obey the
completion-category-overrides setting for buffers (i.e. it won't
default to substring matches).  Also it won't obey
read-buffer-completion-ignore-case.

I suggest you try and use `read-buffer' instead of `completing-read'.
IIUC this will require changes at the C level to add a `predicate'
argument to `read-buffer'.  And I see this will then have to break
backward compatibility since read-buffer-function will end up with
a new argument.

        Stefan