-
-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with completion "ivy--shorter-matches-first: Wrong number of arguments: #<subr sort>, 3" #3052
Comments
What does typing And would you mind including here the information gathered by Thanks. |
I have the same problem, and have had it for at least a month, but finally now sat down to try to figure it out. It's (only) when I try to complete something in
My reportIn GNU Emacs 29.4 (build 1, aarch64-apple-darwin23.5.0, NS appkit-2487.60 Version 14.5 (Build 23F79)) of 2024-06-30 built on Kyrres-MacBook-Pro.local Windowing system distributor 'Apple', version 10.3.2487 System Description: macOS 14.6.1 Configured using: Configured features: Important settings: Major mode: Messages Minor modes in effect: Load-path shadows: Features: Memory information: |
Thanks.
The shell completion SNAFU sounds rather like #1755 and #3051, so I wonder if the symptoms are just incidental here.
This is a bit odd, since both So I wonder if these definitions are actually polyfills provided by...
...the
But then I'm confused, because I thought the same package also polyfills the new arity of I'll try to have a poke around soon, but in the meantime any extra info you come up with will be helpful. |
For example, where does |
I have the same issue. In my case, various magit-related packages that I use (magit, forge, ghub, git-modes, etc) pull in a dependency called compat that does indeed define (sort (list 3 2 1) #'<)
(1 2 3)
(compat-call sort (list 3 2 1) :lessp #'value<)
(1 2 3) I assume compat is loaded before ivy in my config, so in (documentation 'sort)
"Sort SEQ, stably, comparing elements using PREDICATE.
Returns the sorted sequence. SEQ should be a list or vector. SEQ is
modified by side effects. PREDICATE is called with two elements of
SEQ, and should return non-nil if the first element should sort before
the second.
(fn SEQ PREDICATE)" (documentation 'compat--sort)
"[Compatibility function for ‘sort’, defined in Emacs 30.0.50. See (compat) Emacs
30.0.50’ for more details.]
Sort function with support for keyword arguments. The following arguments are
defined:
:key FUNC -- FUNC is a function that takes a single element from SEQ and returns
the key value to be used in comparison. If absent or nil, ‘identity’ is used.
:lessp FUNC -- FUNC is a function that takes two arguments and returns non-nil
if the first element should come before the second. If absent or nil,
‘value<’ is used.
:reverse BOOL -- if BOOL is non-nil, the sorting order implied by FUNC is
reversed. This does not affect stability: equal elements still retain their
order in the input sequence.
:in-place BOOL -- if BOOL is non-nil, SEQ is sorted in-place and returned.
Otherwise, a sorted copy of SEQ is returned and SEQ remains unmodified; this
is the default.
For compatibility, the calling convention (sort SEQ LESSP) can also be used; in
this case, sorting is always done in-place.
(fn SEQ &optional LESSP &rest REST)" |
You probably got your answer above, but I'll post info from my instance too.
|
Sorry I didn't come back to this. Here's some more information emacs-report-bug
(list (fboundp 'static-if) (fboundp 'value<))
The functions you asked for:
|
Thanks for the information; it seems clear that Sorry about the breakage and the delay! I aim to push a fix later today. |
* ivy.el (ivy--new-sort-p): New constant. (ivy--shorter-matches-first, ivy--flx-sort): * swiper.el (swiper--avy-candidates): Check ivy--new-sort-p instead of value<, which could be polyfilled by the compat package. Fixes #3052.
New polyfills coming to a GNU-devel ELPA (and MELPA) near you. I tested them in a bare Emacs 29.4 with Let me know if you encounter any problems with this. |
Thanks for fixing that so swiftly. Worked fine on my machine. |
After a recent upgrade of my packages, I started getting the following error when using completion-at-point
Digging into this, I saw commit 5b8436e had modified ivy--shorter-matches-first to use a new version of the built-in sort function that's available in Emacs 30. I'm running emacs 29.4 on MacOS.
Digging a bit further I found issue 3038 which describes using conditional compilation using static-if allowing a polyfill to run on older versions of Emacs such as mine.
But for some reason it's not working on my machine. I download packages using use-package and upgraded via list-packages. I'm running ivy version 20240524.1139.
The text was updated successfully, but these errors were encountered: