From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71716: [PATCH] Add new completion-preview-insert-{word, sexp} commands Date: Sun, 23 Jun 2024 10:00:24 +0200 Message-ID: References: <87a5jd8hqh.fsf@gmail.com> <877ceg9546.fsf@gmail.com> <874j9k8wpo.fsf@gmail.com> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20551"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 71716@debbugs.gnu.org To: Jules Tamagnan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 23 10:01:21 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sLIA5-0005A3-PS for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 23 Jun 2024 10:01:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLI9o-000628-KX; Sun, 23 Jun 2024 04:01:04 -0400 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 1sLI9n-000620-Uw for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2024 04:01:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLI9m-0000Ko-GX for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2024 04:01:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sLI9m-00060n-I9 for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2024 04:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Jun 2024 08:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71716 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 71716-submit@debbugs.gnu.org id=B71716.171912962923037 (code B ref 71716); Sun, 23 Jun 2024 08:01:02 +0000 Original-Received: (at 71716) by debbugs.gnu.org; 23 Jun 2024 08:00:29 +0000 Original-Received: from localhost ([127.0.0.1]:49018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLI9E-0005zU-WA for submit@debbugs.gnu.org; Sun, 23 Jun 2024 04:00:29 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:41044 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLI9D-0005zM-NC for 71716@debbugs.gnu.org; Sun, 23 Jun 2024 04:00:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1719129626; bh=rZKXfPz7EIcJC6OZOfKFT7rt1nfnijg8L2/mIErw9D0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=E1m6LcNdmTZ3WoN5JKFLulgw7NXPWt1Nrx7zwXRY8Hp6192OJjibqX/JKYvow240x Rn4bC4Nttaq8Xe3bBNs03nQyW7tVAV9wUSfybdg4n0uFsQrc2y50mIeD53y/vZ/uxj M/BWFctaddbEqD+5V6OIOmwm6dpIlt7y0Mggr3KTovonidZz6ldEYkd/fdNeu2ooDl 6N3e5NBwvVaA5SOSn9L5/Ot4OfLDrrZ62pHYW6ZUhVeF6l9KNbJfR9WQgGRTRqWN6v PnvGlX0IP6hO+GWhQJ4K53LLKb8zScVP5a8Rf3EHtPhwmrgLcdJiM7RWwJX/xhAZa1 KojShScM9rpEg== In-Reply-To: <874j9k8wpo.fsf@gmail.com> (Jules Tamagnan's message of "Sat, 22 Jun 2024 15:00:03 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287767 Archived-At: Hi Jules, Jules Tamagnan writes: > Eshel Yaron writes: > >> 2. The temporary buffer where the motion command is executed has a >> different major mode than the original buffer, so they might have >> different notions of words/sexps. > > I was thinking about that when implementing this, even further one could > have locally changed the value of `find-word-boundary-function-table` > outside of `subword-mode`. Right. And when considering sexps, forward-sexp-function can come into play, which might take into account all sorts of buffer-local variables. > One idea I had thought of was inserting the complete after-string and > performing character deletions until the suffix was removed but this > felt like an even worse solution. I think that might be the way to go, actually. Placing the after-string insertion and subsequent deletion in an atomic change group (and using undo-amalgamate-change-group to let the user undo everything in one go) should hopefully work just as well, and that would alleviate the need to chase down and replicate complex buffer state in the temporary buffer. Jules Tamagnan writes: > I've further tweaked the code to address the second point of feedback. Thanks! > Looking at it now it seems a bit uglier for the "standard" insert case > so I'd be willing to revert that consolidation. I think that'd be best, yes. Let's keep completion-preview-insert intact for the time being and see if we there's room for cleanly consolidating it with the new commands after we get them right. > Overall it seems to work well both in unit tests and in my personal > testing. > > In the last message I attached a patch with only my second commit. This > new patch contains of all 3 commits: I'll give it a try, thanks. In the future if you could squash all changes to a single patch I think that'd make it easiest to review. Best, Eshel