From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron Newsgroups: gmane.emacs.devel Subject: Re: Word completion in text modes Date: Sat, 18 Nov 2023 14:21:30 +0100 Message-ID: References: <83h6ljme0j.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4115"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 18 14:22:18 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 1r4LH8-0000qK-CS for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Nov 2023 14:22:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4LGb-00027H-Vd; Sat, 18 Nov 2023 08:21:45 -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 1r4LGZ-00026z-Fz for emacs-devel@gnu.org; Sat, 18 Nov 2023 08:21:43 -0500 Original-Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4LGS-0006aK-1L; Sat, 18 Nov 2023 08:21:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1700313693; bh=NsiRwiEZOvGADn+UCv9lwKl8iaIow9JCOoK/083dFIU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=HruheerNQxrssZ/L/iiE1ljBooAg0j2Y4HGzux5F7AGSIdhvdj2qMN2U3B6eRI2mo BxXuZaR22mN0a1tv9M/FRbW/jSSwoHbaN+mfhOn5epDue8ePsLRjCzGjVzUOiCxgYY BWQBjmN9U05cFDSnzGiz/M73s22cODtGBGaYiPyX6BvkGehfGT/YCcnWANeb7rg9cY i9qd2YLJd/KI7LUUm2wI7uwYB0N0yoiF6hmpFygZ0mAf2CDGhXJ/z/C1+c+VnLNAEv 74WmIbzPL1DYNJbHCsi5NtJ5f8IS8HX4+TP7DUfARwT289N6uhjp3q5viAR1iaNFPS OXCF3i0c09xuQ== In-Reply-To: <83h6ljme0j.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 18 Nov 2023 14:39:40 +0200") Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:312906 Archived-At: Eli Zaretskii writes: >> From: Eshel Yaron >> Date: Sat, 18 Nov 2023 13:03:36 +0100 >>=20 >> 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. >>=20 >> I can see several advantages to making such a change: >>=20 >> 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 wel= l. >> 3. Emacs would be slightly more consistent and simple all in all. >>=20 >> 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? It _is_ bound to `C-M-i` in `text-mode`, that's actually even mentioned in several places in the Emacs manual, e.g. in "(emacs) Text Mode": Text mode binds =E2=80=98M-=E2=80=99 to =E2=80=98ispell-complete-w= ord=E2=80=99. > In any case, would the text-mode completion-at-point support the > dictionaries used currently by ispell-complete-word? If not, why not? Yes, in my current implementation `ispell-completion-at-point` reuses the same dictionaries as `ispell-complete-word`. > 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. I agree, that'd be great. > 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. My proposal would benefit this aim as well, I think, as we could simply add another completion function to `completion-at-point-functions`, say `phrase-completion-at-point`, and users would have their word completion extended to include such phrase completion with no further setup. > 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? See above. My concern here regards users that are used to pressing `C-M-i` in `text-mode` and friends, and getting `ispell-complete-word`. If we follow my suggestion of removing this binding, `C-M-i` would invoke `completion-at-point`, providing similar functionality but with a different interface (by default that would be the *Completions* buffer, instead of the *Choices* buffer that `ispell-complete-word` provides). Does that make sense? > I'd like to understand this better before we decide that this change > should be installed, and how the modified completion will work. > > Thanks.