1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-10 00:00:39 -08:00
Commit graph

186 commits

Author SHA1 Message Date
Stefan Kangas
63f419f133 ; Minor stylistic fixes found by checkdoc 2021-09-16 19:37:07 +02:00
João Távora
1afe59f7f8 Double check completions-group customization variable in Icomplete
bug#48545

* lisp/icomplete.el (icomplete--augment): Double check completions-group.
2021-08-22 16:36:26 +01:00
João Távora
fb81c8c3ad Make icomplete-forward-completions O(1) when icomplete-scroll is t
In particular, this makes the recently added
icomplete-vertical-goto-last (bug#49005) be O(n) instead of O(n^2).
That used to be almost unbearably slow for large n.

* lisp/icomplete.el (icomplete-forward-completions):  don't call last
unless needed.
2021-08-19 23:56:29 +01:00
Eli Zaretskii
787fa7a8ab Minor doc fixes in icomplete.el
* lisp/icomplete.el (icomplete-section): Add :version.
(icomplete--augment): Doc fix.
2021-08-19 15:29:49 +03:00
João Távora
37f0ea99f8 ; Correct :version tag of icomplete-selected-match face
* lisp/icomplete.el (icomplete-selected-match): Fix :version
2021-08-19 12:16:03 +01:00
João Távora
2be8e2ffc9 Section by 'group-function' in Icomplete and Fido's vertical modes
Fixes: bug#48545

* lisp/icomplete.el (icomplete--augment): Rewrite from icomplete--affixate.
(icomplete--render-vertical): Rework.
(icomplete--vertical-minibuffer-setup): Separator is hardcoded "\n", no
need to set.
2021-08-19 12:16:03 +01:00
João Távora
e6fb7e44cc Bind <up> and <down> in icomplete-vertical-mode
Suggested by Ergus <spacibba@aol.com>

* lisp/icomplete.el (icomplete-vertical-mode-minibuffer-map): Bind
<up> and <down>
2021-08-17 13:06:06 +01:00
João Távora
96bbd6f0a7 Jump to first,last completion with M-<, M-> in icomplete-vertical-mode
Fixes: bug#49005

Co-authored-by: Simon Lang <simon.lang@outlook.com>

* lisp/icomplete.el (icomplete-backward-completions): Return
non-nil iff something was stepped.  Ajust docstring.
(icomplete-forward-completions): Adjust docstring.
(icomplete-vertical-goto-first, icomplete-vertical-goto-last): New commands.
(icomplete-vertical-mode-minibuffer-map): Bind new commands to M-< and M->.
2021-08-17 12:56:38 +01:00
João Távora
a126c06b0a Make icomplete-vertical-mode take immediate effect (bug#49075)
* etc/NEWS: Mention change.

* lisp/icomplete.el (icomplete-vertical-mode):
(fido-vertical-mode): Tweak docstring.  Turn on
icomplete-mode. and fido-mdoe
2021-08-16 23:18:27 +01:00
João Távora
e6f3a4dc6c Fix bug#50063 when using icomplete-fido-kill with C-x p p
C-x p p utilizes a completion table "category" which is 'project-file'
icomplete-fido-kill only functioned for 'buffer' and 'file', and
failed with a non-informative message when something else was used.

* lisp/icomplete.el (icomplete-fido-kill): Support 'project-file'
class.  Use cl-case, instead of pcase.
2021-08-15 09:13:25 +01:00
Gabriel do Nascimento Ribeiro
513539524e Use 'remember-buffer' in remember.el doc strings.
* lisp/textmodes/remember.el (remember-initial-contents)
(remember-before-remember-hook, remember-destroy): Refer to
`remember-buffer'.

* lisp/textmodes/remember.el (remember-buffer): Make into
defcustom (bug#49373).
2021-07-19 18:04:25 +02:00
Dmitry Gutov
9b318d5c58 Speed up fido-mode
* lisp/icomplete.el (icomplete-completions): Speed up fido-mode (bug#48841).
2021-07-04 04:38:54 +03:00
Jonas Bernoulli
8ebd8e1fea In files that use allout use it for all headings
* lisp/allout.el: Don't prefix regular comments with three
semicolons.
* lisp/icomplete.el: Use allout syntax for all headings.
* lisp/net/eudc.el: Use allout syntax for all headings.
2021-06-30 22:17:01 +02:00
João Távora
45d711a356 Consider environment vars in Fido's directory-aware RET binding
Fixes: bug#48782

* lisp/icomplete.el (icomplete-fido-ret): Consider environment
variables in dir expansion.
2021-06-05 21:47:57 +01:00
Dmitry Gutov
8d5b7f519f Make icomplete less blinky and more responsive
* lisp/icomplete.el (icomplete-pre-command-hook, icomplete-tidy):
Remove, update the callers
(https://lists.gnu.org/archive/html/emacs-devel/2021-06/msg00111.html).
(icomplete-compute-delay): Change the default to 150ms.
(icomplete-max-delay-chars): Change the default to 2.
2021-06-05 03:56:33 +03:00
João Távora
fb1c5e4816 Add annotation capability to icomplete-vertical-mode
Co-authored-by Daniel Mendler <mail@daniel-mendler.de>

* lisp/icomplete.el (icomplete--affixate): New helper.
(icomplete--render-vertical): Use it. Rework.
(icomplete-completions): Pass md to icomplete--render-vertical.
2021-06-01 10:44:47 +01:00
João Távora
05ab6e53e2 Improve icomplete-vertical-mode and fido-vertical-mode
This mode is intended to be used with Icomplete ('M-x icomplete-mode')
or Fido ('M-x fido-mode'), to display the list of completions
candidates vertically instead of horizontally.  When used with
Icomplete, completions are rotated and selection kept at the top.
When used with Fido, completions scroll like a typical dropdown
widget.

If the dropdown behaviour is desired for Icomplete (instead of
rotation), icomplete-scroll can be adjusted separately by the user.

* etc/NEWS (icomplete-vertical-mode): Reword.

* lisp/icomplete.el (simple): Require it.
(icomplete-selected-match): New face.
(icomplete-scroll): New user-visible var.
(icomplete-forward-completions): Rework.
(icomplete-backward-completions): Rework.
(icomplete--fido-mode-setup): Prefer icomplete-scroll according to
icomplete-vertical mode.
(icomplete-minibuffer-setup): Initialize icomplete--scrolled-completions.
(fido-vertical-mode): An alias for icomplete-vertical-mode.
(icomplete-exhibit): Init icomplete--scrolled-past.  Adjust overlay.
(icomplete--render-vertical): New helper.
(icomplete--sorted-completions): If cache is stale, also
invalidate icomplete--scrolled-past.
(icomplete-completions): Rework.  Mostly reformat.

* lisp/simple.el (max-mini-window-lines): New helper.
(display-message-or-buffer): Use it.
2021-06-01 10:40:54 +01:00
Stefan Kangas
289ec2d911 ; Remove some useless comments 2021-04-16 14:54:02 +02:00
Gregory Heytings
5761e9004a Add new icomplete-vertical-mode
Co-authored-by: João Távora <joaotavora@gmail.com>

* lisp/icomplete.el (icomplete-completions): Consider icomplete-vertical-mode.
(icomplete-vertical-mode-minibuffer-map): New map.
(icomplete--vertical-minibuffer-setup): New helper.
(icomplete-vertical-mode): New minor mode.

* doc/emacs/buffers.texi (Icomplete): Mention icomplete-vertical-mode.

* etc/NEWS: Mention icomplete-vertical-mode
2021-04-10 23:51:05 +01:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
Juri Linkov
dc6e616dfe Don't show matches with no input for nil icomplete-show-matches-on-no-input
* lisp/icomplete.el (icomplete-show-matches-on-no-input): Fix docstring.
(icomplete--initial-input): New internal variable.
(icomplete-minibuffer-setup): Set buffer-local
icomplete--initial-input to icomplete--field-string.
(icomplete-ret, icomplete-force-complete-and-exit)
(icomplete--sorted-completions, icomplete-exhibit):
Compare icomplete--initial-input with icomplete--field-string
to detect no input.  (Bug#19031)

etc/NEWS: Remove duplicate entry.
2020-12-14 10:44:04 +02:00
Stefan Kangas
c50c0a19e3 Prefer setq-local in most files
* lisp/apropos.el (apropos-print):
* lisp/buff-menu.el (Buffer-menu-mode):
* lisp/calc/calc.el (calc-trail-buffer):
* lisp/chistory.el (command-history-mode):
* lisp/dabbrev.el:
* lisp/dframe.el (dframe-frame-mode):
* lisp/doc-view.el (doc-view-presentation-mode):
* lisp/ebuff-menu.el (electric-buffer-menu-mode)
(electric-buffer-update-highlight):
* lisp/edmacro.el (edit-kbd-macro):
* lisp/face-remap.el (buffer-face-set, buffer-face-toggle):
* lisp/files.el:
(find-file-noselect-1, hack-local-variables-confirm)
(set-visited-file-name, revert-buffer--default):
* lisp/filesets.el (filesets-spawn-external-viewer):
* lisp/find-dired.el (find-dired):
* lisp/find-lisp.el (find-lisp-find-dired-internal):
* lisp/finder.el (finder-mode):
* lisp/font-core.el (font-lock-default-function):
* lisp/format.el (format-annotate-function):
* lisp/help-fns.el (describe-variable):
* lisp/help-mode.el (help-mode):
* lisp/icomplete.el (icomplete-minibuffer-setup)
(icomplete--in-region-setup):
* lisp/ido.el (ido-completion-help, ido-tidy):
* lisp/international/robin.el (robin-activate):
* lisp/leim/quail/hangul.el (hangul-input-method-activate):
* lisp/leim/quail/uni-input.el (ucs-input-activate):
* lisp/man.el (Man-mode):
* lisp/master.el (master-set-slave):
* lisp/minibuffer.el (minibuffer-completion-help)
(read-file-name-default):
* lisp/outline.el (outline-minor-mode):
* lisp/pcomplete.el (pcomplete-comint-setup):
* lisp/proced.el (proced-mode):
* lisp/recentf.el (recentf-edit-list, recentf-open-files-items):
* lisp/replace.el (occur-1):
* lisp/reveal.el (reveal-mode):
* lisp/ruler-mode.el (ruler--save-header-line-format):
* lisp/scroll-lock.el (scroll-lock-mode):
* lisp/startup.el (normal-top-level, normal-splash-screen):
* lisp/strokes.el (strokes-list-strokes):
* lisp/thumbs.el (thumbs-insert-image, thumbs-show-thumbs-list):
* lisp/tree-widget.el (tree-widget-set-theme):
* lisp/window.el (read-buffer-to-switch):
* lisp/xwidget.el (xwidget-webkit-begin-edit-textarea): Prefer
setq-local.
2020-12-09 11:58:38 +01:00
Lars Ingebrigtsen
3568ff084c Clarify icomplete-show-matches-on-no-input doc string
* lisp/icomplete.el (icomplete-show-matches-on-no-input): Clarify
doc string (bug#19031), suggested by Andrii Kolomoiets.
2020-12-07 13:37:44 +01:00
Lars Ingebrigtsen
de7a741c7b Revert "Clarify icomplete-show-matches-on-no-input doc string"
This reverts commit f352c57972.

The new explanation of what icomplete does is wrong.
2020-12-07 13:37:44 +01:00
Lars Ingebrigtsen
f352c57972 Clarify icomplete-show-matches-on-no-input doc string
* lisp/icomplete.el (icomplete-show-matches-on-no-input): Clarify
the meaning of the variable (bug#19031).
2020-12-04 12:15:29 +01:00
João Távora
dd25055829 Fix up fix for bug#19032
* lisp/icomplete.el (icomplete-ret): Call
minibuffer-icomplete-and-exit, not minibuffer-exit.
2020-09-09 20:12:45 +01:00
João Távora
0fb5425442 Change icomplete-show-matches-on-no-input behaviour for Icomplete only
Fixes: bug#19032, bug#43120

Previous fixes to bug#19032 introduced bugs in Fido mode.  This fix
relies on a new command bound to RET.

* etc/NEWS (Miscellaneous): Mention icomplete-show-matches-on-no-input.

* lisp/icomplete.el (icomplete-show-matches-on-no-input): Add comment.
(icomplete-minibuffer-map): Rebind minibuffer-complete-and-exit to
icomplete-ret.
(icomplete-ret): New command.
2020-09-08 09:47:48 +01:00
João Távora
627e9c191e Revert two commits for bug#19032
This reverts:

- commit 585fe00557, which is titled
  "Fix up previous icomplete-show-matches-on-no-input change"

- commit 1b8d369c38, which is titled
  "Change icomplete-show-matches-on-no-input behavior".

A simpler, less intrusive fix follows shortly after this commit.
2020-09-08 09:47:34 +01:00
João Távora
c8472cc69d Better explain behaviour of icomplete--sorted-completions
* lisp/icomplete.el (icomplete--sorted-completions): Overhaul comment
2020-09-07 10:53:01 +01:00
João Távora
6fc502c1ef Don't resort Icomplete candidates when default already on top
Fixes: bug#43222

Icomplete mode re-sorts candidates, bubbling the default to top if
it's found somewhere down the list.  This is done according to two
criteria: exact match and prefix match.  Before this fix, it didn't
take into account the possibility that the exact match for the default
would already be on top, and would incorrectly bubble a prefixing
completion down the list to the top.  This commit fixes that.

* lisp/icomplete.el (icomplete--sorted-completions):
Rework. Recomment.
2020-09-06 08:36:39 +01:00
Lars Ingebrigtsen
585fe00557 Fix up previous icomplete-show-matches-on-no-input change
* lisp/icomplete.el (icomplete-completions): Ensure that the
default value is cleared (bug#43120).
2020-09-05 23:11:43 +02:00
Lars Ingebrigtsen
1b8d369c38 Change icomplete-show-matches-on-no-input behavior
* lisp/icomplete.el (icomplete-show-matches-on-no-input): Doc fix.
(icomplete-completions): Set completion-content-when-empty.

* lisp/minibuffer.el (completion-content-when-empty): New variable.
(completion--complete-and-exit): Use it (bug#19032).

Based on a patch by Matthew Leach <matthew@mattleach.net>.
2020-08-14 13:29:59 +02:00
João Távora
079b0dc430 Delete, don't kill, dir dir fragments in icomplete-fido-backward-updir
Reported by: Andrew Schwartzmeyer <andrew@schwartzmeyer.com>

* lisp/icomplete.el (icomplete-fido-backward-updir): Don't save
dir fragments to kill ring.
2020-06-13 18:46:03 +01:00
João Távora
3916e63f9e Have Fido mode also imitate Ido mode in ignore-case options
Suggested by Sean Whitton <spwhitton@spwhitton.name>.

* lisp/icomplete.el (icomplete--fido-mode-setup): Set ignore-case
options.
2020-06-05 23:38:21 +01:00
João Távora
145a151d62 Correct Fido-mode's backspacing of directories with spaces
Fixes: bug#40625

* lisp/icomplete.el (icomplete-fido-backward-updir): Use
zap-up-to-char.
2020-04-16 09:33:37 +01:00
João Távora
660b9b8cfb Default completion-flex-nospace to nil
By default, the flex completion style _does_ match spaces.

Fixes: bug#40625

* lisp/icomplete.el (icomplete--fido-mode-setup): Force
completion-flex-nospace to nil.

* lisp/minibuffer.el (completion-flex-nospace): Default to nil.
2020-04-15 18:43:09 +01:00
João Távora
fc47e3ad99 Let fido-mode users force a minibuffer-exit
* lisp/icomplete.el (icomplete-fido-exit):
Add FORCE arg.  Rewrite docstring. (bug#38992)
2020-03-07 13:59:50 +00:00
Dmitry Gutov
e734961d4c icomplete-fido-exit: New command for the M-j binding
* lisp/icomplete.el (icomplete-fido-exit): New command.
(icomplete-fido-mode-map): Use it (bug#38992).
2020-03-07 13:51:03 +00:00
Dmitry Gutov
335a9bd215 minibuffer-force-complete-and-exit: Allow input with no matches
* lisp/minibuffer.el (minibuffer--require-match): New variable.
(completing-read-default): Bind it to the REQUIRE-MATCH value.
(minibuffer-force-complete-and-exit): Consult it to allow input
with no matches when a match is not required (bug#38992).

* lisp/icomplete.el (icomplete-exhibit): Use it to render the
correct parens around matches.
2020-03-07 13:50:42 +00:00
João Távora
beec9f64a5 Add comment on fido-mode's file-sorting semantics
* lisp/icomplete.el (icomplete--sorted-completions): Add comment.
2020-01-09 10:08:44 +00:00
João Távora
eb3c6ad325 Consider non-string minibuffer-default in icomplete
Fixes: bug#38992

* lisp/icomplete.el (icomplete--sorted-completions): Consider
non-string minibuffer-default.
2020-01-09 10:08:43 +00:00
Paul Eggert
365e01cc9f Update copyright year to 2020
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2020-01-01 00:59:52 +00:00
João Távora
195bde9ea8 Don't always resort in recently introduced icomplete--sorted-completions
Doing so breaks icomplete-forward-completions and
icomplete-backward-completions.

* lisp/icomplete.el (icomplete--sorted-completions): Don't always
resort.

(cherry picked from commit 639fb50ed4)
2019-12-31 13:31:45 +00:00
João Távora
f2a349ba8d Don't force completion recalculation in icomplete-fido-ret
Besides the adverse effect of delaying completions, it tripped up the
useful logic of icomplete-force-complete-and-exit in the case where a
default was available, but no completions calculated yet.

* lisp/icomplete.el (icomplete-fido-ret): Don't force calculation
of completions.

(cherry picked from commit 13778aa5be)
2019-12-31 13:31:45 +00:00
João Távora
9b1053ba27 Correctly cache sorted completions in icomplete--sorted-completions
* lisp/icomplete.el (icomplete--sorted-completions): Use
completion--cache-all-sorted-completions.

(cherry picked from commit 83587bb688)
2019-12-31 13:31:45 +00:00
João Távora
b1c3ed9f32 Move flex style's minibuffer-default-aware sorting to lisp/icomplete.el
This moves the logic from the series of commits starting in the commit named:

  Improve sorting of flex completion style with non-nil minibuffer-default

to lisp/icomplete.el, so far the only confirmed beneficiary of that
functionality.

* lisp/icomplete.el (icomplete--sorted-completions): Consider
minibuffer-default here.

* lisp/minibuffer.el (completion--flex-adjust-metadata): Simplify.

(cherry picked from commit 0d2a711dc9)
2019-12-31 13:31:45 +00:00
João Távora
e3276f36c0 Make fido-mode behave more like ido-mode when finding directories
Notably C-x d (M-x dired) and C-x v d (M-x vc-dir) behaved quite
differently, having regular files as the default instead of ido's
usual "./".

* lisp/icomplete.el (icomplete--sorted-completions): New helper.
(icomplete-completions): Use it.

(cherry picked from commit ee914051fb)
2019-12-31 13:31:45 +00:00
João Távora
fe0ed17175 Slightly simplify lisp/icomplete.el with new icomplete--category helper
* lisp/icomplete.el (icomplete-fido-kill)
(icomplete-fido-delete-char, icomplete-fido-ret)
(icomplete-fido-backward-updir, icomplete-exhibit): Use
icomplete--category.
(icomplete--category): New helper.

(cherry picked from commit 24a1f520f9)
2019-12-31 13:31:45 +00:00
Paul Eggert
b0f20651e3 ; Spelling fixes 2019-12-10 20:05:49 -08:00
João Távora
aa79f4e8c6 * lisp/icomplete.el (icomplete-fido-kill): Unbreak yes-or-no-p usage
Discussed in the context of bug#19064, bug#17272.
2019-11-19 23:55:54 +00:00