[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 80dc431b5a4 1/2: all-completions: Drop support for obsolete calli
From: |
Stefan Kangas |
Subject: |
master 80dc431b5a4 1/2: all-completions: Drop support for obsolete calling convention |
Date: |
Mon, 16 Dec 2024 19:00:15 -0500 (EST) |
branch: master
commit 80dc431b5a453c8200260969c8e2904e2d353b1e
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>
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.
---
doc/lispref/minibuf.texi | 8 --------
etc/NEWS | 3 +++
lisp/subr.el | 2 --
src/minibuf.c | 18 ++++--------------
4 files changed, 7 insertions(+), 24 deletions(-)
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index c5b9176d628..8f7d93c2749 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -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}.
diff --git a/etc/NEWS b/etc/NEWS
index 49a6fcf3fc8..7066ce2ce37 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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
diff --git a/lisp/subr.el b/lisp/subr.el
index 02cc84c04b7..fbd142493af 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -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")
diff --git a/src/minibuf.c b/src/minibuf.c
index 1f94e0e650e..9fd5c236f0b 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -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