branch: externals/compat
commit 351ca7852b74628f7021a5339ed5183d888d719f
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    Revert "compat-defun: Add :min-version argument"
    
    This reverts commit e2d66a88161e3c5df12469c40a63d896f16cea76.
---
 compat-30.el   | 43 ++++++++++++++++++++++---------------------
 compat-macs.el | 16 +++++-----------
 2 files changed, 27 insertions(+), 32 deletions(-)

diff --git a/compat-30.el b/compat-30.el
index 933cece2bd..cd9ad76ea1 100644
--- a/compat-30.el
+++ b/compat-30.el
@@ -182,29 +182,30 @@ By default we choose the head of the first list."
 
 (compat-defun copy-tree (tree &optional vectors-and-records) ;; 
<compat-tests:copy-tree>
   "Handle copying records when optional arg is non-nil."
-  :min-version "26.1" ;; recordp is only available on Emacs 26.1 and newer
   :extended t
   (declare (side-effect-free error-free))
-  (if (consp tree)
-      (let (result)
-        (while (consp tree)
-          (let ((newcar (car tree)))
-            (if (or (consp (car tree))
-                    (and vectors-and-records
-                         (or (vectorp (car tree)) (recordp (car tree)))))
-                (setq newcar (compat--copy-tree (car tree) 
vectors-and-records)))
-            (push newcar result))
-          (setq tree (cdr tree)))
-        (nconc (nreverse result)
-               (if (and vectors-and-records (or (vectorp tree) (recordp tree)))
-                   (compat--copy-tree tree vectors-and-records)
-                 tree)))
-    (if (and vectors-and-records (or (vectorp tree) (recordp tree)))
-        (let ((i (length (setq tree (copy-sequence tree)))))
-          (while (>= (setq i (1- i)) 0)
-            (aset tree i (compat--copy-tree (aref tree i) 
vectors-and-records)))
-          tree)
-      tree)))
+  (if (fboundp 'recordp)
+      (if (consp tree)
+          (let (result)
+            (while (consp tree)
+              (let ((newcar (car tree)))
+                (if (or (consp (car tree))
+                        (and vectors-and-records
+                             (or (vectorp (car tree)) (recordp (car tree)))))
+                    (setq newcar (compat--copy-tree (car tree) 
vectors-and-records)))
+                (push newcar result))
+              (setq tree (cdr tree)))
+            (nconc (nreverse result)
+                   (if (and vectors-and-records (or (vectorp tree) (recordp 
tree)))
+                       (compat--copy-tree tree vectors-and-records)
+                     tree)))
+        (if (and vectors-and-records (or (vectorp tree) (recordp tree)))
+            (let ((i (length (setq tree (copy-sequence tree)))))
+              (while (>= (setq i (1- i)) 0)
+                (aset tree i (compat--copy-tree (aref tree i) 
vectors-and-records)))
+              tree)
+          tree))
+    (copy-tree tree vectors-and-records)))
 
 (compat-defmacro static-if (condition then-form &rest else-forms) ;; 
<compat-tests:static-if>
   "A conditional compilation macro.
diff --git a/compat-macs.el b/compat-macs.el
index 88450bea15..ffd5223305 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -75,9 +75,8 @@ a plist of predicates for arguments which are passed to FUN."
   (declare (indent 2))
   (compat-macs--assert compat-macs--version "No `compat-version' was declared")
   (let* ((body (compat-macs--check-attributes
-                attrs `(,@preds :min-version stringp :feature symbolp)))
+                attrs `(,@preds :feature symbolp)))
          (feature (plist-get attrs :feature))
-         (min-version (plist-get attrs :min-version))
          (attrs `(:body ,body ,@attrs))
          args)
     ;; Require feature at compile time
@@ -85,9 +84,7 @@ a plist of predicates for arguments which are passed to FUN."
       (compat-macs--assert (not (eq feature 'subr-x)) "Invalid feature subr-x")
       (require feature))
     ;; The current Emacs must be older than the currently declared version.
-    (when (and (version< emacs-version compat-macs--version)
-               (or (not min-version)
-                   (version<= min-version emacs-version)))
+    (when (version< emacs-version compat-macs--version)
       (while preds
         (push (plist-get attrs (car preds)) args)
         (setq preds (cddr preds)))
@@ -149,9 +146,6 @@ overridden.  REST is an attribute plist followed by the 
definition
 body.  The attributes specify the conditions under which the
 definition is generated.
 
-- :min-version :: Only compile the definition for Emacs versions
-  newer than the given version.
-
 - :feature :: Wrap the definition with `with-eval-after-load' for
   the given feature."
   (declare (debug ([&rest keywordp sexp] def-body))
@@ -171,7 +165,7 @@ under which the definition is generated.
 
 - :obsolete :: Mark the alias as obsolete if t.
 
-- :feature and :min-version :: See `compat-guard'."
+- :feature :: See `compat-guard'."
   (declare (debug (name symbolp [&rest keywordp sexp])))
   (compat-macs--guard attrs '(:obsolete booleanp)
     (lambda (obsolete)
@@ -203,7 +197,7 @@ specify the conditions under which the definition is 
generated.
 - :obsolete :: Mark the function as obsolete if t, can be a
   string describing the obsoletion.
 
-- :feature and :min-version :: See `compat-guard'."
+- :feature :: See `compat-guard'."
   (declare (debug (&define name (&rest symbolp)
                            stringp
                            [&rest keywordp sexp]
@@ -233,7 +227,7 @@ definition is generated.
 - :obsolete :: Mark the variable as obsolete if t, can be a
   string describing the obsoletion.
 
-- :feature and :min-version :: See `compat-guard'."
+- :feature :: See `compat-guard'."
   (declare (debug (name form stringp [&rest keywordp sexp]))
            (doc-string 3) (indent 2))
   (compat-macs--guard

Reply via email to