aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2024-12-16 22:21:37 +0100
committerStefan Kangas2024-12-16 23:04:18 +0100
commit80dc431b5a453c8200260969c8e2904e2d353b1e (patch)
tree8abfbd0efe0e875748628e96c645081bb321321e
parent16eb038d472b5765beb3b18e1058846efbdf97af (diff)
downloademacs-80dc431b5a453c8200260969c8e2904e2d353b1e.tar.gz
emacs-80dc431b5a453c8200260969c8e2904e2d353b1e.zip
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.
-rw-r--r--doc/lispref/minibuf.texi8
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/subr.el2
-rw-r--r--src/minibuf.c18
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}.
966@end smallexample 966@end smallexample
967@end defun 967@end defun
968 968
969@c Removed obsolete argument nospace.
970@defun all-completions string collection &optional predicate 969@defun all-completions string collection &optional predicate
971This function returns a list of all possible completions of 970This function returns a list of all possible completions of
972@var{string}. The arguments to this function 971@var{string}. The arguments to this function
973@c (aside from @var{nospace})
974are the same as those of @code{try-completion}, and it 972are the same as those of @code{try-completion}, and it
975uses @code{completion-regexp-list} in the same way that 973uses @code{completion-regexp-list} in the same way that
976@code{try-completion} does. 974@code{try-completion} does.
977 975
978@ignore
979The optional argument @var{nospace} is obsolete. If it is
980non-@code{nil}, completions that start with a space are ignored unless
981@var{string} starts with a space.
982@end ignore
983
984If @var{collection} is a function, it is called with three arguments: 976If @var{collection} is a function, it is called with three arguments:
985@var{string}, @var{predicate} and @code{t}; then @code{all-completions} 977@var{string}, @var{predicate} and @code{t}; then @code{all-completions}
986returns whatever the function returns. @xref{Programmed Completion}. 978returns 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.
1017** New function 'completion-table-with-metadata'. 1017** New function 'completion-table-with-metadata'.
1018It offers a more concise way to create a completion table with metadata. 1018It offers a more concise way to create a completion table with metadata.
1019 1019
1020+++
1021** 'all-completions' no longer supports the old calling convention.
1022
1020 1023
1021* Changes in Emacs 31.1 on Non-Free Operating Systems 1024* Changes in Emacs 31.1 on Non-Free Operating Systems
1022 1025
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'."
1973 (side-effect-free t) (obsolete log "24.4")) 1973 (side-effect-free t) (obsolete log "24.4"))
1974 (log x 10)) 1974 (log x 10))
1975 1975
1976(set-advertised-calling-convention
1977 'all-completions '(string collection &optional predicate) "23.1")
1978(set-advertised-calling-convention 'unintern '(name obarray) "23.3") 1976(set-advertised-calling-convention 'unintern '(name obarray) "23.3")
1979(set-advertised-calling-convention 'indirect-function '(object) "25.1") 1977(set-advertised-calling-convention 'indirect-function '(object) "25.1")
1980(set-advertised-calling-convention 'redirect-frame-focus '(frame focus-frame) "24.3") 1978(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. */)
1826 return Fsubstring (bestmatch, zero, end); 1826 return Fsubstring (bestmatch, zero, end);
1827} 1827}
1828 1828
1829DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 4, 0, 1829DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 3, 0,
1830 doc: /* Search for partial matches of STRING in COLLECTION. 1830 doc: /* Search for partial matches of STRING in COLLECTION.
1831 1831
1832Test each possible completion specified by COLLECTION 1832Test each possible completion specified by COLLECTION
@@ -1859,12 +1859,8 @@ the string key and the associated value.
1859 1859
1860To be acceptable, a possible completion must also match all the regexps 1860To be acceptable, a possible completion must also match all the regexps
1861in `completion-regexp-list' (unless COLLECTION is a function, in 1861in `completion-regexp-list' (unless COLLECTION is a function, in
1862which case that function should itself handle `completion-regexp-list'). 1862which case that function should itself handle `completion-regexp-list'). */)
1863 1863 (Lisp_Object string, Lisp_Object collection, Lisp_Object predicate)
1864An obsolete optional fourth argument HIDE-SPACES is still accepted for
1865backward compatibility. If non-nil, strings in COLLECTION that start
1866with a space are ignored unless STRING itself starts with a space. */)
1867 (Lisp_Object string, Lisp_Object collection, Lisp_Object predicate, Lisp_Object hide_spaces)
1868{ 1864{
1869 Lisp_Object tail, elt, eltstring; 1865 Lisp_Object tail, elt, eltstring;
1870 Lisp_Object allmatches; 1866 Lisp_Object allmatches;
@@ -1932,12 +1928,6 @@ with a space are ignored unless STRING itself starts with a space. */)
1932 1928
1933 if (STRINGP (eltstring) 1929 if (STRINGP (eltstring)
1934 && SCHARS (string) <= SCHARS (eltstring) 1930 && SCHARS (string) <= SCHARS (eltstring)
1935 /* If HIDE_SPACES, reject alternatives that start with space
1936 unless the input starts with space. */
1937 && (NILP (hide_spaces)
1938 || (SBYTES (string) > 0
1939 && SREF (string, 0) == ' ')
1940 || SREF (eltstring, 0) != ' ')
1941 && (tem = Fcompare_strings (eltstring, zero, 1931 && (tem = Fcompare_strings (eltstring, zero,
1942 make_fixnum (SCHARS (string)), 1932 make_fixnum (SCHARS (string)),
1943 string, zero, 1933 string, zero,
@@ -2155,7 +2145,7 @@ If FLAG is nil, invoke `try-completion'; if it is t, invoke
2155 return Ftry_completion (string, Vbuffer_alist, predicate); 2145 return Ftry_completion (string, Vbuffer_alist, predicate);
2156 else if (EQ (flag, Qt)) 2146 else if (EQ (flag, Qt))
2157 { 2147 {
2158 Lisp_Object res = Fall_completions (string, Vbuffer_alist, predicate, Qnil); 2148 Lisp_Object res = Fall_completions (string, Vbuffer_alist, predicate);
2159 if (SCHARS (string) > 0) 2149 if (SCHARS (string) > 0)
2160 return res; 2150 return res;
2161 else 2151 else