diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2024-03-23 18:49:01 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2024-03-23 18:49:01 +0100 |
| commit | c298296454d13fd7741633bbb9f55e0f0bccf7fd (patch) | |
| tree | 30daada5cbca39f0a7491da8e4a50be4a8990093 /compat-30.el | |
| parent | 7d116d87934f948ad2556d5443358a55e465bc4d (diff) | |
Revert "compat-30: Add sort-on"
This reverts commit 31899a2a4d04335512a52f120087f699c00da693.
Diffstat (limited to 'compat-30.el')
| -rw-r--r-- | compat-30.el | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/compat-30.el b/compat-30.el index a831c4e..cd9ad76 100644 --- a/compat-30.el +++ b/compat-30.el @@ -27,27 +27,6 @@ ;; TODO Update to 30.1 as soon as the Emacs emacs-30 branch version bumped (compat-version "30.0.50") -;;;; Defined in sort.el - -(compat-defun sort-on (sequence predicate accessor) ;; <compat-tests:sort-on> - "Sort SEQUENCE by calling PREDICATE on sort keys produced by ACCESSOR. -SEQUENCE should be the input list to sort. -Elements of SEQUENCE are sorted by keys which are obtained by -calling ACCESSOR on each element. ACCESSOR should be a function of -one argument, an element of SEQUENCE, and should return the key -value to be compared by PREDICATE for sorting the element. -PREDICATE is the function for comparing keys; it is called with two -arguments, the keys to compare, and should return non-nil if the -first key should sort before the second key. -This function has the performance advantage of evaluating -ACCESSOR only once for each element in the input SEQUENCE, and is -therefore appropriate when computing the key by ACCESSOR is an -expensive operation. This is known as the \"decorate-sort-undecorate\" -paradigm, or the Schwartzian transform." - (mapcar #'car - (sort (mapcar #'(lambda (x) (cons x (funcall accessor x))) sequence) - #'(lambda (x y) (funcall predicate (cdr x) (cdr y)))))) - ;;;; Defined in buffer.c (compat-defun find-buffer (variable value) ;; <compat-tests:find-buffer> |
