emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Word completion in text modes


From: Eli Zaretskii
Subject: Re: Word completion in text modes
Date: Sat, 18 Nov 2023 14:39:40 +0200

> From: Eshel Yaron <me@eshelyaron.com>
> Date: Sat, 18 Nov 2023 13:03:36 +0100
> 
> I wonder how people here feel about updating `text-mode` to have it (and
> its derivatives) use `completion-at-point` for word completion instead
> of `ispell-complete-word`.  That'd be accompanied by a new
> `ispell-completion-at-point` function that `text-mode` adds to
> `completion-at-point-functions` so word completion still works OOTB,
> just using a different interface.
> 
> I can see several advantages to making such a change:
> 
> 1. Word completion would benefit from UI customizations and
>    other enhancements that users have in place for `completion-at-point`.
> 2. `completion-preview-mode` and any other feature that leverages
>    `completion-at-point-functions` would work for word completion as well.
> 3. Emacs would be slightly more consistent and simple all in all.
> 
> The main downside of this idea is that people who prefer the interface
> that `ispell-complete-word` provides would need to rebind it to `C-M-i`
> or some other key themselves.  Since this command has been around for a
> very long time, I can imagine that some users may have grown fond of it.

I don't understand why users of ispell-complete-word would need to
rebind the command.  ispell-complete-word is by default not bound to
any key, so if we still provide ispell-complete-word, the old binding,
if there was one, should still work, and the only difference should be
the implementation details?  Or what did I miss?

In any case, would the text-mode completion-at-point support the
dictionaries used currently by ispell-complete-word?  If not, why not?

Btw, a really great addition to text-mode would be to have completion
that is based not only on dictionaries that suggest single words, but
also on dictionaries or other databases that suggest phrases based on
context.  IMNSHO, such a feature would be much more important and
useful than the minor changes of UI and reshuffling of the
implementation details of the sort that you propose.  Other
applications start offering this kind of features, so I think Emacs
should have it as well, as we are, after all, a text editor.  That is
not to say that what you suggest is unwelcome or something, just that
such internal cleanups are maybe not yet the most important and useful
change in developing and enhancing text-based modes, at least IMO.

> So I have a WIP patch that adds `ispell-completion-at-point` (similar to
> the one proposed in Bug#52743, but slightly enhanced) and updates
> `text-mode` to use it.  If that sounds sensible and people are not that
> attached to the `ispell-complete-word` interface for word completion,
> I'll add some documentation updates and submit that patch for review.

How would being "attached to the `ispell-complete-word` interface for
word completion" get in the way?  I'd like to understand this better
before we decide that this change should be installed, and how the
modified completion will work.

Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]