unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Jules Tamagnan <jtamagnan@gmail.com>
Cc: 71716@debbugs.gnu.org
Subject: bug#71716: [PATCH] Add new completion-preview-insert-{word, sexp} commands
Date: Wed, 26 Jun 2024 13:41:32 +0200	[thread overview]
Message-ID: <m15xtwdj83.fsf@dazzs-mbp.home> (raw)
In-Reply-To: <87bk3q5ki8.fsf@gmail.com> (Jules Tamagnan's message of "Mon, 24 Jun 2024 10:16:31 -0700")

Hi Jules,

Jules Tamagnan <jtamagnan@gmail.com> writes:

> Eshel Yaron <me@eshelyaron.com> writes:
>
>> One important point is that I'm a bit hesitant about adding the sexp
>> variant, rather then defining only completion-preview-insert-word, and
>> mentioning in the documentation that other variants are trivial to
>> define (and how).  The reason is that I don't have a good idea of when
>> a completion candidate would span multiple sexps (if you have such an
>> example, please share it), so I'm not sure how much utility this
>> command would bring in practice.
>
> The use case that I have for the sexp variant is when completing eshell
> history. Both because: parts of shell commands such as file names can be
> considered sexp's, but also because eshell itself can interpret "full"
> elisp forms.

Thanks, I tried it out with cape-history from cape.el and I can see how
it may be useful for such use cases.

[...]
> Another idea would be to turn `c-p-partial-insert` into a macro that
> uses the `interactive-form` function to generate a sensible
> insert-partial function. I'm more than happy to take this tweak on as
> well.

That may be a nice addition.  In particular we could have a macro that
defines a partial insertion command, and takes care of setting the
completion-predicate of the defined command such that it's only
available when the completion preview is active.

[...]
> From 74d8efceaf8f64f7cf61e36f8a5e8a4fc86e558d Mon Sep 17 00:00:00 2001
> From: Jules Tamagnan <jtamagnan@gmail.com>
> Date: Mon, 24 Jun 2024 08:53:23 -0700
> Subject: [PATCH] Add new completion-preview-insert-{word,sexp} commands

Thank you, pushed to master as commit b3017e7c252, after some tweaks to
the commit message.  I've also pushed a follow up commit (9cb2a204088)
with some minor refinements, see the commit message for details.  One
notable change is that completion-preview-partial-insert does not force
point to the position of the preview overlay ("end") before calling the
motion function.  This makes completion-preview-insert-word behave more
like forward-word when point is in the middle of a multi-word symbol,
with the completion preview at the end of that symbol.  I've added
another test case that demonstrates this behavior.

Could you please give it a try to make sure that everything still works
as you expect?


Thanks,

Eshel





  reply	other threads:[~2024-06-26 11:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-22  9:11 bug#71716: [PATCH] Add new completion-preview-insert-{word, sexp} commands Jules Tamagnan
2024-06-22 14:05 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-22 18:58   ` Jules Tamagnan
2024-06-22 22:00     ` Jules Tamagnan
2024-06-23  8:00       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-23 22:08         ` Jules Tamagnan
2024-06-24  0:45           ` Jules Tamagnan
2024-06-24 11:49           ` Eli Zaretskii
2024-06-24 18:11             ` Jules Tamagnan
2024-06-24 12:43           ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-24 17:16             ` Jules Tamagnan
2024-06-26 11:41               ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-06-28  5:49                 ` Jules Tamagnan
2024-06-28 15:00                   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-27  6:33               ` Juri Linkov
2024-06-27 18:31                 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m15xtwdj83.fsf@dazzs-mbp.home \
    --to=bug-gnu-emacs@gnu.org \
    --cc=71716@debbugs.gnu.org \
    --cc=jtamagnan@gmail.com \
    --cc=me@eshelyaron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).