emacs-devel
[Top][All Lists]
Advanced

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

Re: History completion


From: Juri Linkov
Subject: Re: History completion
Date: Thu, 09 Dec 2021 19:18:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>> #+begin_src emacs-lisp
>> ;; Adapted from ‘minibuffer-complete’:
>> (defun minibuffer-complete-history ()
>>    (interactive)
>>    (completion-in-region (minibuffer--completion-prompt-end) (point-max)
>>                          (symbol-value minibuffer-history-variable)
>>                          nil))
>> (define-key minibuffer-local-map [C-tab] 'minibuffer-complete-history)
>> #+end_src
>
> FWIW, I am trying this and I find it very helpful. Thank you for sharing.

One problem is that I can't find a suitable completion style for this
that would match on substrings, e.g. "pu re" to match "git pull --rebase".
The style ‘flex’ is too lax and matches characters anywhere.
The style ‘substring’ is the closest, but it requires moving point
to the middle of the string.  Maybe a new style ‘substrings’ is needed
that would match words separated by space as substrings.  Also maybe
another style ‘initial-substrings’ that does the same, but only
matches word beginnings.



reply via email to

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