1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-18 10:16:51 +00:00

all-completions: Drop support for obsolete calling convention

* src/minibuf.c (Fall_completions):
* lisp/subr.el (all-completions): Drop support for old calling
convention, obsolete since 23.1.
* src/minibuf.c (Finternal_complete_buffer): Update caller.
This commit is contained in:
Stefan Kangas 2024-12-16 22:21:37 +01:00
parent 16eb038d47
commit 80dc431b5a
4 changed files with 7 additions and 24 deletions

View File

@ -966,21 +966,13 @@ too short). Both of those begin with the string @samp{foobar}.
@end smallexample
@end defun
@c Removed obsolete argument nospace.
@defun all-completions string collection &optional predicate
This function returns a list of all possible completions of
@var{string}. The arguments to this function
@c (aside from @var{nospace})
are the same as those of @code{try-completion}, and it
uses @code{completion-regexp-list} in the same way that
@code{try-completion} does.
@ignore
The optional argument @var{nospace} is obsolete. If it is
non-@code{nil}, completions that start with a space are ignored unless
@var{string} starts with a space.
@end ignore
If @var{collection} is a function, it is called with three arguments:
@var{string}, @var{predicate} and @code{t}; then @code{all-completions}
returns whatever the function returns. @xref{Programmed Completion}.

View File

@ -1017,6 +1017,9 @@ only continue the active repeating sequence.
** New function 'completion-table-with-metadata'.
It offers a more concise way to create a completion table with metadata.
+++
** 'all-completions' no longer supports the old calling convention.
* Changes in Emacs 31.1 on Non-Free Operating Systems

View File

@ -1973,8 +1973,6 @@ be a list of the form returned by `event-start' and `event-end'."
(side-effect-free t) (obsolete log "24.4"))
(log x 10))
(set-advertised-calling-convention
'all-completions '(string collection &optional predicate) "23.1")
(set-advertised-calling-convention 'unintern '(name obarray) "23.3")
(set-advertised-calling-convention 'indirect-function '(object) "25.1")
(set-advertised-calling-convention 'redirect-frame-focus '(frame focus-frame) "24.3")

View File

@ -1826,7 +1826,7 @@ or from one of the possible completions. */)
return Fsubstring (bestmatch, zero, end);
}
DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 4, 0,
DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 3, 0,
doc: /* Search for partial matches of STRING in COLLECTION.
Test each possible completion specified by COLLECTION
@ -1859,12 +1859,8 @@ the string key and the associated value.
To be acceptable, a possible completion must also match all the regexps
in `completion-regexp-list' (unless COLLECTION is a function, in
which case that function should itself handle `completion-regexp-list').
An obsolete optional fourth argument HIDE-SPACES is still accepted for
backward compatibility. If non-nil, strings in COLLECTION that start
with a space are ignored unless STRING itself starts with a space. */)
(Lisp_Object string, Lisp_Object collection, Lisp_Object predicate, Lisp_Object hide_spaces)
which case that function should itself handle `completion-regexp-list'). */)
(Lisp_Object string, Lisp_Object collection, Lisp_Object predicate)
{
Lisp_Object tail, elt, eltstring;
Lisp_Object allmatches;
@ -1932,12 +1928,6 @@ with a space are ignored unless STRING itself starts with a space. */)
if (STRINGP (eltstring)
&& SCHARS (string) <= SCHARS (eltstring)
/* If HIDE_SPACES, reject alternatives that start with space
unless the input starts with space. */
&& (NILP (hide_spaces)
|| (SBYTES (string) > 0
&& SREF (string, 0) == ' ')
|| SREF (eltstring, 0) != ' ')
&& (tem = Fcompare_strings (eltstring, zero,
make_fixnum (SCHARS (string)),
string, zero,
@ -2155,7 +2145,7 @@ If FLAG is nil, invoke `try-completion'; if it is t, invoke
return Ftry_completion (string, Vbuffer_alist, predicate);
else if (EQ (flag, Qt))
{
Lisp_Object res = Fall_completions (string, Vbuffer_alist, predicate, Qnil);
Lisp_Object res = Fall_completions (string, Vbuffer_alist, predicate);
if (SCHARS (string) > 0)
return res;
else