[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat c298296454 56/77: Revert "compat-30: Add sort-on
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat c298296454 56/77: Revert "compat-30: Add sort-on" |
Date: |
Mon, 24 Jun 2024 12:59:01 -0400 (EDT) |
branch: externals/compat
commit c298296454d13fd7741633bbb9f55e0f0bccf7fd
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Revert "compat-30: Add sort-on"
This reverts commit 31899a2a4d04335512a52f120087f699c00da693.
---
NEWS.org | 1 -
compat-30.el | 21 ---------------------
compat-tests.el | 6 ------
compat.texi | 20 --------------------
4 files changed, 48 deletions(-)
diff --git a/NEWS.org b/NEWS.org
index c417bb3a84..12ee07634d 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -4,7 +4,6 @@
* Release of "Compat" Version 29.1.4.5
-- compat-30: Add =sort-on=.
- compat-30: Add extended =copy-tree= with support for copying records with
non-nil optional second argument.
- compat-30: New macro =static-if=.
diff --git a/compat-30.el b/compat-30.el
index a831c4e2af..cd9ad76ea1 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>
diff --git a/compat-tests.el b/compat-tests.el
index 57a707746d..d88542526b 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -1753,12 +1753,6 @@
(should-equal '(1 2 3 4) (flatten-tree '((1) nil 2 ((3 4)))))
(should-equal '(1 2 3 4) (flatten-tree '(((1 nil)) 2 (((3 nil nil) 4))))))
-(ert-deftest compat-sort-on ()
- (should-equal '(3 2 1) (sort-on '(2 1 3) #'> #'identity))
- (should-equal '(1 2 3) (sort-on [2 1 3] #'< #'identity))
- (should-equal '((1 z) (2 y) (3 x)) (sort-on (list '(2 y) '(1 z) '(3 x)) #'<
#'car))
- (should-equal '((x 3) (y 2) (z 1)) (sort-on (list '(y 2) '(z 1) '(x 3)) #'>
#'cadr)))
-
(ert-deftest compat-sort ()
(should-equal (list 1 2 3) (sort (list 1 2 3) #'<))
(should-equal (list 1 2 3) (sort (list 1 3 2) #'<))
diff --git a/compat.texi b/compat.texi
index 7cae51fa51..68ae8766b9 100644
--- a/compat.texi
+++ b/compat.texi
@@ -3350,26 +3350,6 @@ older than 30.1. Note that due to upstream changes, it
might happen
that there will be the need for changes, so use these functions with
care.
-@c copied from lispref/sequences.texi
-@defun sort-on sequence predicate accessor
-This function stably sorts the list @var{sequence}, comparing the sort
-keys of the elements using @var{predicate}. The comparison function
-@var{predicate} accepts two arguments, the sort keys to compare, and
-should return non-@code{nil} if the element corresponding to the first
-key should sort before the element corresponding to the second key.
-The function computes a sort key of each element by calling the
-@var{accessor} function on that element; it does so exactly once for
-each element of @var{sequence}. The @var{accessor} function is called
-with a single argument, an element of @var{sequence}.
-
-This function implements what is known as
-@dfn{decorate-sort-undecorate} paradigm, of the Schwartzian transform.
-It basically trades CPU for memory, creating a temporary list with the
-computed sport keys, then mapping @code{car} over the result of
-sorting that temporary list. Unlike with @code{sort}, the return list
-is a copy; the original list is left intact.
-@end defun
-
@defun get-truename-buffer filename
Return the buffer with @code{file-truename} equal to @var{filename} (a string).
If there is no such live buffer, return nil.
- [elpa] externals/compat aad50e1ffc 27/77: Merge branch 'main' into emacs-30, (continued)
- [elpa] externals/compat aad50e1ffc 27/77: Merge branch 'main' into emacs-30, ELPA Syncer, 2024/06/24
- [elpa] externals/compat bb0b922bb7 23/77: Merge branch 'main' into emacs-30, ELPA Syncer, 2024/06/24
- [elpa] externals/compat 3a415950d4 34/77: Merge branch 'main' into emacs-30, ELPA Syncer, 2024/06/24
- [elpa] externals/compat 4eb3d03632 37/77: Merge branch 'main' into emacs-30, ELPA Syncer, 2024/06/24
- [elpa] externals/compat 82323d82d3 39/77: Merge branch 'main' into emacs-30, ELPA Syncer, 2024/06/24
- [elpa] externals/compat 9d5f99fcaa 43/77: Merge branch 'main' into emacs-30, ELPA Syncer, 2024/06/24
- [elpa] externals/compat 351ca7852b 46/77: Revert "compat-defun: Add :min-version argument", ELPA Syncer, 2024/06/24
- [elpa] externals/compat 80e663a48b 47/77: Merge branch 'main' into emacs-30, ELPA Syncer, 2024/06/24
- [elpa] externals/compat 68f99b6970 54/77: Merge branch 'main' into emacs-30, ELPA Syncer, 2024/06/24
- [elpa] externals/compat 76534f1440 57/77: Update news, ELPA Syncer, 2024/06/24
- [elpa] externals/compat c298296454 56/77: Revert "compat-30: Add sort-on",
ELPA Syncer <=
- [elpa] externals/compat 38aba13d75 62/77: compat-30: Make value< type checking more strict, ELPA Syncer, 2024/06/24
- [elpa] externals/compat 84641a11e8 64/77: value<: Fix behavior for values of equal type., ELPA Syncer, 2024/06/24
- [elpa] externals/compat e8c9f3bbd3 68/77: sort: Fix handling of :reverse argument, ELPA Syncer, 2024/06/24
- [elpa] externals/compat ec06bc858f 66/77: value<: Processes are compared by name., ELPA Syncer, 2024/06/24
- [elpa] externals/compat b12b2e5cbe 69/77: compat-30: Ensure that list is not sorted destructively on Emacs 24.4, ELPA Syncer, 2024/06/24
- [elpa] externals/compat 0b4f2eafa4 70/77: compat-30: Add obarray-clear, ELPA Syncer, 2024/06/24
- [elpa] externals/compat 2f14cbb732 71/77: Revert "Remove unnecessary dir-locals", ELPA Syncer, 2024/06/24
- [elpa] externals/compat 3748c0b0c1 72/77: Merge branch 'main' into emacs-30, ELPA Syncer, 2024/06/24
- [elpa] externals/compat f4c38110b4 63/77: compat-30: Add primitive-function-p, interpreted-function-p and closurep, ELPA Syncer, 2024/06/24
- [elpa] externals/compat d59333f9a1 67/77: value<: Update error message, ELPA Syncer, 2024/06/24