emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Handle case where `beg` and `end` are strings instead of mar


From: Juri Linkov
Subject: Re: [PATCH] Handle case where `beg` and `end` are strings instead of markers
Date: Thu, 05 May 2022 21:19:51 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>>> Maybe instead of strings, they should be functions, so CRM can set them
>>> to functions that first look for the separator and then search for some
>>> leading/trailing string?
>> Then while creating the *Completions* list it could return a lambda
>> to be called later after selecting one of the options.
>
> That's the idea, yes.

I tried to do this, but stumbled upon the need to split this progn
to two lambdas: `(insert choice)` should go to the first lambda
that inserts the prefix, or to the second lambda that inserts the suffix?

  (setq-local completion-base-affixes
              (list base-prefix base-suffix))
  (setq-local completion-list-insert-choice-function
       (lambda (start end choice)
         (if (and (stringp start) (stringp end))
             (progn
               (delete-minibuffer-contents)
               (insert start)
               (insert choice)
               (insert end))
   ...



reply via email to

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