[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Questions about the `completing-read-function' interface
From: |
Stefan Monnier |
Subject: |
Re: Questions about the `completing-read-function' interface |
Date: |
Fri, 17 Apr 2015 14:04:13 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
>> M-x ivy-mode RET
>> M-x helm-mode RET
>> M-x ivy-mode RET
>>
>> You should now have helm-mode active and working properly, yet with your
>> current code, helm-mode will be "enabled by inactive". If you use
>> add/remove-function this case will be handled correctly.
> I meant to give an example of how `add-function' helps here.
That's exactly what the example does, AFAIK.
> Also, with your sequence of commands, starting from nothing, we have
> ivy-mode set to "t" and having the `completing-read-function'
No, the idea of this example is that after the second line ivy-mode is
still t but completing-read-function is now set to use the helm version.
After the 3rd line, with `setq' completing-read-function would be reset
to the default value, whereas with remove-function
completing-read-function would still continue using the helm version.
> I've also seen this type of code: ido-vertical-mode stores the variable
> `ido-decorations' of ido-mode and modifies it. When you turn off
> ido-vertical-mode, it restores `ido-decorations'. But what if other
> code has changed `ido-decorations' in the meantime, while
> ido-vertical-mode is still on? Any way you put it, the result is
> incorrect. Unless there's a robust system behind it all that manages the
> `ido-decorations' variable.
That's exactly what add-function aims to solve.
Stefan