1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-05 11:45:45 +00:00
Commit Graph

397 Commits

Author SHA1 Message Date
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
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
5352947d0d Another adjustment to flex completion style's sorting function
* lisp/minibuffer.el (completion--flex-adjust-metadata): Adjust
case when minibuffer-default is non-nil.

(cherry picked from commit 9c91204992)
2019-12-31 13:31:45 +00:00
João Távora
e1e2ad104d Comment on limitation of flex completion style's sorting function
* lisp/minibuffer.el (completion--flex-adjust-metadata): Add
comment.
2019-12-23 12:08:43 +01:00
João Távora
c7e6b62d9e Fix a bug in completion--flex-adjust-metadata
If minibuffer-default coincided with the first of completions, the
empty list would be returned.

* lisp/minibuffer.el (completion--flex-adjust-metadata): Make sure
to never return empty list.
2019-12-23 12:03:13 +01:00
João Távora
df3fe4e275 Fix bug in flex completion style's sorting and simplify
This previous commit targetting this function introduced a bug whereby
the completion table's sorting function wouldn't be called.  That is
fixed by this commit, which also simplifies the function further: it
now skips re-sorting the completions completely if there is no
minibuffer input at all (in other words, when flex isn't doing
anything useful).

* lisp/minibuffer.el (completion--flex-adjust-metadata): Simplify.
2019-12-22 22:57:16 +01:00
Eli Zaretskii
d7ab4edd93 Fix wording of recent documentation changes
* src/xdisp.c (syms_of_xdisp):
* lisp/minibuffer.el (minibuffer-message-clear-timeout):
* etc/NEWS:
* doc/lispref/display.texi (Displaying Messages): Minor
changes of wording of a recent commit.  (Bug#38457)
2019-12-22 21:02:48 +02:00
João Távora
2fa8fd18df Improve sorting of flex completion style with non-nil minibuffer-default
This affects the behaviour of flex completion when there is a default
completion and the user hasn't entered any input pattern to flex-match
against.  It is most visible when icomplete-mode or fido-mode are
being used in conjunctio.

When using M-x man, for instance, the default completion is picked
from text around point.  Say it is "emacs" (for Emacs's man page).  It
will not match the intended completion, "emacs(1)", exactly.  If the
user hasn't yet given any input to the completion prompt, that
completion should bubble to top so that
icomplete-force-complete-and-exit will select it, but it didn't.

This new approach uses 'string-prefix-p' instead of 'equal' to find
the default to bubble to the top.  This strategy could eventually be
improved, most naturally by flex-matching the default string to all
the candidates and picking the highest scoring one.

Additionally, the new strategy only considers minibuffer-default if
there is no input in the minibuffer, which seems sensible and produces
a small but noticeable speedup.

* lisp/minibuffer.el (completion--flex-adjust-metadata):
Reformulate sorting strategy.
2019-12-22 12:52:32 +01:00
Juri Linkov
485b423e8f New variable set-message-function to show message at the end of the minibuffer
* doc/lispref/display.texi (Displaying Messages): Document
set-message-function and clear-message-function.

* lisp/minibuffer.el (minibuffer-message-clear-timeout): New defcustom.
(minibuffer-message-timer, minibuffer-message-overlay): New variables.
(set-minibuffer-message, clear-minibuffer-message): New functions.
(set-message-function, clear-message-function): Set variables to
set-minibuffer-message and clear-minibuffer-message respectively.

* src/keyboard.c (read_char): Call clear_message when
Vclear_message_function is a function.

* src/xdisp.c (set_message): Call Vset_message_function when it's a function.
(clear_message): Call Vclear_message_function when it's a function.
(syms_of_xdisp): New variables set-message-function and clear-message-function
(bug#38457).
2019-12-22 00:02:10 +02:00
Juri Linkov
7254b63462 Revert aa89c84e00 (bug#38457)
* src/editfns.c (Fmessage): Don't use minibuffer-message.
(Fmessage_in_echo_area): Remove function message-in-echo-area.
(syms_of_editfns): Remove variable message-in-echo-area.

* lisp/isearch.el (isearch--momentary-message): Remove message-in-echo-area.
* lisp/minibuffer.el (minibuffer-message): Don't record message
in the *Messages* buffer.
(minibuffer-completion-help): Remove message-in-echo-area.

* lisp/subr.el (do-after-load-evaluation): Remove discard-input (bug#38560)
2019-12-16 01:58:14 +02:00
Stefan Monnier
0eff1a0191 * lisp/minibuffer.el (completion-pcm--find-all-completions): Simplify a bit 2019-12-14 12:40:29 -05:00
Juri Linkov
9ea3137bc8 Move recenter/scroll keybindings from minibuffer-local-map to read-char map
* lisp/minibuffer.el (minibuffer-local-map): Move remap of
recenter/scroll keybindings to read-char-from-minibuffer-map.

* lisp/subr.el (read-char-from-minibuffer-map): Move remap of
recenter/scroll keybindings here from minibuffer-local-map.
(bug#38502)
2019-12-09 00:19:43 +02:00
Thierry Volpiatto
4095a006fd
Fix setting completions* faces in
`completion-pcm--hilit-commonality` so that these faces doesn't
override possible already existing faces in other UIs.

* lisp/minibuffer.el (completion-pcm--hilit-commonality): Use
`add-face-text-property` instead of `put-text-property`.
2019-12-06 07:22:57 +01:00
Stefan Monnier
8bea7e9ab4 * lisp/minibuffer.el (completion-pcm--optimize-pattern): New function
This fixes bug#38458 where a final `point` in the pattern prevented
the expected normal behavior of point moving after the completion
of the final implicit `any`.

(completion-pcm--find-all-completions)
(completion-substring--all-completions): Use it.
(completion-basic--pattern): Don't both removing "" any more.
(completion-basic-try-completion): Use it as well as
`completion-basic--pattern`.
2019-12-03 09:45:48 -05:00
Juri Linkov
aa89c84e00 message uses minibuffer-message in the active minibuffer (bug#17272 bug#19064)
* doc/lispref/display.texi (Displaying Messages): Explain the
behavior of using minibuffer-message if the minibuffer is active.

* src/editfns.c (Fmessage_in_echo_area): New function with body
copied from Fmessage.
(Fmessage): Call minibuffer-message in the active minibuffer,
otherwise call Fmessage_in_echo_area.
(message-in-echo-area): New variable.

* lisp/isearch.el (isearch--momentary-message, isearch-message):
* lisp/minibuffer.el (minibuffer-message, minibuffer-completion-help):
Use 'message-in-echo-area' instead of 'message' where necessary.

* lisp/autorevert.el (auto-revert-handler):
* lisp/man.el (Man-bgproc-sentinel):
* lisp/subr.el (do-after-load-evaluation):
Revert recent changes that replaced 'message' with 'minibuffer-message'.
This is not needed anymore since 'message' uses 'minibuffer-message'
in the active minibuffer.
2019-11-27 01:43:49 +02:00
João Távora
6d4d00c634 * lisp/minibuffer.el (completion-flex-nospace): Default to t. 2019-11-23 00:30:49 +00:00
Stefan Monnier
20b1e959e0 * lisp/minibuffer.el (completions-common-part): Make it blue when possible 2019-11-21 17:53:02 -05:00
Thierry Volpiatto
5a62c4b49c
Add new variable to prevent flex completion style
matching spaces.  This allows flex style working smoothly with other
styles like helm using spaces.

* lisp/minibuffer.el (completion-flex-nospace): New user var.
(completion-flex-try-completion): Use it.
(completion-flex-all-completions): Same.
2019-11-21 20:48:17 +01:00
Juri Linkov
8693611136 Don't obscure the minibuffer by message (bug#17272)
* lisp/subr.el (do-after-load-evaluation): Use minibuffer-message
to not obscure a possibly active minibuffer.

* lisp/minibuffer.el (minibuffer-message):
Record message in the *Messages* buffer.
2019-11-10 00:46:29 +02:00
Juri Linkov
898cdc67f1 Run scroll/recenter commands from minibuffer in original window (bug#38076)
* lisp/minibuffer.el (with-minibuffer-selected-window): New macro.
(minibuffer-recenter-top-bottom, minibuffer-scroll-up-command)
(minibuffer-scroll-down-command, minibuffer-scroll-other-window):
(minibuffer-scroll-other-window-down): New commands.
(minibuffer-local-map): Remap recenter/scroll symbols to their
minibuffer wrappers: recenter-top-bottom to minibuffer-recenter-top-bottom.

* src/window.c (Fother_window_for_scrolling): Use 'lambda' value for
MINIBUF arg of Fnext_window, so minibuffer-scroll-other-window and
minibuffer-scroll-other-window-down doesn't try to scroll the
minibuffer window.
2019-11-09 23:32:46 +02:00
João Távora
d9c6b4378a Protect flex's display-sort-function against 0-length candidates
* lisp/minibuffer.el (completion--flex-adjust-metadata): Assume a
candidate missing a score has a score of 0.
2019-11-09 14:55:42 +00:00
João Távora
d558d9fa1e Have pcm styles apply faces to face prop, not font-lock-face
This is the way the basic completion styles work.  This fixes
candidate highlighting in icomplete.

* lisp/minibuffer.el (completion-pcm--hilit-commonality): Apply
faces to 'face property, not font-lock-face.
2019-11-08 10:18:33 +00:00
Stefan Monnier
7208c4f8c9 * lisp/minibuffer.el: Tweak and undo parts of recent changes
(completion-metadata): Always return a fresh new cons cell.
(completion--nth-completion): Don't bother calling adjust-metadata
if the result won't be used.
(completion-pcm--hilit-commonality): Revert recent change which had
removed support for `completions-first-difference` in `substring` and
`partial-completion` styles.
(completion--flex-adjust-metadata): Treat the arg as immutable.
2019-10-29 16:17:14 -04:00
Stefan Monnier
2aaced1686 * lisp/loadup.el: Load minibuffer after cl-generic
This is so minibuffer.el can make use of cl-generic

* lisp/minibuffer.el (minibuffer-local-completion-map):
Move switch-to-completions bindings here from...
* lisp/simple.el (minibuffer-local-completion-map): ... here.
2019-10-27 13:21:21 -04:00
João Távora
63fd71cd09 Improve scoring algorithm for flex-style completions
The previous algorithm had two problems: it considered non-matches in
the beginning and end of the string as matching "holes" and failed to
penalize larger holes, making flex-score-match-tightness only
effective in some corner cases.

The new formula, which is described in code and in pseudo-code in the
comments, fixes these problems.

As a result, by default, C-h f flex now correctly bubbles up
"company-search-flex-regexp" to the top, in front of "file-exists-p".
With a flex-score-match-tightness smaller than 1.0, the situation is
reversed.

* lisp/minibuffer.el (flex-score-match-tightness): Adjust default
value.  Improve docstring example.
(completion-pcm--hilit-commonality): Improve example.  Remove unused
variable.  Improve algorithm.
2019-10-27 01:46:56 +01:00
Juanma Barranquero
f4ee7c8382 minibuffer.el: Remove leftover code, unused after recent change
* lisp/minibuffer.el (completion-pcm--hilit-commonality):
Don't set point-idx.
2019-10-27 02:31:50 +02:00
João Távora
54477c6177 Restore default value of face completions-common-part
The previous commit titled "Rework face hints for partial-string
completion styles" contained a potentially controversial
backwards-incompatible change to this face's default value.

* lisp/minibuffer.el (completions-common-part): Restore empty
default value.
2019-10-26 21:47:36 +01:00
João Távora
da0f8dbf8f Rework face hints for partial-string completion styles
Don't use completions-first-difference for the 'substring', 'flex' and
'partial-completion' styles, since there can be really no reasonable
definition of a "first" difference there.

Make completions-common-part inherit from 'underline' so that it is
useful by default for all completion styles.

* lisp/minibuffer.el (completions-common-part): Adjust
description and change default value.
(completions-first-difference): Ajust docstring.
(completion-pcm--hilit-commonality): Don't use
completions-first-difference.
2019-10-26 14:33:02 +01:00
João Távora
e21a1da8dc Allow completion styles to adjust completion metadata
This commit re-does the now-reverted commit with the same title.  That
version relied on generic functions, which cannot be used yet in files
such as lisp/minibuffer.el.  This version uses a symbol property
completion--adjust-metadata instead.

The new facility allows completion styles to have a say in metadata
properties such as cycle-sort-function and display-sort-function.
This is especially useful for completion styles such as 'flex', which
generally produce many matches, including some potentially "obscure"
ones.  The default sorting strategy would often bubble the latter to
the top of the list.

The sorting function for 'flex' considers pre-computed matching scores
and is thus much better than the default for this particular style.

Additionally, it overrides the completion table's cycle-sort-function
or display-sort-function properties if they exist, although it still
uses them to pre-sort the result, so that they are still relevant for
resolving ties.

* lisp/minibuffer.el (completion--nth-completion)
(completion--flex-adjust-metadata): New helper.
(flex): Put completion--adjust-metadata property.
2019-10-26 14:20:39 +01:00
João Távora
878ea4d840 Revert "Allow completion styles to adjust completion metadata"
Unbreaks the build.

This reverts commit 7fc0292f5c.

Unfortunately, cl-defgeneric has some problems when used in
lisp/minibuffer.el.
2019-10-26 13:45:14 +01:00
João Távora
7fc0292f5c Allow completion styles to adjust completion metadata
The new facility, realized in the completion-adjust-metadata-for-style
generic, allows completion styles to have a say in metadata properties
such as cycle-sort-function and display-sort-function.  This is
especially useful for completion styles such as 'flex', which
generally produce many matches, including some potentially "obscure"
ones.  The default sorting strategy would often bubble the latter
to the top of the list.

The sorting function for 'flex' considers pre-computed matching scores
and is thus much better than the default for this particular style.

Additionally, it overrides the completion table's cycle-sort-function
or display-sort-function properties if they exist, although it still
uses them to pre-sort the result, so that they are still relevant for
resolving ties.

* lisp/minibuffer.el (completion--nth-completion): Call
completion-adjust-metadata-for-style.
(completion-adjust-metadata-for-style): New generic.
(completion-adjust-metadata-for-style 'flex): New method.
2019-10-26 13:09:52 +01:00
Lars Ingebrigtsen
4861328f2a Allow 'M-<' in the minibuffer to behave more logically
* doc/lispref/minibuf.texi (Completion Commands)
(Text from Minibuffer): Document it.

* lisp/minibuffer.el (minibuffer-beginning-of-buffer): New command
(bug#3447).
(map): Bind it.
2019-10-01 15:01:57 +02:00
Lars Ingebrigtsen
e67503dc48 Clarify the doc string of complete-with-action
* lisp/minibuffer.el (complete-with-action): Doc string
clarification (bug#13993).
2019-08-14 22:43:24 -07:00
Juri Linkov
44f199648b * lisp/minibuffer.el (minibuffer-message-properties): New variable.
(minibuffer-message): Use it to propertize message unless already
propertized by the caller.

* lisp/simple.el (minibuffer-error-function): Propertize the error.

* lisp/isearch.el (isearch-message-properties): New variable.
(isearch--momentary-message, isearch-message-prefix)
(isearch-message-suffix): Use it.  (Bug#21112)
2019-07-05 01:01:01 +03:00
Stefan Monnier
0b4e003766 Revert "* lisp/calc/calc-ext.el (math-scalarp): Fix typo"
This reverts commit 698ff554ac.
2019-06-26 10:24:59 -04:00
Stefan Monnier
698ff554ac * lisp/calc/calc-ext.el (math-scalarp): Fix typo 2019-06-26 10:03:48 -04:00
Lars Ingebrigtsen
a5cc98c38e Suppress warning in display-completion-list about itself
* lisp/minibuffer.el (display-completion-list):
`display-completion-list' calls itself with the old, obsolete
callargs, so suppress this warning.
2019-06-12 16:18:34 +02:00
Lars Ingebrigtsen
670c5126a0 Remove unused internal function completion-pcm--optimize-pattern
* lisp/minibuffer.el (completion-pcm--optimize-pattern): Remove
unused internal function (that signalled a compilation warning).
2019-05-17 06:21:43 +02:00
Dmitry Gutov
e0ee41d155 Allow customizing the display of project file names when reading
To hopefully resolve a long-running discussion
(https://lists.gnu.org/archive/html/emacs-devel/2019-05/msg00162.html).

* lisp/progmodes/project.el (project-read-file-name-function):
New variable.
(project--read-file-absolute, project--read-file-cpd-relative):
New functions, possible values for the above.
(project-find-file-in): Use the introduced variable.
(project--completing-read-strict): Retain just the logic that fits
the name.
2019-05-14 05:11:18 +03:00
Stefan Monnier
78c9c2a110 * lisp/minibuffer.el (completion-table-subvert): Fix typo from rev 5697ca55cb 2019-03-20 09:58:28 -04:00
Paul Eggert
bc2a93d5b7 Fix more regular expression typos
Problem reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-03/msg00548.html
except that I didn’t address the issues involving Hebrew,
or involving comint-prompt-regexp.
* lisp/align.el (align-rules-list, align-exclude-rules-list):
* lisp/auth-source-pass.el (auth-source-pass--parse-secret)
(auth-source-pass--parse-data):
* lisp/cedet/data-debug.el (data-debug-next)
(data-debug-prev, data-debug-expand-or-contract):
* lisp/comint.el (comint-within-quotes):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/emulation/viper-ex.el (ex-cmd-complete):
* lisp/gnus/gnus-cite.el (gnus-message-search-citation-line):
* lisp/gnus/nnir.el (nnir-imap-end-of-input):
* lisp/mail/mail-extr.el (mail-extr-all-letters):
* lisp/minibuffer.el (minibuffer-maybe-quote-filename):
* lisp/nxml/rng-nxml.el (rng-complete-tag)
(rng-complete-end-tag, rng-complete-attribute-name):
* lisp/obsolete/vip.el (vip-get-ex-token, vip-get-ex-pat):
* lisp/org/org-pcomplete.el (org-thing-at-point):
* lisp/org/org.el (org-set-tags)
(org-increase-number-at-point)
(org-fill-line-break-nobreak-p):
* lisp/pcomplete.el (pcomplete-parse-comint-arguments):
* lisp/progmodes/ada-mode.el (ada-compile-goto-error):
* lisp/progmodes/cperl-mode.el (cperl-highlight-charclass)
(cperl-find-pods-heres, cperl-not-bad-style-regexp)
(cperl-regext-to-level-start):
* lisp/progmodes/ebnf-yac.el (ebnf-yac-skip-spaces):
* lisp/progmodes/flymake-proc.el (flymake-proc-master-tex-init):
* lisp/progmodes/flymake.el (flymake-diag-region):
* lisp/progmodes/fortran.el (fortran-current-line-indentation):
* lisp/progmodes/idlw-complete-structtag.el:
(idlwave-complete-structure-tag):
* lisp/progmodes/idlwave.el (idlwave-complete-sysvar-or-tag):
* lisp/progmodes/prolog.el (prolog-pred-end)
(prolog-clause-info):
* lisp/progmodes/ruby-mode.el (ruby-forward-sexp)
(ruby-backward-sexp):
* lisp/progmodes/verilog-mode.el (verilog-repair-open-comma):
* lisp/term.el (term-within-quotes):
* lisp/textmodes/bib-mode.el (bib-capitalize-title-stop-words):
* lisp/textmodes/refbib.el (r2b-capitalize-title-stop-words):
* lisp/textmodes/reftex-parse.el (reftex-nth-arg):
* lisp/textmodes/rst.el (rst-svn-rev):
* lisp/url/url-http.el (url-http-parse-response):
* test/lisp/progmodes/f90-tests.el (f90-test-bug3730):
Fix regular expression typos.
2019-03-18 17:02:29 -07:00
Paul Eggert
3c94c7bc02 Fix regular-expression glitches and typos
Problems reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-03/msg00085.html
* admin/admin.el (set-version):
* lisp/allout.el (allout-latexify-one-item):
* lisp/arc-mode.el (archive-arc-rename-entry)
(archive-rar-summarize):
* lisp/calc/calc-graph.el (calc-graph-set-styles)
(calc-graph-hide):
* lisp/calc/calc-help.el (calc-describe-key):
* lisp/calc/calc-lang.el (math-compose-tex-func, eqn):
* lisp/calc/calc.el (calcDigit-key):
* lisp/cedet/ede/makefile-edit.el (makefile-macro-file-list):
* lisp/cedet/ede/speedbar.el (ede-tag-expand):
* lisp/cedet/semantic/sb.el (semantic-sb-show-extra)
(semantic-sb-expand-group):
* lisp/comint.el (comint-substitute-in-file-name):
* lisp/dired.el (dired-actual-switches):
* lisp/emacs-lisp/chart.el (chart-rmail-from):
* lisp/emacs-lisp/eieio-opt.el (eieio-sb-expand):
* lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar-object-expand):
* lisp/emacs-lisp/rx.el (rx-not, rx-atomic-p):
* lisp/emulation/viper-ex.el (viper-get-ex-token)
(viper-get-ex-pat, ex-set-read-variable):
* lisp/epg.el (epg--status-SIG_CREATED):
* lisp/erc/erc-speedbar.el (erc-speedbar-expand-user):
(erc-speedbar-expand-channel, erc-speedbar-expand-server)
* lisp/erc/erc.el (erc-is-message-ctcp-and-not-action-p)
(erc-banlist-update):
* lisp/eshell/em-dirs.el (eshell-parse-drive-letter, eshell/pwd):
* lisp/find-dired.el (find-dired):
* lisp/frame.el (frame-set-background-mode):
* lisp/generic-x.el (apache-log-generic-mode):
* lisp/gnus/gnus-art.el (gnus-button-valid-localpart-regexp):
* lisp/gnus/gnus.el (gnus-short-group-name):
* lisp/gnus/message.el (message-mailer-swallows-blank-line):
* lisp/ibuffer.el (ibuffer-fontification-alist):
* lisp/ido.el (ido-set-matches-1):
* lisp/info-xref.el (info-xref-lock-file-p):
* lisp/info.el (Info-dir-remove-duplicates)
(Info-unescape-quotes, Info-split-parameter-string)
(Info-speedbar-expand-node):
* lisp/international/mule.el (sgml-html-meta-auto-coding-function):
* lisp/isearch.el (isearch-pre-command-hook):
* lisp/language/ethio-util.el (ethio-fidel-to-tex-buffer):
* lisp/mail/rmail.el (rmail-collect-deleted):
* lisp/mh-e/mh-alias.el (mh-alias-suggest-alias):
* lisp/mh-e/mh-comp.el (mh-forward):
* lisp/mh-e/mh-search.el (mh-index-next-folder)
(mh-index-create-imenu-index):
* lisp/mh-e/mh-xface.el (mh-picon-get-image):
* lisp/minibuffer.el (completion--embedded-envvar-re):
* lisp/net/ange-ftp.el (ange-ftp-ls-parser):
* lisp/net/goto-addr.el (goto-address-mail-regexp)
(goto-address-find-address-at-point):
* lisp/net/pop3.el (pop3-read-response, pop3-user)
(pop3-pass, pop3-apop):
* lisp/net/tramp.el (tramp-ipv6-regexp)
(tramp-replace-environment-variables):
* lisp/nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* lisp/nxml/rng-uri.el (rng-uri-escape-multibyte):
* lisp/nxml/rng-xsd.el (rng-xsd-convert-any-uri):
* lisp/obsolete/pgg.el (pgg-fetch-key):
* lisp/obsolete/vip.el (vip-get-ex-token):
* lisp/org/ob-core.el (org-babel-string-read):
* lisp/org/org-agenda.el:
(org-agenda-add-entry-to-org-agenda-diary-file):
* lisp/org/org-element.el (org-element-keyword-parser):
* lisp/org/org-list.el (org-list-indent-item-generic):
* lisp/org/org-mhe.el (org-mhe-get-message-folder-from-index):
* lisp/org/org-mobile.el (org-mobile-apply):
* lisp/org/org-mouse.el (org-mouse-context-menu):
* lisp/org/org-plot.el (org-plot/gnuplot):
* lisp/org/org-protocol.el (org-protocol-flatten-greedy):
* lisp/org/org-table.el (org-table-copy-down)
(org-table-formula-make-cmp-string)
(org-table-get-stored-formulas, org-table-recalculate)
(org-table-edit-formulas):
* lisp/org/org.el (org-translate-link-from-planner)
(org-fill-line-break-nobreak-p):
* lisp/org/ox-ascii.el (org-ascii-item):
* lisp/org/ox-latex.el (org-latex-clean-invalid-line-breaks):
* lisp/org/ox.el (org-export-expand-include-keyword):
* lisp/progmodes/ada-xref.el (ada-treat-cmd-string):
* lisp/progmodes/cfengine.el (cfengine2-font-lock-keywords):
* lisp/progmodes/cperl-mode.el (cperl-to-comment-or-eol)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-have-help-regexp, cperl-word-at-point-hard)
(cperl-make-regexp-x):
* lisp/progmodes/dcl-mode.el (dcl-option-value-offset):
* lisp/progmodes/etags.el (tag-implicit-name-match-p):
* lisp/progmodes/fortran.el (fortran-fill):
* lisp/progmodes/gdb-mi.el (gdb-speedbar-expand-node)
(gdb-locals-handler-custom):
* lisp/progmodes/grep.el (grep-mode-font-lock-keywords):
* lisp/progmodes/gud.el (gud-jdb-find-source-using-classpath):
* lisp/progmodes/js.el (js--continued-expression-p):
* lisp/progmodes/m4-mode.el (m4-font-lock-keywords):
* lisp/progmodes/meta-mode.el (meta-indent-level-count):
* lisp/progmodes/mixal-mode.el (mixal-font-lock-keywords):
* lisp/progmodes/opascal.el (opascal-find-unit-in-directory):
* lisp/progmodes/pascal.el (pascal-progbeg-re):
* lisp/progmodes/ruby-mode.el (ruby-expression-expansion-re)
(ruby-expr-beg, ruby-parse-partial)
(ruby-toggle-string-quotes, ruby-font-lock-keywords):
* lisp/progmodes/sql.el (sql--make-help-docstring):
* lisp/progmodes/verilog-mode.el (verilog-coverpoint-re)
(verilog-skip-forward-comment-p)
(verilog-read-sub-decls-gate)
(verilog-read-auto-template-middle):
* lisp/progmodes/vhdl-mode.el (vhdl-resolve-env-variable)
(vhdl-speedbar-expand-project, vhdl-speedbar-expand-entity)
(vhdl-speedbar-expand-architecture)
(vhdl-speedbar-expand-config, vhdl-speedbar-expand-package)
(vhdl-speedbar-dired):
* lisp/speedbar.el (speedbar-dired, speedbar-tag-file)
(speedbar-tag-expand):
* lisp/textmodes/dns-mode.el (dns-mode-font-lock-keywords):
* lisp/textmodes/flyspell.el (flyspell-debug-signal-word-checked):
* lisp/textmodes/ispell.el (ispell-process-line):
* lisp/textmodes/reftex-cite.el (reftex-end-of-bib-entry):
* lisp/textmodes/reftex-ref.el (reftex-replace-prefix-escapes):
* lisp/url/url-parse.el (url-generic-parse-url):
* lisp/url/url-util.el (url-truncate-url-for-viewing):
* lisp/vc/diff-mode.el (diff-unified->context):
* lisp/vc/vc-bzr.el (vc-bzr-error-regexp-alist):
* lisp/vc/vc-cvs.el (vc-cvs-parse-status):
* lisp/woman.el (woman0-el, woman-if-ignore)
(woman-change-fonts):
* lisp/xdg.el (xdg--substitute-home-env):
Fix regular-expression infelicities and typos.

Fix regular expression typos
Fix typos reported by Mattias Engdegård in:
that occurred in preloaded modules.
* lisp/frame.el (frame-set-background-mode):
* lisp/international/mule.el (sgml-html-meta-auto-coding-function):
* lisp/isearch.el (isearch-pre-command-hook):
* lisp/minibuffer.el (completion--embedded-envvar-re):
2019-03-04 18:00:58 -08:00
Glenn Morris
83a9133e35 Merge from origin/emacs-26
ff9c962 ; * lisp/ldefs-boot.el: Update.
b4a251c * ; ChangeLog.3 update
d3104e3 * etc/AUTHORS: Update.
a19bfb7 Remove .art from the default list of ImageMagick extensions
6985caa Fix input after setting x-wait-for-event-timeout nil
715388a Fix two warnings in eshell.texi
d49cdd9 * lisp/minibuffer.el (completion-table-dynamic): Improve docs...
5dc4e51 * lisp/emacs-lisp/debug.el (debug-on-variable-change): Doc fi...
76ef805 Fix a typo in ELisp manual
b5e66f4 Update citations of Internet RFCs
57ece2a Fix handling of manpage references divided by hyphenation
7ad0cd6 * doc/misc/eshell.texi: Fix some @ref's.
12b7940 Fix a typo in lispref/syntax.texi

# Conflicts:
#	lisp/gnus/nnrss.el
#	lisp/mail/ietf-drums.el
2019-02-20 12:07:22 -08:00
João Távora
e8b6cc9a99 cycle-sort-function prevails in completion-all-sorted-completions
* lisp/minibuffer.el (completion-all-sorted-completions): If
completion table has cycle-sort-function, that prevails over other
sorting strategies.
2019-02-19 09:11:28 +00:00
Stefan Monnier
d49cdd92fc * lisp/minibuffer.el (completion-table-dynamic): Improve docstring 2019-02-18 13:00:44 -05:00
João Távora
0d19e08da6 Change scoring strategy for 'flex' completion style
The previous strategy had problems comparing scores of matches to
strings of different lengths.  This one seems slightly more sensible,
and uses a new constant `flex-score-match-tightness' instead of the
more abstract `flex-score-falloff'.

It's not completely without problems, and I think it shouldn't count
"holes" at the front and at the back, but that needs a different
"pattern-to-regexp" conversion in completion-pcm--hilit-commonality.

(defun test ()
  (mapcar (lambda (a)
            (cons (substring-no-properties a)
                  (get-text-property 0 'completion-score a)))
          (sort (completion-pcm--hilit-commonality
                  '(prefix "f" star "o" star "o" point)
                  '("foo"
                    "barfoobaz"
                    "foobarbaz"
                    "barbazfoo"
                    "fabrobazo"
                    "foot"
                    "foto"
                    "fotttttttttttttttttttttttto"))
      (lambda (a b)
        (> (get-text-property 0 'completion-score a)
           (get-text-property 0 'completion-score b))))))

(let ((flex-score-match-tightness 100)) (test))
=> (("foo" . 1.0)
    ("foot" . 0.375)
    ("foto" . 0.375)
    ("foobarbaz" . 0.16260162601626016) ;; one hole
    ("barbazfoo" . 0.16260162601626016) ;; one hole
    ("barfoobaz" . 0.10964912280701755) ;; two holes
    ("fabrobazo" . 0.10964912280701755) ;; two holes
    ("fotttttttttttttttttttttttto" . 0.04982561036372696))

(let ((flex-score-match-tightness 0.1)) (test))
=> (("foo" . 1.0)
    ("foot" . 0.375)
    ("foto" . 0.375)
    ("barfoobaz" . 0.007751937984496124) ;; two holes
    ("fabrobazo" . 0.007751937984496124) ;; two holes
    ("foobarbaz" . 0.00641025641025641)  ;; one hole
    ("barbazfoo" . 0.00641025641025641)  ;; one hole
    ("fotttttttttttttttttttttttto" . 0.0004789272030651341))

* lisp/minibuffer.el (flex-score-falloff): Rename to
flex-score-match-tightness.
(completion-pcm--hilit-commonality): Update function.
2019-02-14 23:33:49 +00:00
João Távora
959ba6ea79 * lisp/minibuffer.el (completion-styles-alist): Tweak flex's docstring 2019-02-14 13:46:40 +00:00
João Távora
b0e318d27f Score flex-style completions according to match tightness
The new completion style needs to score completion matches so that we
can use it later on when sorting the completions.  This is because
"foo" can flex-match "foobar", "frodo" and "barfromsober" but we
probably want "foobar" to appear at the top of the completion list.

This change introduces a scoring formula and adds scoring hints in the
candidate string's `completion-score' property.

* lisp/minibuffer.el (completion-pcm--hilit-commonality): Propertize
completion with 'completion-score
(flex-score-falloff): New variable.
2019-02-13 21:23:03 +00:00
João Távora
e4896fcb11 Add a new 'flex' completion style
* lisp/minibuffer.el (completion-styles-alist): Add flex.
(completion-substring--all-completions): Accept
transform-pattern-fn arg.
(completion-flex-all-completions, completion-flex-try-completion)
(completion-flex--make-flex-pattern): New functions.
2019-02-13 21:21:51 +00:00
João Távora
f845f8a279 Use minibuffer-default in completion-all-sorted-completions (bug#34083)
* lisp/minibuffer (completion-all-sorted-completions): Sort with the
default on top.
2019-01-25 13:04:43 +00:00