From: Stefan Kangas Date: Mon, 16 Dec 2024 21:21:37 +0000 (+0100) Subject: all-completions: Drop support for obsolete calling convention X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=37100e1e9016d0895992b8f9bb9e3c924565c48a;p=emacs.git 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. (cherry picked from commit 80dc431b5a453c8200260969c8e2904e2d353b1e) --- diff --git a/etc/NEWS b/etc/NEWS index 31711e0d0c1..85a202ee87c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -877,6 +877,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 51ecf8a910d..db05f1d6880 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1977,8 +1977,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 2f77dbecc07..404fdcca9c2 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1725,7 +1725,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 @@ -1754,12 +1754,8 @@ A possible completion is accepted only if PREDICATE returns non-nil. The argument given to PREDICATE is either a string or a cons cell (whose car is a string) from the alist, or a symbol from the obarray. If COLLECTION is a hash-table, PREDICATE is called with two arguments: -the string key and the associated value. - -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) +the string key and the associated value. */) + (Lisp_Object string, Lisp_Object collection, Lisp_Object predicate) { Lisp_Object tail, elt, eltstring; Lisp_Object allmatches; @@ -1827,12 +1823,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,