Subject: Re: bug#67527: 30.0.50; FR: Add an option to disable ispell completion in text-mode

From: Eshel Yaron <[email-masked]>
Date: Thu, 30 Nov 2023 10:01:06 +0100

Eason Huang <[email-masked]> writes:

> Eshel Yaron <[email-masked]> writes:
>
>> Eason Huang <[email-masked]> writes:
>>
>>> Eshel Yaron <[email-masked]> writes:
>>>
>>>> ...I'm not sure another user option is due here.  I think your
>>>> workaround is fine, if that works for you, of course.  But you could
>>>> just as well say `(setq-local corfu-auto nil)` in that hook, no?
>>>
>>> No. I need (setq-local corfu-auto t) on org-buffer
>>
>> Sure, and you can do that.  Again, whatever solution works best for
>> you.  I just highlighted that the behavior that you want to avoid
>> seems to be a consequence of a global setting that you don't in fact
>> want to apply it in all buffers.  Makes sense?
>
> Maybe I don't make myself clear!
>

I do understand, I believe.  I'm sorry if I gave you a different impression.

> 2. It's not a good idear to add `ispell-completion-at-point` to
> `completion-at-point-functions` by default.

Here I, respectfully, disagree.  I understand that this has an unwelcome
effect for your particular setup, but I think that that's because this
setup made a brittle assumption about an undocumented and incidental
property of `text-mode` (the property of not providing any capfs).

> 3. Anyway, I can use the below code to rollback to the behavior before
> the commit.
>
> ```
> (add-hook 'text-mode-hook
>           (lambda ()
>             (remove-hook 'completion-at-point-functions
>             'ispell-completion-at-point t)))
> ```

Indeed, it's easy enough to adapt if you happen not to like this capf.
Which is why I don't think a dedicated user option is in order.
Regarding this specific way of adapting, my suggestion was instead to go
with something that still allows you to use word completion in text
buffers, but that's just a friendly suggestion, and maybe you simply
don't need word completion at all.

> If you decide that no need to add an option to prevent adding
> `ispell-completion-at-point` to completion-at-point-functions by
> default, feel free to closed this bug report (It's not a bug, I just
> want to provide some advice from a user view).

I appreciate your advice and your valuable user perspective.  As I
mentioned earlier, I think that such a user option would be redundant.
I wonder how others feel about this, though.

Cheers,

Eshel