Commit graph

644 commits

Author SHA1 Message Date
Eli Zaretskii
b115c2d5eb ; * lisp/minibuffer.el (completion-pcm--merge-completions): Fix comments. 2024-09-14 12:26:54 +03:00
Spencer Baugh
3cda1fdc3b Correctly include fixed strings before a prefix wildcard in PCM
In 03ac16ece4 I fixed a bug with the
PCM implementation of substring completion, relating to the handling
of PCM wildcards.
However, this fix was incomplete.  This change completes the fix by
also including a fixed string if it appears before a 'prefix'
wildcard, even if 'try-completion' doesn't discover that fixed
string grows to a unique completion.
I discovered this bug while working on enhancements to PCM
completion related to 'completion-pcm-leading-wildcard'.
* lisp/minibuffer.el (completion-pcm--merge-completions): Include
fixed strings before 'prefix wildcard.  (Bug#72819)
* test/lisp/minibuffer-tests.el (completion-substring-test-5): Add a
test for this behavior.
2024-09-14 12:24:08 +03:00
Stefan Monnier
7170282a59 lisp/minibuffer.el (completion--sifn-requote): Fix bug#72176 2024-07-25 08:39:38 -04:00
Eli Zaretskii
96f1db89ee Avoid errors in 'icomplete-vertical-mode'
* lisp/minibuffer.el (completion--hilit-from-re): Avoid signaling
an error if STRING does not match REGEXP.  Fix doc string and
indentation.  (Bug#72176)
2024-07-20 08:58:39 +03:00
john muhl
7093504da2 ; Fix typos (bug#72167)
* lisp/minibuffer.el (completion-auto-deselect): Correct
spelling of "minibuffer".
* lisp/progmodes/peg.el (peg--actions): Correct spelling
of "post-processing".
* lisp/progmodes/php-ts-mode.el: Correct spelling of
"taken".
2024-07-18 08:23:13 +03:00
Eshel Yaron
56537ab022
; (completion-basic-all-completions): Fix recent change
* lisp/minibuffer.el (completion-basic-all-completions): Don't
omit base size.

https://lists.gnu.org/archive/html/emacs-devel/2024-06/msg00235.html
2024-06-13 16:43:41 +02:00
Dmitry Gutov
6b7ff60a5e Highlight the suffix in *Completions* buffer in 'basic' style too
* lisp/minibuffer.el (completion-basic-all-completions):
Make sure to highlight the suffix as well (bug#71419).
2024-06-13 00:46:12 +03:00
Dmitry Gutov
6badb1260a minibuffer-completion-help: Fix earlier mistake
* lisp/minibuffer.el (minibuffer-completion-help): Fix earlier
mistake.  Instead of altering a variable whose value is
immutable (and already captured in a saved list), move the
reference to said list to a lexical binding and alter that
list's second element instead.

https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg00875.html
2024-05-18 16:30:57 +03:00
Dmitry Gutov
2c759b9ce6 completion--replace: Fix completion cycling
* lisp/minibuffer.el (completion--replace):
Don't "insert before markers" after all because in some cases
(https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg00701.html)
- like cycling - BEG can be denoted by a marker as well.
(minibuffer-completion-help): Make FIELD-END simply a fixnum.  And
adjust its value manually inside the local
completion-list-insert-choice-function (bug#48356).
2024-05-12 19:02:36 +03:00
Dmitry Gutov
ff3f17ca3c choose-completion: Retain the suffix after completion boundary
* lisp/minibuffer.el (completion-base-suffix):
Remove as not optimal after all (bug#48356).
(completion--replace): Use insert-before-markers-and-inherit.
(minibuffer-completion-help): Don't set completion-base-affixes,
implement the same logic more optimally by local search and
querying for field boundaries.  Also fix the problem with
completion table, predicate and extra-props being looked up in the
wrong buffer.
(minibuffer-next-completion, minibuffer-choose-completion):
Don't bind completion-use-base-affixes anymore.

* lisp/simple.el (completion-base-affixes)
(completion-use-base-affixes): Remove.
(completion-list-insert-choice-function):
Don't pass them through anymore.
2024-05-09 05:31:10 +03:00
Dmitry Gutov
0284b296f2 minibuffer-completion-help: Fix regression when END < EOB
Which can happen with in-buffer completion (though this scenario
is preffed off by default).

* lisp/minibuffer.el (minibuffer-completion-help): Include the
buffer contents after END into BASE-SUFFIX (bug#48356).
2024-04-11 20:33:16 +03:00
Eli Zaretskii
afc0aa3683 ; * lisp/minibuffer.el (completion-base-suffix): Doc fix (bug#48356). 2024-04-11 09:53:34 +03:00
Dmitry Gutov
0288bc6c94 Generalize the file-name specific workaround in minibuffer-completion-help
* lisp/minibuffer.el (completion-base-suffix):
New function (bug#48356).
(minibuffer-completion-help): Use it here.
(minibuffer-completion-help): Cut off the double completion
boundary when it occurs inside
completion-list-insert-choice-function..
2024-04-11 03:57:09 +03:00
Daniel Mendler
f30801a203 (completion-hilit-commonality): Support completion-lazy-hilit
* lisp/minibuffer.el (completion-hilit-commonality): Support lazy
completion candidate highlighting via `completion-lazy-hilit`.
2024-04-08 22:32:00 -04:00
Juri Linkov
6480de5ea7 ; Use two dashes for internal function minibuffer-visible-completions--bind
* lisp/minibuffer.el (minibuffer-visible-completions--bind):
Rename from minibuffer-visible-completions-bind.
(minibuffer-visible-completions-map): Rename
minibuffer-visible-completions-bind to
minibuffer-visible-completions--bind.
2024-04-05 19:27:45 +03:00
Spencer Baugh
9dcb28d601 With visible-completions, only bind RET when completion is selected
Previously, if minibuffer-visible-completions was non-nil, we bound RET
whenever the *Completions* buffer was visible.  This meant that RET in
completion-in-region would not enter a newline, which is a somewhat
annoying behavior change from minibuffer-visible-completions=nil.

Now, we only bind RET when a completion is selected.  This means
RET will newline in completion-in-region.

So that completion help continues to suggest the correct keys,
we also add minibuffer-visible-completions--always-bind.  When
let-bound to a non-nil value, it makes the
minibuffer-visible-completions binds always active.  We let-bind
it around substitute-command-keys.

* lisp/minibuffer.el (minibuffer-visible-completions--always-bind)
(minibuffer-visible-completions--filter): Add.
(minibuffer-visible-completions-bind): Use
minibuffer-visible-completions--filter.  (bug#68801)
* lisp/simple.el (minibuffer-visible-completions--always-bind)
(completion-setup-function): Let-bind
minibuffer-visible-completions--always-bind so the completion
help is correct.
2024-03-15 09:40:48 +02:00
Mattias Engdegård
3beaa3131e Use obarrayp, not vectorp, to detect obarrays
* lisp/abbrev.el (abbrev--active-tables):
* lisp/mail/mailabbrev.el (mail-abbrevs-setup, build-mail-abbrevs)
(define-mail-abbrev, mail-resolve-all-aliases)
(mail-abbrev-insert-alias):
* lisp/mail/rmail.el (rmail-resend):
* lisp/minibuffer.el (completion-table-with-context):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
(etags--xref-apropos-additional):
Use obarrayp as predicate for obarrays.
2024-02-23 13:02:27 +01:00
Eli Zaretskii
22d500ce21 Merge from origin/emacs-29
7d3a144486 ; Mention defface's and their :version tags in CONTRIBUTE.
09c53b717d * admin/notes/kind-communication: New file.
31ca4e5501 ; And another fix of CONTRIBUTE.
d65499e790 ; Another clarification in CONTRIBUTE.
571ec583d6 ; Clarify "ChangeLog entries" in CONTRIBUTE.
e268231686 Don't skip links to "." and ".." in Dired when marking files
e25d11314d Pass unquoted filename to user-supplied MUSTMATCH predicate
4749699370 * doc/lispref/parsing.texi (Retrieving Nodes): Improve do...
d0673ea0d4 ; * etc/PROBLEMS: Workaround for Windows key "stuck" (bug...

* lisp/emacs-lisp/trace.el:
* java/org/gnu/emacs/EmacsWindow.java (onDragEvent): Remove
training whitespace.
2024-02-10 05:07:56 -05:00
Joseph Turner
e25d11314d Pass unquoted filename to user-supplied MUSTMATCH predicate
* lisp/minibuffer.el (read-file-name-default): Pass REQUIRE-MATCH
argument through substitute-in-file-name.
* lisp/minibuffer.el (read-file-name): Update docstring.

Resolves bug#68815.
2024-02-06 16:05:46 -05:00
Eli Zaretskii
94fc8d5337 Merge from origin/emacs-29
5ce02c91bc Improve `desktop-save-mode` docstring
2f98b13ed0 ; Fix doc strings of splash-screen data structures
77f5d4d523 Fix completing-read functional REQUIRE-MATCH behavior
2024-02-03 06:47:06 -05:00
Eli Zaretskii
98c906e5be ; * lisp/minibuffer.el (minibuffer-visible-completions): Doc fix. 2024-01-29 21:21:50 +02:00
Joseph Turner
77f5d4d523 Fix completing-read functional REQUIRE-MATCH behavior
* lisp/minibuffer.el (completion--complete-and-exit): If
minibuffer-completion-confirm is a function which returns nil,
immediately fail to complete.

See bug#66187.
2024-01-28 14:18:48 -05:00
Juri Linkov
7755f71727 Support :category in completion-extra-properties (bug#68214)
* doc/lispref/minibuf.texi (Completion Variables): Add :category
to the table of completion-extra-properties.

* lisp/minibuffer.el (completion--metadata-get-1): New internal function.
(completion-metadata-get): Use 'completion--metadata-get-1'.
Thanks to Daniel Mendler <mail@daniel-mendler.de>.
(completion-extra-properties): Mention :category in the docstring.

* lisp/calendar/calendar.el (calendar-read-date): Use more
user-friendly let-binding of completion-extra-properties
with :category.
2024-01-10 09:34:47 +02:00
Juri Linkov
aff1d53cd4 Support more metadata properties in completion-extra-properties (bug#68214)
* doc/lispref/minibuf.texi (Completion Variables): Add
to the table of completion-extra-properties new items:
`group-function', `display-sort-function', `cycle-sort-function'.

* lisp/icomplete.el (icomplete--augment): Remove unnecessary
plist-get from completion-extra-properties since now
completion-metadata-get does this.

* lisp/minibuffer.el (completion-metadata-get): Use plist-get to
get prop from completion-extra-properties and cache the keyword.
Thanks to Daniel Mendler <mail@daniel-mendler.de>.
(completion-extra-properties): Mention new properties in docstring.
(minibuffer-completion-help): Remove unnecessary
plist-get from completion-extra-properties since now
completion-metadata-get does this.

* lisp/net/eww.el (eww-switch-to-buffer):
* test/lisp/minibuffer-tests.el (completions-affixation-navigation-test):
Unquote lambda in completion-extra-properties.
2024-01-09 19:57:50 +02:00
Juri Linkov
18de131222 Support more metadata properties in completion-category-overrides (bug#68214)
* doc/lispref/minibuf.texi (Completion Variables): Add
to the table of completion-category-overrides new items:
`cycle-sort-function', `group-function', `annotation-function',
`affixation-function'.

* lisp/minibuffer.el (completion-metadata-get): Try also to get
the property from completion-category-overrides by category.
Suggested by Daniel Mendler <mail@daniel-mendler.de>.
(completion-category-defaults): Add new properties to docstring.
(completion-category-overrides): Add customization for new
properties: `cycle-sort-function', `group-function',
`annotation-function', `affixation-function'.
(completion-metadata-override-get): Remove function.
(minibuffer-completion-help): Replace 'completion-metadata-override-get'
with 'completion-metadata-get' for 'display-sort-function'.
2024-01-07 20:04:06 +02:00
Eli Zaretskii
df505804ab ; Fix documentation of last change
* lisp/minibuffer.el (completion-category-overrides): Doc fix.

* doc/emacs/mini.texi (Completion Options): Update documentation
of 'completions-sort'.
* doc/lispref/minibuf.texi (Completion Variables): Fox wording.
Add a cross-reference to where 'completions-sort' is documented.
2024-01-04 20:47:06 +02:00
Juri Linkov
dc99be8e63 Support display-sort-function in completion-category-overrides (bug#68214)
* doc/lispref/minibuf.texi (Completion Variables):
Add 'display-sort-function' to the table of
'completion-category-overrides'.

* lisp/calendar/calendar.el (calendar-read-date): Add metadata
category 'calendar-month' for completing-read reading a month name.

* lisp/minibuffer.el (completion-category-defaults):
Add 'display-sort-function' with identity for the category 'calendar-month'.
(completion-category-overrides): Add customization for completion sorting
with 'display-sort-function' and a choice like in 'completions-sort'.
(completion-metadata-override-get): New function.
(minibuffer-completion-help): Use 'completion-metadata-override-get'
instead of 'completion-metadata-get' to get sort-fun from
'display-sort-function'.
2024-01-04 19:20:30 +02:00
Po Lu
ecf08f0621 Merge from savannah/emacs-29
dc4e6b1329 ; Update copyright years in more files
64b3777631 ; Run set-copyright from admin.el
8e1c56ae46 ; Add 2024 to copyright years

# Conflicts:
#	doc/misc/modus-themes.org
#	doc/misc/texinfo.tex
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	etc/themes/modus-operandi-theme.el
#	etc/themes/modus-themes.el
#	etc/themes/modus-vivendi-theme.el
#	lib/alloca.in.h
#	lib/binary-io.h
#	lib/c-ctype.h
#	lib/c-strcasecmp.c
#	lib/c-strncasecmp.c
#	lib/careadlinkat.c
#	lib/cloexec.c
#	lib/close-stream.c
#	lib/diffseq.h
#	lib/dup2.c
#	lib/filemode.h
#	lib/fpending.c
#	lib/fpending.h
#	lib/fsusage.c
#	lib/getgroups.c
#	lib/getloadavg.c
#	lib/gettext.h
#	lib/gettime.c
#	lib/gettimeofday.c
#	lib/group-member.c
#	lib/malloc.c
#	lib/md5-stream.c
#	lib/md5.c
#	lib/md5.h
#	lib/memmem.c
#	lib/memrchr.c
#	lib/nanosleep.c
#	lib/save-cwd.h
#	lib/sha1.c
#	lib/sig2str.c
#	lib/stdlib.in.h
#	lib/strtoimax.c
#	lib/strtol.c
#	lib/strtoll.c
#	lib/time_r.c
#	lib/xalloc-oversized.h
#	lisp/auth-source-pass.el
#	lisp/emacs-lisp/lisp-mnt.el
#	lisp/emacs-lisp/timer.el
#	lisp/info-look.el
#	lisp/jit-lock.el
#	lisp/loadhist.el
#	lisp/mail/rmail.el
#	lisp/net/ntlm.el
#	lisp/net/webjump.el
#	lisp/progmodes/asm-mode.el
#	lisp/progmodes/project.el
#	lisp/progmodes/sh-script.el
#	lisp/textmodes/flyspell.el
#	lisp/textmodes/reftex-toc.el
#	lisp/textmodes/reftex.el
#	lisp/textmodes/tex-mode.el
#	lisp/url/url-gw.el
#	m4/alloca.m4
#	m4/clock_time.m4
#	m4/d-type.m4
#	m4/dirent_h.m4
#	m4/dup2.m4
#	m4/euidaccess.m4
#	m4/fchmodat.m4
#	m4/filemode.m4
#	m4/fsusage.m4
#	m4/getgroups.m4
#	m4/getloadavg.m4
#	m4/getrandom.m4
#	m4/gettime.m4
#	m4/gettimeofday.m4
#	m4/gnulib-common.m4
#	m4/group-member.m4
#	m4/inttypes.m4
#	m4/malloc.m4
#	m4/manywarnings.m4
#	m4/mempcpy.m4
#	m4/memrchr.m4
#	m4/mkostemp.m4
#	m4/mktime.m4
#	m4/nproc.m4
#	m4/nstrftime.m4
#	m4/pathmax.m4
#	m4/pipe2.m4
#	m4/pselect.m4
#	m4/pthread_sigmask.m4
#	m4/readlink.m4
#	m4/realloc.m4
#	m4/sig2str.m4
#	m4/ssize_t.m4
#	m4/stat-time.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/stdio_h.m4
#	m4/stdlib_h.m4
#	m4/stpcpy.m4
#	m4/strnlen.m4
#	m4/strtoimax.m4
#	m4/strtoll.m4
#	m4/time_h.m4
#	m4/timegm.m4
#	m4/timer_time.m4
#	m4/timespec.m4
#	m4/unistd_h.m4
#	m4/warnings.m4
#	nt/configure.bat
#	nt/preprep.c
#	test/lisp/register-tests.el
2024-01-02 10:28:14 +08:00
Po Lu
8e1c56ae46 ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
João Távora
c0c79b0b46 Fido-mode: don't error if case-fold-search is globally nil
bug#67884

To prevent errors, the same case-fold-search setting used for
originally selecting the candidate should be used when scoring it.

* lisp/minibuffer.el (completion--flex-score): Fix
2023-12-19 04:07:17 -06:00
Juri Linkov
6abea4d98d Fix typo in commit 3c09314895
* lisp/minibuffer.el (minibuffer-completion-help):
Set t to LOCAL arg of add-hook for after-change-functions.
2023-12-11 19:16:37 +02:00
Stefan Kangas
06a12b0ccc ; Fix typos 2023-12-10 13:22:04 +01:00
Eli Zaretskii
ec1244970a ; Fix documentation of 'minibuffer-sort-by-history'
* etc/NEWS:
* lisp/minibuffer.el (completions-sort): Doc fix.
2023-12-09 11:04:13 +02:00
Eli Zaretskii
643e06dbe5 ; Fix documentation of 'completion-auto-deselect'
* lisp/minibuffer.el (completion-auto-deselect): Doc fix.

* etc/NEWS: Improve wording of corresponding entry.
2023-12-08 10:42:22 +02:00
Po Lu
d8a0087930 Cease preloading touch-screen.el outside X and Android
* lisp/calc/calc.el (touch-screen-display-keyboard):

* lisp/minibuffer.el (clear-minibuffer-message):

* lisp/term.el (touch-screen-display-keyboard): Declare
touch-screen-display-keyboard before binding or setting it.

* lisp/loadup.el: Don't autoload touch-screen.el outside X and
Android.

* lisp/touch-screen.el: Autoload functions called from commands
responding to touch screen events.
2023-12-06 10:34:41 +08:00
Spencer Baugh
e33f560bad Add historical option to completions-sort
Support sorting candidates in *Completions* by the order they show up
in the minibuffer history.

Also add minibuffer-sort-alphabetically and
minibuffer-sort-by-history, which are usable for both completions-sort
and display-sort-function.

* lisp/minibuffer.el (completions-sort): Document 'historical option.
(minibuffer-completion-help): Support 'historical option.
(minibuffer-sort-alphabetically)
(minibuffer-completion-base, minibuffer-sort-by-history): Add.
* etc/NEWS: Announce it.
2023-12-03 19:24:16 +02:00
Spencer Baugh
3c09314895 Deselect the selected completion candidate when typing
minibuffer-choose-completion-or-exit submits the selected completion
candidate, if any, ignoring the contents of the minibuffer.  But a
user might select a completion candidate and then want to type
something else in the minibuffer and submit what they typed.

Now typing will automatically deselect the selected completion
candidate so that minibuffer-choose-completion-or-exit will not choose
it.

minibuffer-choose-completion has the same behavior as before, and is
not affected by the deselection.

* lisp/minibuffer.el (completion-auto-deselect, completions--deselect)
(completions--after-change): Add.
(minibuffer-completion-help): Add completions--after-change hook.
(minibuffer-next-completion): Bind completion-auto-deselect to nil to
avoid immediately deselecting the completion.
(minibuffer-choose-completion-or-exit): Bind
choose-completion-deselect-if-after so deselection takes effect.
(display-completion-list): Guarantee a newline at the beginning of
*Completions* to avoid ambiguity about candidate selection.
* lisp/simple.el (choose-completion-deselect-if-after): Add.
(choose-completion): Check choose-completion-deselect-if-after.
* etc/NEWS: Announce.
2023-12-03 19:20:51 +02:00
Jim Porter
16ac377aab Forward completion text properties in 'completion-table-with-quoting'
This fixes an issue with 'pcomplete-here-using-help', which passes
annotation strings along as text properties.  Previously, those got
clobbered when the completions got requoted (bug#67112).

* lisp/minibuffer.el (completion--twq-all): Apply text properties from
the first character of the unquoted completion to the quoted
completion.
2023-11-19 15:11:40 -08:00
Spencer Baugh
d8c1ac6c35 Return t from completion-emacs22-try-completion only for completions
The emacs22 completion style ignores the text after point when
computing completions.  However, it still needs to take into account
the entire string it's given, to avoid returning incorrect values.

Previously, completion-emacs22-try-completion would return t if the
text before point was an exact completion.  But this is effectively
saying that the entire input string was an exact completion, which may
not be correct.  This would cause completing-read with REQUIRE-MATCH=t
to return a non-completion.

Now, completion-emacs22-try-completion only returns t if the entire
input string is an exact completion.

* lisp/minibuffer.el (completion-emacs22-try-completion): Return t
only if the entire input string is an exact completion.  (Bug#67210)
2023-11-17 12:34:23 -05:00
Juri Linkov
94763aa521 Enable completion-in-region-mode in minibuffer-complete-history/defaults
* lisp/minibuffer.el (minibuffer-complete-history)
(minibuffer-complete-defaults): Let-bind completion-in-region-mode-predicate
to lambda that checks if the "*Completions*" buffer window is visible.
This enables completion-in-region-mode that supports arrows
with minibuffer-visible-completions.
2023-11-15 19:44:04 +02:00
Juri Linkov
579ea5f6e2 * lisp/minibuffer.el (minibuffer-completion-help): Fix base-suffix for region.
When used with completion-in-region where completion-in-region-mode-predicate
is non-nil, start base-suffix from point (bug#62700).
2023-11-15 19:37:30 +02:00
João Távora
fff9b6e37a Fix test failures in test/lisp/minibuffer-tests.el
bug#48841, bug#47711

In some instances the test code needed to be updated to make different
assumptions about implementation details.

In others, like the ones about the completions-first-difference face,
minor parts of the actual user-visible behaviour were broken.

* test/lisp/minibuffer-tests.el (completion-test1): Robustify test.
(completion--pcm-score): Don't assume completion-score is stored
in string as a property.

* lisp/minibuffer.el (completion--hilit-from-re): Take new parameter.
(completion-pcm--hilit-commonality): Use it.
2023-11-11 16:13:52 +00:00
Juri Linkov
978ebe8a19 * lisp/minibuffer.el (minibuffer-choose-completion-or-exit): Improve.
Use minibuffer-complete-and-exit instead of exit-minibuffer
since this is what it's used in the completion minibuffer.
2023-11-09 18:24:48 +02:00
Eshel Yaron
5416896d60 Promptly disable 'completion-in-region-mode' (bug#67001)
Avoid keeping 'completion-in-region-mode' on when exiting
'completion--in-region-1' if the *Completions* buffer isn't shown.
Otherwise, the bindings from 'completion-in-region-mode-map' linger,
notable shadowing other bindings for TAB.

* lisp/minibuffer.el (completion--in-region-1): Disable
'completion-in-region-mode' if the *Completions* buffer isn't visible.
2023-11-09 09:40:54 +02:00
Juri Linkov
01912a0679 * lisp/minibuffer.el (minibuffer-choose-completion-or-exit): New command.
(minibuffer-visible-completions-map): Bind it to "RET".
https://lists.gnu.org/archive/html/emacs-devel/2023-11/msg00246.html
2023-11-08 09:38:35 +02:00
Eli Zaretskii
361f9fe415 ; * lisp/minibuffer.el (completion-lazy-hilit-fn): Fix last change. 2023-11-07 16:31:40 +02:00
Eli Zaretskii
14f0b6331d ; Minor documentation fixes
* etc/NEWS:
* lisp/minibuffer.el (completion-lazy-hilit)
(completion-lazy-hilit-fn, completion-lazy-hilit): Fix recently
added documentation.
2023-11-07 16:29:06 +02:00
João Távora
dfffb91a70 Allow completion frontends to fontify candidates just-in-time
bug#48841, bug#47711

The variable may be bound by the frontend to a non-nil around
completion-producing calls like completion-all-completions.  See
completion-lazy-hilit docstring for more info.

* lisp/icomplete.el (icomplete-minibuffer-setup): Set completion-lazy-hilit.
(icomplete--render-vertical): Call completion-lazy-hilit.
(icomplete-completions): Call completion-lazy-hilit.

* lisp/minibuffer.el (completion-lazy-hilit): New variable.
(completion-lazy-hilit): New function.
(completion-lazy-hilit-fn): New variable.
(completion-pcm--regexp)
(completion--flex-score-last-md): New helper variables.
(completion--flex-score-1): New helper.
(completion-pcm--hilit-commonality): Use completion-lazy-hilit.
(completion--flex-adjust-metadata): Rework sorting code.

* etc/NEWS: Mention completion-lazy-hilit
2023-11-06 10:13:02 -06:00
Juri Linkov
f0c0ff6bf2 New option to use arrows in the minibuffer to select completions (bug#59486)
* lisp/minibuffer.el (minibuffer-visible-completions): New defcustom.
(minibuffer-visible-completions-bind): New function.
(minibuffer-visible-completions-map): New defvar-keymap.
(minibuffer-mode): Set buffer-local minibuffer-completion-auto-choose
to nil for minibuffer-visible-completions.
(completing-read-default, completion-in-region-mode):
Use minibuffer-visible-completions to compose keymap
with minibuffer-visible-completions-map.
(minibuffer-next-completion): Add new arg VERTICAL,
and use next-line-completion.
(minibuffer-next-line-completion)
(minibuffer-previous-line-completion): New commands.
2023-11-05 19:52:33 +02:00
Mattias Engdegård
e95d8562c0 Translate backslash-saturated regexp to rx
* lisp/minibuffer.el (minibuffer--regexp-propertize):
The original regexp had 83 backslashes in 147 characters which may be
some kind of record.  This transformation cuts it down to 6, and the
generated regexp string is about 14 % shorter.
2023-09-07 18:20:16 +02:00