1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-25 06:50:46 -08:00
Commit graph

524 commits

Author SHA1 Message Date
Juri Linkov
10c675b960 * lisp/comint.el (comint-dynamic-list-input-ring): Keep replaced text props.
* lisp/minibuffer.el (completions-header-format): Remove unused	text prop.
2022-04-13 20:56:34 +03:00
Juri Linkov
67505e0355 * lisp/minibuffer.el (minibuffer-completion-auto-choose): New defcustom.
(minibuffer-choose-previous-completion)
(minibuffer-choose-next-completion): Remove commands.
(minibuffer-local-completion-map): Remove keybindings of
minibuffer-choose-next-completion and minibuffer-choose-previous-completion.
Use them for minibuffer-next-completion and minibuffer-previous-completion.
* lisp/simple.el (minibuffer-local-shell-command-map): Idem.
2022-04-11 19:52:47 +03:00
Juri Linkov
735b451910 Allow non-interactive uses of minibuffer-next-completion
* lisp/minibuffer.el (minibuffer-previous-completion)
(minibuffer-next-completion): Use 1 for n by default.
2022-04-10 10:37:55 +03:00
Juri Linkov
575c3beb4c Allow completion wrapping in minibuffer completion navigation commands
* lisp/minibuffer.el (minibuffer-previous-completion)
(minibuffer-next-completion): Don't set completion-wrap-movement.
2022-04-05 23:08:48 +03:00
Juri Linkov
4e2c70272f New commands for navigating completions from the minibuffer.
* lisp/simple.el (minibuffer-local-shell-command-map):
* lisp/minibuffer.el (minibuffer-local-completion-map):
Bind "M-<up>" to minibuffer-choose-previous-completion,
"M-<down>" to minibuffer-choose-next-completion,
"M-S-<up>" to minibuffer-previous-completion,
"M-S-<down>" to minibuffer-next-completion,
"M-RET" to minibuffer-choose-completion.
(with-minibuffer-completions-window): New macro.
(minibuffer-previous-completion, minibuffer-next-completion)
(minibuffer-choose-previous-completion)
(minibuffer-choose-next-completion)
(minibuffer-choose-completion): New commands.

https://lists.gnu.org/archive/html/emacs-devel/2022-03/msg00335.html
2022-04-05 22:20:16 +03:00
Juri Linkov
7aaffe25eb Use base prefix and suffix instead of completion-base-position (bug#49931)
* lisp/minibuffer.el (minibuffer-completion-help):
Set completion-base-affixes from base-prefix and base-suffix.
In completion-list-insert-choice-function handle
string values of start/end as prefix/suffix.

* lisp/simple.el (completion-base-affixes)
(completion-use-base-affixes): New variables.
(choose-completion): Let-bind base-affixes to completion-base-affixes.
Use base-affixes when completion-use-base-affixes is non-nil.
(completion-setup-function): Sync values of base-affixes and
completion-base-affixes.
2022-04-05 21:54:11 +03:00
Jimmy Aguilar Mena
91ca41e292 Fix some details in completions
* lisp/minibuffer.el (completion--insert-one-column) : Remove the extra
new-line at the end.
* lisp/simple.el (next-completion) : Fix behavior when
completion-wrap-movement and remove bobp and eobp. This removes the
extra tab ad the end of the list before wrapping or going to the
minibuffer and apparently also fixes bug#54374
(switch-to-completions) : Simplify condition code and remove comment not
applicable anymore.
2022-04-05 13:52:53 +02:00
Juri Linkov
71aec1d044 Small fixes for the new feature 'second-tab' of 'completion-auto-select'
* lisp/simple.el (completion-auto-select): Extend the docstring.
2022-03-24 19:54:14 +02:00
Jimmy Aguilar Mena
3a349ff648 Add completion-auto-select second-tab value.
* lisp/minibuffer.el (completion--in-region-1) : Change if with cond and
check if completion-auto-select.
* lisp/simple.el (completion-auto-select) : Move before first use.
(completion-setup-function) : Make a more precise check for when
completion-auto-select is t.
2022-03-24 11:18:05 +01:00
Eli Zaretskii
f2047fdca4 Fix documentation of the new completion-related features
* etc/NEWS:
* lisp/minibuffer.el (completion-auto-help):
* doc/lispref/text.texi (Special Properties):
* doc/emacs/mini.texi (Completion Options): Fix wording of
recently added documentation and customization options.
2022-03-22 19:56:06 +02:00
Juri Linkov
eba9c473a8 Small fixes for new completions features
* lisp/minibuffer.el (completions-header-format):
Rename from completion-header-format.
(completions-highlight, completions-highlight-face):
Move up before first use.
2022-03-21 21:27:41 +02:00
Jimmy Aguilar Mena
325548d726 Simplify unneeded condition.
* lisp/minibuffer.el (display-completion-list) : The function
completion--insert-string already has a condition for when completions
is nil.
2022-03-13 22:22:02 +01:00
Jimmy Aguilar Mena
3f17e3acb3 Extend completion-auto-help 'always and 'visible.
Make them behave the same also with exact but not single completion.
2022-03-13 20:42:08 +01:00
Jimmy Aguilar Mena
e303fa3e60 Use the new cursor-face feature to highlight completions.
* lisp/minibuffer.el (completions-highlight-face) : New custom.
(completions-highlight-mode) : Removed
2022-03-13 20:34:19 +01:00
Jimmy Aguilar Mena
10cb469ee8 Rename completion-header-string to completion-header-format
And use a propertized default value.
2022-03-13 19:47:11 +01:00
Jimmy Aguilar Mena
49d1fe5222 Make minibuffer-hide-completions interactive.
Mainly to find a binding for it.
2022-03-13 16:04:58 +01:00
Jimmy Aguilar Mena
7a6c6f1668 Add completion-header-string.
* doc/emacs/mini.texi (completion-header-string): Remove
completion-header-text-property-list and completion-lazy-count.
(completion-header-string): Substitutes the removed variable.
2022-03-13 15:59:13 +01:00
Jimmy Aguilar Mena
e28309ce05 Add two new options for completions.
* doc/emacs/mini.texi (completion-lazy-count):
(completion-header-text-property-list) : New customs

Updated NEWS and manual.
2022-03-12 00:54:39 +01:00
Juri Linkov
7b62bef2d3 Fix new option completions-max-height and new values for completion-auto-help
* doc/emacs/mini.texi (Completion Options): Fix pxref for
"Buffer Display Action Alists".

* lisp/minibuffer.el (completion-auto-help): Explain new values in docstring.
(completions-max-height): Use choice to allow nil.
2022-03-10 20:48:48 +02:00
Jimmy Aguilar Mena
e683e60fad Add new mode completions-highlight-mode. 2022-03-10 14:37:40 +01:00
Jimmy Aguilar Mena
09b548fd5e completions-max-height new custom variable. 2022-03-10 14:37:40 +01:00
Jimmy Aguilar Mena
6b3c665d2a completion-auto-help new values.
Added also entries to news and manual
2022-03-10 14:37:40 +01:00
Stefan Monnier
77cbde6d09 minibuffer.el: Try and fix bug#53053
* lisp/minibuffer.el (completion--sifn-requote): Special case for when
`upos` is at the very end.
2022-02-07 16:51:18 -05:00
Lars Ingebrigtsen
fdc7272980 Improve the read-file-name doc string slightly
* lisp/minibuffer.el (read-file-name): Note that the semantics of
INITIAL are odd (bug#37883).
2022-01-28 17:03:14 +01:00
Glenn Morris
fbf4757784 * lisp/minibuffer.el (completions-sort): Fix type.
Flagged by test-custom-opts.
2022-01-24 10:16:36 -08:00
Protesilaos Stavrou
a46421446f Make Completions sorting a user option
* etc/NEWS: Document the new user option.
* lisp/minibuffer.el (completions-sort): Add new user option.
(minibuffer-completion-help): Implement it for the Completions
buffer.  (Bug#53362)
2022-01-24 15:36:11 +02:00
Lars Ingebrigtsen
62a84eea34 Improve the completion-category-overrides doc string
* lisp/minibuffer.el (completion-category-overrides): Clarify what
this variable does (bug#22324).
(completion-category-defaults): Mention the overrides variable.
2022-01-21 14:45:23 +01:00
Daniel Mendler
30d4cfc080 completion--nth-completion: Throw meaningful error
If a configured completion style does not exist, throw a meaningful
error. Also make completion-styles-alist a defvar, since completion
styles like orderless extend it.

* lisp/minibuffer.el (completion-styles-alist): Make it a defvar.
(completion--nth-completion): Give a more meaningful error.
2022-01-04 19:16:37 -05:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Stefan Kangas
8d846b8f8e Use defvar-keymap in minibuffer.el
* lisp/minibuffer.el (completion-in-region-mode-map)
(minibuffer-local-completion-map)
(minibuffer-local-must-match-map)
(minibuffer-local-filename-completion-map)
(minibuffer-local-ns-map, minibuffer-inactive-mode-map): Use
defvar-keymap.
2021-12-22 22:59:36 +01:00
Philip Kaludercic
15693c8116 Allow for next-completion to wrap around the completion buffer
* lisp/simple.el (completion-wrap-movement): Add new option.
(previous-completion): Update docstring.
(next-completion): Respect completion-wrap-movement.
(switch-to-completions): Handle backwards completion by jumping to the
end of the buffer.
* lisp/minibuffer.el: (minibuffer-local-completion-map): Bind
minibuffer-complete to backtab
(completion--in-region-1): Handle backtab to scroll backwards
2021-12-21 22:31:18 +01:00
Stefan Monnier
4d93859c87 Merge remote-tracking branch 'origin/emacs-28' into trunk 2021-12-06 09:44:18 -05:00
Stefan Monnier
d529207b0e lisp/minibuffer.el: Fix for bug#52169 regression
* lisp/minibuffer.el (completion-table-subvert): Make sure we return
a boundary that's not outside of the limit of the string.
2021-12-06 09:43:13 -05:00
Stefan Monnier
284cc2491d * lisp/minibuffer.el: Don't return a boundary outside its arg
* lisp/minibuffer.el (completion-table-subvert): Fix out of string
start boundary for the odd case where `string` is shorter than `s1`.
2021-12-04 00:02:31 -05:00
Stefan Kangas
4a3ba8528b Use substitute-command-keys for literal key sequences
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-help-for-help):
* lisp/calc/calc-mode.el (calc-auto-why):
* lisp/calc/calc.el (calc-do):
* lisp/calculator.el (calculator-mode):
* lisp/dired-aux.el (dired-create-files)
(dired-do-create-files-regexp, dired-create-files-non-directory):
* lisp/dired-x.el (dired-virtual):
* lisp/dired.el (dired-mark-region, dired-unmark-all-files):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/epa-ks.el (epa-ks--display-keys):
* lisp/erc/erc.el (erc-toggle-debug-irc-protocol):
* lisp/files.el (save-some-buffers):
* lisp/gnus/gnus-dired.el (gnus-dired-find-file-mailcap)
(gnus-dired-print):
* lisp/gnus/gnus-group.el (gnus-keep-same-level):
* lisp/gnus/gnus-score.el (gnus-score-find-trace):
* lisp/gnus/gnus.el (to-list):
* lisp/gnus/message.el (message--send-mail-maybe-partially):
* lisp/mail/supercite.el (sc-set-variable):
* lisp/minibuffer.el (minibuffer-inactive-mode):
* lisp/progmodes/etags.el (select-tags-table):
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode)
(idlwave-shell-char-mode-loop):
* lisp/replace.el (query-replace-help):
* lisp/simple.el (set-variable):
* lisp/subr.el (read-char-from-minibuffer):
* lisp/textmodes/ispell.el (ispell-help, ispell-message):
* lisp/textmodes/reftex-global.el (reftex-find-duplicate-labels):
* lisp/textmodes/reftex-vars.el
(reftex-toc-include-file-boundaries)
(reftex-toc-include-labels, reftex-toc-include-index-entries)
(reftex-toc-include-context, reftex-toc-follow-mode)
(reftex-index-include-context, reftex-index-follow-mode)
(reftex-enable-partial-scans)
(reftex-auto-update-selection-buffers)
(reftex-highlight-selection):
* lisp/time.el (display-time-update):
* lisp/vc/ediff-help.el (ediff-help-for-quick-help):
* lisp/vc/ediff-init.el (ediff-keep-variants):
* lisp/vc/ediff-ptch.el (ediff-fixup-patch-map)
(ediff-patch-file-internal):
* lisp/windmove.el (windmove-delete-default-keybindings): Use
'substitute-command-keys' for literal key sequences.

* lisp/userlock.el (userlock--fontify-key): Remove function.
(ask-user-about-lock, ask-user-about-lock-help)
(ask-user-about-supersession-threat)
(ask-user-about-supersession-help): Use 'substitute-command-keys' for
literal key sequences.

* lisp/ibuffer.el (ibuffer-unmark-all): Use 'substitute-command-keys'
for command.
2021-11-22 12:04:19 +01:00
Lars Ingebrigtsen
f3745a9a24 Re-rename the minibuffer heading
* lisp/minibuffer.el: There's more here than completion functions
(bug#49844).
2021-11-06 03:58:43 +01:00
Lars Ingebrigtsen
68d3f2b69c Correct minibuffer.el heading
* lisp/minibuffer.el: There's more here than completion functions
(bug#49844).
2021-11-06 03:41:11 +01:00
Jan Synacek
d72fefdeab Fix typos in the manual and in a comment
* lisp/minibuffer.el (completion-pcm--hilit-commonality):
* doc/lispintro/emacs-lisp-intro.texi (Mode Line): Fix typos
(bug#51434).

Copyright-paperwork-exempt: yes
2021-10-28 23:33:12 +02:00
Michael Albinus
8c5fbd712b Revert commit 225ca617b7, and apply another fix
* lisp/minibuffer.el (read-file-name-default): Revert commit
225ca617b7.  (Bug#50976).

* lisp/shell.el (shell): Remove volume letter for remote shell
file name.  (Bug#49229)
2021-10-23 15:21:14 +02:00
Basil L. Contovounesios
ab60144ea3 ; Pacify recent shorthand unused lexarg warnings. 2021-10-11 11:55:40 +01:00
João Távora
4c7e74c386 Complete shorthands to longhands for symbol-completing tables
Shorthands aren't symbols, they're text forms that 'read' into
symbols.  As such, shorthands aren't candidates in these tables of
symbols.  But in some situations, if no other candidates match the
pattern, we can e.g. complete "x-foo" to "xavier-foo" if the shorthand

  (("x-" . "xavier-"))

is set up in the buffer of origin.

bug#50959

* lisp/help-fns.el (help--symbol-completion-table): Report
`symbol-help' category.

* lisp/minibuffer.el (completion-styles-alist): New 'shorthand'
style.
(completion-category-defaults): Link 'symbol-help' category with
'shorthand' style.
(minibuffer--original-buffer): New variable.
(completing-read-default): Setup minibuffer--original-buffer.
(completion-shorthand-try-completion)
(completion-shorthand-all-completions): New helpers.
2021-10-10 14:33:23 +01:00
Lars Ingebrigtsen
85e9e5f616 Don't quote nil and t in doc strings and comments
* test/src/minibuf-tests.el (test-try-completion-ignore-case):
* test/lisp/url/url-auth-tests.el
(url-auth-test-digest-auth-retrieve-cache):
* test/lisp/subr-tests.el (subr-tests-add-hook-depth):
* test/lisp/so-long-tests/so-long-tests.el
(so-long-tests-invisible-buffer-function):
* test/lisp/emacs-lisp/tabulated-list-test.el (tabulated-list-sort):
* src/xfaces.c:
* src/process.c (Finterrupt_process):
(syms_of_process):
* src/minibuf.c (Fread_from_minibuffer):
(Fcompleting_read):
(syms_of_minibuf):
* src/dispnew.c (syms_of_display):
* src/data.c:
* lisp/so-long.el (so-long--hack-local-variables):
* lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions):
(elisp--xref-find-definitions):
* lisp/org/ox-html.el (org-html-htmlize-output-type):
* lisp/org/org-agenda.el (org-agenda-do-in-region):
* lisp/net/tramp.el:
* lisp/minibuffer.el (set-minibuffer-message):
* lisp/isearch.el (isearch-wrap-pause):
(isearch-repeat-on-direction-change):
* lisp/emacs-lisp/timer.el (timer):
* lisp/emacs-lisp/package.el (package-read-archive-contents):
* lisp/emacs-lisp/faceup.el (faceup-next-property-change):
* lisp/emacs-lisp/comp.el (comp-func):
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-empty-p):
* lisp/emacs-lisp/cl-macs.el (cl-do):
(cl-do*):
(cl--self-tco):
* lisp/emacs-lisp/bytecomp.el (byte-compile-unresolved-functions):
(byte-compile-cond-jump-table): Don't quote t and nil.
2021-09-21 22:11:43 +02:00
Lars Ingebrigtsen
a7d51676f1 Document completions-detailed
* doc/emacs/help.texi (Name Help): Document completions-detailed.
* lisp/minibuffer.el (completions-detailed): Give an example in
the doc string.
2021-09-21 19:43:07 +02:00
Miha Rihtaršič
31ba9bbf6c Refactor minibuffer aborting
* lisp/minibuffer.el (minibuffer-quit-recursive-edit): New optional
argument to specify how many levels of recursion to quit.

* src/eval.c (internal_catch): Remove special handling of 'exit
tag (bug#49700).
* src/minibuf.c (Fabort_minibuffers): Use
minibuffer-quit-recursive-edit to quit multiple levels of minibuffer
recursion.
2021-09-20 07:59:29 +02:00
Lars Ingebrigtsen
adda0df193 completions-annotations doc string clarification
* lisp/minibuffer.el (completions-annotations): Mention that it's
not always used.
2021-09-13 12:20:57 +02:00
Lars Ingebrigtsen
db5fbc7af8 Fix read-no-blanks-input doc string typo
* lisp/minibuffer.el (read-no-blanks-input): Fix doc string typo.
2021-09-12 14:11:57 +02:00
dick r. chiang
ac2498ad1c Fix read-no-blanks-input history argument
* lisp/minibuffer.el (read-no-blanks-input): Use the
`minibuffer-history' symbol, not the value (bug#50535).
2021-09-12 14:11:57 +02:00
João Távora
1155826c98 Speed up pcm completion styles for patternless special case
Fixes: bug#48841

* lisp/minibuffer.el (completion-flex-all-completions): Skip
completion-pcm--hilit-commonality if there's no pattern yet.
2021-08-25 16:27:35 +01:00
João Távora
ba852512f2 Don't mess up grouping in completion-all-sorted-completions
The default sorting order will mess up the naturally grouped order of
the candidates in the table that specified the group-function.

As seen in xref.el when

   (setq xref-show-definitions-function
         'xref-show-definitions-completing-read)
   (setq completions-group t)
   M-x fido-mode

Also partially seen with C-x 8 RET (M-x insert-char) with

   (setq read-char-by-name-sort 'code)

bug#48545

* lisp/minibuffer.el (completion-all-sorted-completions): Don't
use default sort if there's a group-function in the table.
2021-08-22 16:11:40 +01:00