From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Word completion in text modes Date: Sat, 18 Nov 2023 14:39:40 +0200 Message-ID: <83h6ljme0j.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12041"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eshel Yaron Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 18 13:40:52 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r4Kcy-0002iJ-Up for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Nov 2023 13:40:48 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4Kc3-0007fA-9f; Sat, 18 Nov 2023 07:39:51 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4Kbz-0007ep-6E for emacs-devel@gnu.org; Sat, 18 Nov 2023 07:39:48 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4Kby-0006lR-Eb; Sat, 18 Nov 2023 07:39:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=HW0V8B6+kroYykkblasn+yaFVyM8iTpMQrRV8eR1Xzg=; b=VgQSPfoE6tcQ ue/YdKzoYcK3FHHJc/E0LjxKhu5Vi3Abav96Hrbbu0qGdvnfW4cwqKtOhcTy54VpRcv+ccd4eK58h 6nyXv4JH37VM/UAC5sQUcbMDmkqjp7P8n4dSDKXtV1yRCE/Ro0sbIKwIH8JAji61rMxzI4MyuMtEm bQeNs27qLA6P0vMARb3WKHEA1rsy5nGhmbgh3MbLonO2DCf9bLldw7uN3gp4aap/1ZjJuz038kZyT y0q2CLdwKNEWOI9T3Fsb0Jz9cCumJra099ySa1ERfpY9PycqrdSEkJVivTVRKXbewV0p/prnJnGSA CmYLbeR0ZshIb+cNI8S1xA==; In-Reply-To: (message from Eshel Yaron on Sat, 18 Nov 2023 13:03:36 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:312903 Archived-At: > From: Eshel Yaron > 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.