How to disable helm for files/directories

83 views
Skip to first unread message

Nikolaus Rath

unread,
Jan 7, 2017, 12:18:06 AM1/7/17
to emacs...@googlegroups.com
Hello,

Is there a way to disable helm for file (or directory) prompts (e.g. the
one that comes upwhen calling magit-status outside a Git repository)?

I have enabled generic helm completion, but I am also a little confused
by the current behavior because it seems that only *some* prompts are
taken over by helm. For example, find-file-read-only gives me a helm
prompty, but find-file does not - even though neither function is
included in helm-completing-read-handlers-alist...


Best,
-Nikolaus
--
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

»Time flies like an arrow, fruit flies like a Banana.«

Thierry Volpiatto

unread,
Jan 7, 2017, 2:23:21 AM1/7/17
to emacs...@googlegroups.com

Nikolaus Rath <Niko...@rath.org> writes:

> Hello,
>
> Is there a way to disable helm for file (or directory) prompts (e.g. the
> one that comes upwhen calling magit-status outside a Git repository)?
>
> I have enabled generic helm completion, but I am also a little confused
> by the current behavior because it seems that only *some* prompts are
> taken over by helm. For example, find-file-read-only gives me a helm
> prompty, but find-file does not - even though neither function is
> included in helm-completing-read-handlers-alist...

Read the docstring of `helm-completing-read-handlers-alist`, e.g to
disable helm completion from `find-file-read-only` add an entry like
this: (find-file-read-only . nil), or just (find-file-read-only).

--
Thierry

Nikolaus Rath

unread,
Jan 7, 2017, 3:44:03 PM1/7/17
to emacs...@googlegroups.com
On Jan 07 2017, Thierry Volpiatto <thierry.volpiatto-Re...@public.gmane.org> wrote:
I did. But why is find-file not using helm despite not being listed in
helm-completing-read-handlers-alist? And what functions do I have to put
into this variable in order to catch *all* file/directory prompts
(in particular the one from magit-status)?

Thierry Volpiatto

unread,
Jan 7, 2017, 4:02:25 PM1/7/17
to emacs...@googlegroups.com

Nikolaus Rath <Niko...@rath.org> writes:

> I did. But why is find-file not using helm despite not being listed in
> helm-completing-read-handlers-alist?

It is in helm-completing-read-handlers-alist, look carefully.

> And what functions do I have to put into this variable in order to
> catch *all* file/directory prompts (in particular the one from
> magit-status)?

You can't catch all functions using read-file-name, just add them one by
one once you are annoyed.

--
Thierry

Nikolaus Rath

unread,
Jan 7, 2017, 4:22:16 PM1/7/17
to emacs...@googlegroups.com
On Jan 07 2017, Thierry Volpiatto <thierry.volpiatto-Re...@public.gmane.org> wrote:
> Nikolaus Rath <Nikolaus-B...@public.gmane.org> writes:
>
>> I did. But why is find-file not using helm despite not being listed in
>> helm-completing-read-handlers-alist?
>
> It is in helm-completing-read-handlers-alist, look carefully.

Ok, sorry, wrong question. What I meant is: why is find-file-read-only
using Helm, despite *not* being in that alist?

>> And what functions do I have to put into this variable in order to
>> catch *all* file/directory prompts (in particular the one from
>> magit-status)?
>
> You can't catch all functions using read-file-name, just add them one by
> one once you are annoyed.

Args, ok.

Thierry Volpiatto

unread,
Jan 8, 2017, 1:29:30 AM1/8/17
to emacs...@googlegroups.com

Nikolaus Rath <Niko...@rath.org> writes:

> Ok, sorry, wrong question. What I meant is: why is find-file-read-only
> using Helm, despite *not* being in that alist?

Once `helm-mode` is activated, all functions that have a `read-file-name`,
`completing-read` etc... will use helm as completion unless they are
in `helm-completing-read-handlers-alist` with a nil entry.
They can have other values, you can try for example (find-file . ido),
in this case ido will be used for `find-file` and nothing else.
They can use also another helm function than the one provided by
default, recently I have been asked for a file completion with history
for mu4e and I provided `helm-read-file-name-handler-1` to add to
`mu4e-view-save-attachment-single`.
So `find-file-read-only` will use helm as long as `helm-mode` is activated
and it is not deactivated in `helm-completing-read-handlers-alist`.

--
Thierry
Reply all
Reply to author
Forward
0 new messages