emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/compat 178e0a067d 1/6: Add links from compatibility fun


From: ELPA Syncer
Subject: [elpa] externals/compat 178e0a067d 1/6: Add links from compatibility functions to tests
Date: Sun, 15 Jan 2023 17:57:30 -0500 (EST)

branch: externals/compat
commit 178e0a067dd456447d05d702c5b466bd1d5ba623
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Add links from compatibility functions to tests
---
 NEWS.org        |   1 +
 compat-25.el    |  26 +++++++-------
 compat-26.el    | 110 ++++++++++++++++++++++++++++----------------------------
 compat-27.el    |  74 +++++++++++++++++++-------------------
 compat-28.el    |  70 ++++++++++++++++++------------------
 compat-29.el    |  66 +++++++++++++++++-----------------
 compat-tests.el |  28 ++++++++++++---
 7 files changed, 198 insertions(+), 177 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index dffc7d8cc6..9ea2f35a4c 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -2,6 +2,7 @@
 
 * Development
 
+- Add links from compatibility definitions to tests.
 - compat-26: Add ~buffer-hash~.
 - compat-27: Add ~fixnump~ and ~bignump~.
 - compat-27: Add ~with-minibuffer-selected-window~.
diff --git a/compat-25.el b/compat-25.el
index bc9449b7f0..ad828d1dc8 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -27,7 +27,7 @@
 
 ;;;; Defined in alloc.c
 
-(compat-defun bool-vector (&rest objects) ;; <OK>
+(compat-defun bool-vector (&rest objects) ;; [[compat-tests:bool-vector]]
   "Return a new bool-vector with specified arguments as elements.
 Allows any number of arguments, including zero.
 usage: (bool-vector &rest OBJECTS)"
@@ -42,7 +42,7 @@ usage: (bool-vector &rest OBJECTS)"
 
 ;;;; Defined in fns.c
 
-(compat-defun sort (seq predicate) ;; <OK>
+(compat-defun sort (seq predicate) ;; [[compat-tests:sort]]
   "Extend `sort' to sort SEQ as a vector."
   :explicit t
   (cond
@@ -59,11 +59,11 @@ usage: (bool-vector &rest OBJECTS)"
 
 ;;;; Defined in editfns.c
 
-(compat-defalias format-message format) ;; <OK>
+(compat-defalias format-message format) ;; [[compat-tests:format-message]]
 
 ;;;; Defined in fileio.c
 
-(compat-defun directory-name-p (name) ;; <OK>
+(compat-defun directory-name-p (name) ;; [[compat-tests:directory-name-p]]
   "Return non-nil if NAME ends with a directory separator character."
   (eq (eval-when-compile
         (if (memq system-type '(cygwin windows-nt ms-dos))
@@ -72,13 +72,13 @@ usage: (bool-vector &rest OBJECTS)"
 
 ;;;; Defined in subr.el
 
-(compat-defun string-greaterp (string1 string2) ;; <OK>
+(compat-defun string-greaterp (string1 string2) ;; 
[[compat-tests:string-greaterp]]
   "Return non-nil if STRING1 is greater than STRING2 in lexicographic order.
 Case is significant.
 Symbols are also allowed; their print names are used instead."
   (string-lessp string2 string1))
 
-(compat-defmacro with-file-modes (modes &rest body) ;; <OK>
+(compat-defmacro with-file-modes (modes &rest body) ;; 
[[compat-tests:with-file-modes]]
   "Execute BODY with default file permissions temporarily set to MODES.
 MODES is as for `set-default-file-modes'."
   (declare (indent 1) (debug t))
@@ -90,7 +90,7 @@ MODES is as for `set-default-file-modes'."
              ,@body)
          (set-default-file-modes ,umask)))))
 
-(compat-defun alist-get (key alist &optional default remove) ;; <OK>
+(compat-defun alist-get (key alist &optional default remove) ;; 
[[compat-tests:alist-get]]
   "Return the value associated with KEY in ALIST, using `assq'.
 If KEY is not found in ALIST, return DEFAULT.
 This is a generalized variable suitable for use with `setf'.
@@ -100,7 +100,7 @@ means to remove KEY from ALIST if the new value is `eql' to 
DEFAULT."
   (let ((x (assq key alist)))
     (if x (cdr x) default)))
 
-(compat-defmacro if-let (spec then &rest else) ;; <OK>
+(compat-defmacro if-let (spec then &rest else) ;; [[compat-tests:if-let]]
   "Bind variables according to SPEC and evaluate THEN or ELSE.
 Evaluate each binding in turn, as in `let*', stopping if a
 binding value is nil.  If all are non-nil return the value of
@@ -134,7 +134,7 @@ with an old syntax that accepted only one binding."
     `(let* ,(nreverse list)
        (if ,(caar list) ,then ,@else))))
 
-(compat-defmacro when-let (spec &rest body) ;; <OK>
+(compat-defmacro when-let (spec &rest body) ;; [[compat-tests:when-let]]
   "Bind variables according to SPEC and conditionally evaluate BODY.
 Evaluate each binding in turn, stopping if a binding value is nil.
 If all are non-nil, return the value of the last form in BODY.
@@ -145,7 +145,7 @@ The variable list SPEC is the same as in `if-let'."
 
 ;;;; Defined in subr-x.el
 
-(compat-defmacro thread-first (&rest forms) ;; <OK>
+(compat-defmacro thread-first (&rest forms) ;; [[compat-tests:thread-first]]
   "Thread FORMS elements as the first argument of their successor.
 Example:
     (thread-first
@@ -169,7 +169,7 @@ threading."
                          (cdr form))))
     body))
 
-(compat-defmacro thread-last (&rest forms) ;; <OK>
+(compat-defmacro thread-last (&rest forms) ;; [[compat-tests:thread-last]]
   "Thread FORMS elements as the last argument of their successor.
 Example:
     (thread-last
@@ -192,7 +192,7 @@ threading."
 
 ;;;; Defined in macroexp.el
 
-(compat-defun macroexpand-1 (form &optional environment) ;; <OK>
+(compat-defun macroexpand-1 (form &optional environment) ;; 
[[compat-tests:macroexpand-1]]
   "Perform (at most) one step of macro expansion."
   (cond
    ((consp form)
@@ -218,7 +218,7 @@ threading."
 
 ;;;; Defined in byte-run.el
 
-(compat-defalias function-put put) ;; <OK>
+(compat-defalias function-put put) ;; [[compat-tests:function-put]]
 
 (provide 'compat-25)
 ;;; compat-25.el ends here
diff --git a/compat-26.el b/compat-26.el
index 123ac4d5ef..7848be85e5 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -27,7 +27,7 @@
 
 ;;;; Defined in fns.c
 
-(compat-defun buffer-hash (&optional buffer-or-name) ;; <OK>
+(compat-defun buffer-hash (&optional buffer-or-name) ;; 
[[compat-tests:buffer-hash]]
    "Return a hash of the contents of BUFFER-OR-NAME.
 This hash is performed on the raw internal format of the buffer,
 disregarding any coding systems.  If nil, use the current buffer.
@@ -44,7 +44,7 @@ It should not be used for anything security-related.  See
        (widen)
        (sha1 (current-buffer) (point-min) (point-max)))))
 
-(compat-defun assoc (key alist &optional testfn) ;; <OK>
+(compat-defun assoc (key alist &optional testfn) ;; [[compat-tests:assoc]]
   "Handle the optional TESTFN."
   :explicit t
   (if testfn
@@ -54,13 +54,13 @@ It should not be used for anything security-related.  See
             (throw 'found ent))))
     (assoc key alist)))
 
-(compat-defun mapcan (func sequence) ;; <OK>
+(compat-defun mapcan (func sequence) ;; [[compat-tests:mapcan]]
   "Apply FUNC to each element of SEQUENCE.
 Concatenate the results by altering them (using `nconc').
 SEQUENCE may be a list, a vector, a boolean vector, or a string."
   (apply #'nconc (mapcar func sequence)))
 
-(compat-defun line-number-at-pos (&optional position absolute) ;; <OK>
+(compat-defun line-number-at-pos (&optional position absolute) ;; 
[[compat-tests:line-number-at-pos]]
   "Handle optional argument ABSOLUTE."
   :explicit t
   (if absolute
@@ -71,7 +71,7 @@ SEQUENCE may be a list, a vector, a boolean vector, or a 
string."
 
 ;;;; Defined in subr.el
 
-(compat-defun alist-get (key alist &optional default remove testfn) ;; <OK>
+(compat-defun alist-get (key alist &optional default remove testfn) ;; 
[[compat-tests:alist-get]]
   "Handle optional argument TESTFN."
   :explicit t
   (if testfn
@@ -119,14 +119,14 @@ SEQUENCE may be a list, a vector, a boolean vector, or a 
string."
                                                  `(delq ,p ,getter))))))
                               ,v)))))))))))
 
-(compat-defun string-trim-left (string &optional regexp) ;; <OK>
+(compat-defun string-trim-left (string &optional regexp) ;; 
[[compat-tests:string-trim-left]]
   "Handle optional argument REGEXP."
   :explicit t
   (if (string-match (concat "\\`\\(?:" (or regexp "[ \t\n\r]+") "\\)") string)
       (substring string (match-end 0))
     string))
 
-(compat-defun string-trim-right (string &optional regexp) ;; <OK>
+(compat-defun string-trim-right (string &optional regexp) ;; 
[[compat-tests:string-trim-right]]
   "Handle optional argument REGEXP."
   :explicit t
   (let ((i (string-match-p
@@ -134,7 +134,7 @@ SEQUENCE may be a list, a vector, a boolean vector, or a 
string."
             string)))
     (if i (substring string 0 i) string)))
 
-(compat-defun string-trim (string &optional trim-left trim-right) ;; <OK>
+(compat-defun string-trim (string &optional trim-left trim-right) ;; 
[[compat-tests:string-trim]]
   "Handle optional arguments TRIM-LEFT and TRIM-RIGHT."
   :explicit t
   (compat--string-trim-left
@@ -143,130 +143,130 @@ SEQUENCE may be a list, a vector, a boolean vector, or 
a string."
     trim-right)
    trim-left))
 
-(compat-defun caaar (x) ;; <OK>
+(compat-defun caaar (x) ;; [[compat-tests:cXXXr]]
   "Return the `car' of the `car' of the `car' of X."
   (declare (pure t))
   (car (car (car x))))
 
-(compat-defun caadr (x) ;; <OK>
+(compat-defun caadr (x) ;; [[compat-tests:cXXXr]]
   "Return the `car' of the `car' of the `cdr' of X."
   (declare (pure t))
   (car (car (cdr x))))
 
-(compat-defun cadar (x) ;; <OK>
+(compat-defun cadar (x) ;; [[compat-tests:cXXXr]]
   "Return the `car' of the `cdr' of the `car' of X."
   (declare (pure t))
   (car (cdr (car x))))
 
-(compat-defun caddr (x) ;; <OK>
+(compat-defun caddr (x) ;; [[compat-tests:cXXXr]]
   "Return the `car' of the `cdr' of the `cdr' of X."
   (declare (pure t))
   (car (cdr (cdr x))))
 
-(compat-defun cdaar (x) ;; <OK>
+(compat-defun cdaar (x) ;; [[compat-tests:cXXXr]]
   "Return the `cdr' of the `car' of the `car' of X."
   (declare (pure t))
   (cdr (car (car x))))
 
-(compat-defun cdadr (x) ;; <OK>
+(compat-defun cdadr (x) ;; [[compat-tests:cXXXr]]
   "Return the `cdr' of the `car' of the `cdr' of X."
   (declare (pure t))
   (cdr (car (cdr x))))
 
-(compat-defun cddar (x) ;; <OK>
+(compat-defun cddar (x) ;; [[compat-tests:cXXXr]]
   "Return the `cdr' of the `cdr' of the `car' of X."
   (declare (pure t))
   (cdr (cdr (car x))))
 
-(compat-defun cdddr (x) ;; <OK>
+(compat-defun cdddr (x) ;; [[compat-tests:cXXXr]]
   "Return the `cdr' of the `cdr' of the `cdr' of X."
   (declare (pure t))
   (cdr (cdr (cdr x))))
 
-(compat-defun caaaar (x) ;; <OK>
+(compat-defun caaaar (x) ;; [[compat-tests:cXXXXr]]
   "Return the `car' of the `car' of the `car' of the `car' of X."
   (declare (pure t))
   (car (car (car (car x)))))
 
-(compat-defun caaadr (x) ;; <OK>
+(compat-defun caaadr (x) ;; [[compat-tests:cXXXXr]]
   "Return the `car' of the `car' of the `car' of the `cdr' of X."
   (declare (pure t))
   (car (car (car (cdr x)))))
 
-(compat-defun caadar (x) ;; <OK>
+(compat-defun caadar (x) ;; [[compat-tests:cXXXXr]]
   "Return the `car' of the `car' of the `cdr' of the `car' of X."
   (declare (pure t))
   (car (car (cdr (car x)))))
 
-(compat-defun caaddr (x) ;; <OK>
+(compat-defun caaddr (x) ;; [[compat-tests:cXXXXr]]
   "Return the `car' of the `car' of the `cdr' of the `cdr' of X."
   (declare (pure t))
   (car (car (cdr (cdr x)))))
 
-(compat-defun cadaar (x) ;; <OK>
+(compat-defun cadaar (x) ;; [[compat-tests:cXXXXr]]
   "Return the `car' of the `cdr' of the `car' of the `car' of X."
   (declare (pure t))
   (car (cdr (car (car x)))))
 
-(compat-defun cadadr (x) ;; <OK>
+(compat-defun cadadr (x) ;; [[compat-tests:cXXXXr]]
   "Return the `car' of the `cdr' of the `car' of the `cdr' of X."
   (declare (pure t))
   (car (cdr (car (cdr x)))))
 
-(compat-defun caddar (x) ;; <OK>
+(compat-defun caddar (x) ;; [[compat-tests:cXXXXr]]
   "Return the `car' of the `cdr' of the `cdr' of the `car' of X."
   (declare (pure t))
   (car (cdr (cdr (car x)))))
 
-(compat-defun cadddr (x) ;; <OK>
+(compat-defun cadddr (x) ;; [[compat-tests:cXXXXr]]
   "Return the `car' of the `cdr' of the `cdr' of the `cdr' of X."
   (declare (pure t))
   (car (cdr (cdr (cdr x)))))
 
-(compat-defun cdaaar (x) ;; <OK>
+(compat-defun cdaaar (x) ;; [[compat-tests:cXXXXr]]
   "Return the `cdr' of the `car' of the `car' of the `car' of X."
   (declare (pure t))
   (cdr (car (car (car x)))))
 
-(compat-defun cdaadr (x) ;; <OK>
+(compat-defun cdaadr (x) ;; [[compat-tests:cXXXXr]]
   "Return the `cdr' of the `car' of the `car' of the `cdr' of X."
   (declare (pure t))
   (cdr (car (car (cdr x)))))
 
-(compat-defun cdadar (x) ;; <OK>
+(compat-defun cdadar (x) ;; [[compat-tests:cXXXXr]]
   "Return the `cdr' of the `car' of the `cdr' of the `car' of X."
   (declare (pure t))
   (cdr (car (cdr (car x)))))
 
-(compat-defun cdaddr (x) ;; <OK>
+(compat-defun cdaddr (x) ;; [[compat-tests:cXXXXr]]
   "Return the `cdr' of the `car' of the `cdr' of the `cdr' of X."
   (declare (pure t))
   (cdr (car (cdr (cdr x)))))
 
-(compat-defun cddaar (x) ;; <OK>
+(compat-defun cddaar (x) ;; [[compat-tests:cXXXXr]]
   "Return the `cdr' of the `cdr' of the `car' of the `car' of X."
   (declare (pure t))
   (cdr (cdr (car (car x)))))
 
-(compat-defun cddadr (x) ;; <OK>
+(compat-defun cddadr (x) ;; [[compat-tests:cXXXXr]]
   "Return the `cdr' of the `cdr' of the `car' of the `cdr' of X."
   (declare (pure t))
   (cdr (cdr (car (cdr x)))))
 
-(compat-defun cdddar (x) ;; <OK>
+(compat-defun cdddar (x) ;; [[compat-tests:cXXXXr]]
   "Return the `cdr' of the `cdr' of the `cdr' of the `car' of X."
   (declare (pure t))
   (cdr (cdr (cdr (car x)))))
 
-(compat-defun cddddr (x) ;; <OK>
+(compat-defun cddddr (x) ;; [[compat-tests:cXXXXr]]
   "Return the `cdr' of the `cdr' of the `cdr' of the `cdr' of X."
   (declare (pure t))
   (cdr (cdr (cdr (cdr x)))))
 
-(compat-defvar gensym-counter 0 ;; <OK>
+(compat-defvar gensym-counter 0 ;; [[compat-tests:gensym]]
   "Number used to construct the name of the next symbol created by `gensym'.")
 
-(compat-defun gensym (&optional prefix) ;; <OK>
+(compat-defun gensym (&optional prefix) ;; [[compat-tests:gensym]]
   "Return a new uninterned symbol.
 The name is made by appending `gensym-counter' to PREFIX.
 PREFIX is a string, and defaults to \"g\"."
@@ -275,7 +275,7 @@ PREFIX is a string, and defaults to \"g\"."
                      (1+ gensym-counter)))))
     (make-symbol (format "%s%d" (or prefix "g") num))))
 
-(compat-defmacro if-let* (varlist then &rest else) ;; <OK>
+(compat-defmacro if-let* (varlist then &rest else) ;; [[compat-tests:if-let*]]
   "Bind variables according to VARLIST and evaluate THEN or ELSE.
 This is like `if-let' but doesn't handle a VARLIST of the form
 \(SYMBOL SOMETHING) specially."
@@ -293,14 +293,14 @@ This is like `if-let' but doesn't handle a VARLIST of the 
form
     `(let* ,(nreverse list)
        (if ,(caar list) ,then ,@else))))
 
-(compat-defmacro when-let* (varlist &rest body) ;; <OK>
+(compat-defmacro when-let* (varlist &rest body) ;; [[compat-tests:when-let*]]
   "Bind variables according to VARLIST and conditionally evaluate BODY.
 This is like `when-let' but doesn't handle a VARLIST of the form
 \(SYMBOL SOMETHING) specially."
   (declare (indent 1) (debug if-let*))
   (list 'if-let* varlist (macroexp-progn body)))
 
-(compat-defmacro and-let* (varlist &rest body) ;; <OK>
+(compat-defmacro and-let* (varlist &rest body) ;; [[compat-tests:and-let*]]
   "Bind variables according to VARLIST and conditionally evaluate BODY.
 Like `when-let*', except if BODY is empty and all the bindings
 are non-nil, then the result is non-nil."
@@ -320,7 +320,7 @@ are non-nil, then the result is non-nil."
 
 ;;;; Defined in files.el
 
-(compat-defvar mounted-file-systems ;; <OK>
+(compat-defvar mounted-file-systems ;; [[compat-tests:mounted-file-systems]]
     (eval-when-compile
       (if (memq system-type '(windows-nt cygwin))
           "^//[^/]+/"
@@ -328,7 +328,7 @@ are non-nil, then the result is non-nil."
          "^" (regexp-opt '("/afs/" "/media/" "/mnt" "/net/" "/tmp_mnt/")))))
   "File systems that ought to be mounted.")
 
-(compat-defun file-local-name (file) ;; <OK>
+(compat-defun file-local-name (file) ;; [[compat-tests:file-local-name]]
   "Return the local name component of FILE.
 This function removes from FILE the specification of the remote host
 and the method of accessing the host, leaving only the part that
@@ -337,13 +337,13 @@ The returned file name can be used directly as argument of
 `process-file', `start-file-process', or `shell-command'."
   (or (file-remote-p file 'localname) file))
 
-(compat-defun file-name-quoted-p (name &optional top) ;; <OK>
+(compat-defun file-name-quoted-p (name &optional top) ;; 
[[compat-tests:file-name-quoted-p]]
   "Handle optional argument TOP."
   :explicit t
   (let ((file-name-handler-alist (unless top file-name-handler-alist)))
     (string-prefix-p "/:" (file-local-name name))))
 
-(compat-defun file-name-quote (name &optional top) ;; <OK>
+(compat-defun file-name-quote (name &optional top) ;; 
[[compat-tests:file-name-quote]]
   "Handle optional argument TOP."
   :explicit t
   (let ((file-name-handler-alist (unless top file-name-handler-alist)))
@@ -383,68 +383,68 @@ same meaning as in `make-temp-file'."
       (let ((temporary-file-directory (temporary-file-directory)))
         (make-temp-file prefix dir-flag suffix)))))
 
-(compat-defun file-attribute-type (attributes) ;; <OK>
+(compat-defun file-attribute-type (attributes) ;; 
[[compat-tests:file-attribute-getters]]
   "The type field in ATTRIBUTES returned by `file-attributes'.
 The value is either t for directory, string (name linked to) for
 symbolic link, or nil."
   (nth 0 attributes))
 
-(compat-defun file-attribute-link-number (attributes) ;; <OK>
+(compat-defun file-attribute-link-number (attributes) ;; 
[[compat-tests:file-attribute-getters]]
   "Return the number of links in ATTRIBUTES returned by `file-attributes'."
   (nth 1 attributes))
 
-(compat-defun file-attribute-user-id (attributes) ;; <OK>
+(compat-defun file-attribute-user-id (attributes) ;; 
[[compat-tests:file-attribute-getters]]
   "The UID field in ATTRIBUTES returned by `file-attributes'.
 This is either a string or a number.  If a string value cannot be
 looked up, a numeric value, either an integer or a float, is
 returned."
   (nth 2 attributes))
 
-(compat-defun file-attribute-group-id (attributes) ;; <OK>
+(compat-defun file-attribute-group-id (attributes) ;; 
[[compat-tests:file-attribute-getters]]
   "The GID field in ATTRIBUTES returned by `file-attributes'.
 This is either a string or a number.  If a string value cannot be
 looked up, a numeric value, either an integer or a float, is
 returned."
   (nth 3 attributes))
 
-(compat-defun file-attribute-access-time (attributes) ;; <OK>
+(compat-defun file-attribute-access-time (attributes) ;; 
[[compat-tests:file-attribute-getters]]
   "The last access time in ATTRIBUTES returned by `file-attributes'.
 This a Lisp timestamp in the style of `current-time'."
   (nth 4 attributes))
 
-(compat-defun file-attribute-modification-time (attributes) ;; <OK>
+(compat-defun file-attribute-modification-time (attributes) ;; 
[[compat-tests:file-attribute-getters]]
   "The modification time in ATTRIBUTES returned by `file-attributes'.
 This is the time of the last change to the file's contents, and
 is a Lisp timestamp in the style of `current-time'."
   (nth 5 attributes))
 
-(compat-defun file-attribute-status-change-time (attributes) ;; <OK>
+(compat-defun file-attribute-status-change-time (attributes) ;; 
[[compat-tests:file-attribute-getters]]
   "The status modification time in ATTRIBUTES returned by `file-attributes'.
 This is the time of last change to the file's attributes: owner
 and group, access mode bits, etc., and is a Lisp timestamp in the
 style of `current-time'."
   (nth 6 attributes))
 
-(compat-defun file-attribute-size (attributes) ;; <OK>
+(compat-defun file-attribute-size (attributes) ;; 
[[compat-tests:file-attribute-getters]]
   "The integer size (in bytes) in ATTRIBUTES returned by `file-attributes'."
   (nth 7 attributes))
 
-(compat-defun file-attribute-modes (attributes) ;; <OK>
+(compat-defun file-attribute-modes (attributes) ;; 
[[compat-tests:file-attribute-getters]]
   "The file modes in ATTRIBUTES returned by `file-attributes'.
 This is a string of ten letters or dashes as in ls -l."
   (nth 8 attributes))
 
-(compat-defun file-attribute-inode-number (attributes) ;; <OK>
+(compat-defun file-attribute-inode-number (attributes) ;; 
[[compat-tests:file-attribute-getters]]
   "The inode number in ATTRIBUTES returned by `file-attributes'.
 It is a nonnegative integer."
   (nth 10 attributes))
 
-(compat-defun file-attribute-device-number (attributes) ;; <OK>
+(compat-defun file-attribute-device-number (attributes) ;; 
[[compat-tests:file-attribute-getters]]
   "The file system device number in ATTRIBUTES returned by `file-attributes'.
 It is an integer."
   (nth 11 attributes))
 
-(compat-defun file-attribute-collect (attributes &rest attr-names) ;; <OK>
+(compat-defun file-attribute-collect (attributes &rest attr-names) ;; 
[[compat-tests:file-attribute-collect]]
   "Return a sublist of ATTRIBUTES returned by `file-attributes'.
 ATTR-NAMES are symbols with the selected attribute names.
 
@@ -474,7 +474,7 @@ inode-number and device-number."
 
 ;;;; Defined in image.el
 
-(compat-defun image-property (image property) ;; <OK>
+(compat-defun image-property (image property) ;; 
[[compat-tests:image-property]]
   "Return the value of PROPERTY in IMAGE.
 Properties can be set with
 
@@ -486,7 +486,7 @@ If VALUE is nil, PROPERTY is removed from IMAGE."
 
 ;;;; Defined in rmc.el
 
-(compat-defun read-multiple-choice (prompt choices) ;; <OK>
+(compat-defun read-multiple-choice (prompt choices) ;; 
[[compat-tests:read-multiple-choice]]
   "Ask user to select an entry from CHOICES, promting with PROMPT.
 This function allows to ask the user a multiple-choice question.
 
diff --git a/compat-27.el b/compat-27.el
index 16137ac563..986d930d90 100644
--- a/compat-27.el
+++ b/compat-27.el
@@ -27,7 +27,7 @@
 
 ;;;; Defined in fns.c
 
-(compat-defun proper-list-p (object) ;; <OK>
+(compat-defun proper-list-p (object) ;; [[compat-tests:proper-list-p]]
   "Return OBJECT's length if it is a proper list, nil otherwise.
 A proper list is neither circular nor dotted (i.e., its last cdr
 is nil)."
@@ -50,7 +50,7 @@ is nil)."
     ;; Errors on 26.1 and newer
     (and (listp object) (ignore-errors (length object)))))
 
-(compat-defun string-distance (string1 string2 &optional bytecompare) ;; <OK>
+(compat-defun string-distance (string1 string2 &optional bytecompare) ;; 
[[compat-tests:string-distance]]
   "Return Levenshtein distance between STRING1 and STRING2.
 The distance is the number of deletions, insertions, and substitutions
 required to transform STRING1 into STRING2.
@@ -84,7 +84,7 @@ Letter-case is significant, but text properties are ignored."
 
 ;;;; Defined in window.c
 
-(compat-defun recenter (&optional arg redisplay) ;; <OK>
+(compat-defun recenter (&optional arg redisplay) ;; [[compat-tests:recenter]]
   "Handle optional argument REDISPLAY."
   :explicit t
   (recenter arg)
@@ -93,7 +93,7 @@ Letter-case is significant, but text properties are ignored."
 
 ;;;; Defined in keymap.c
 
-(compat-defun lookup-key (keymap key &optional accept-default) ;; <OK>
+(compat-defun lookup-key (keymap key &optional accept-default) ;; 
[[compat-tests:lookup-key]]
   "Allow for KEYMAP to be a list of keymaps."
   :explicit t
   (cond
@@ -108,7 +108,7 @@ Letter-case is significant, but text properties are 
ignored."
 
 ;;;; Defined in timefns.c
 
-(compat-defun time-equal-p (t1 t2) ;; <OK>
+(compat-defun time-equal-p (t1 t2) ;; [[compat-tests:time-equal-p]]
   "Return non-nil if time value T1 is equal to time value T2.
 A nil value for either argument stands for the current time.
 
@@ -126,7 +126,7 @@ NOTE: This function is not as accurate as the actual 
`time-equal-p'."
 
 ;;;; Defined in fileio.c
 
-(compat-defun file-name-absolute-p (filename) ;; <OK>
+(compat-defun file-name-absolute-p (filename) ;; 
[[compat-tests:file-name-absolute-p]]
   "Return t if FILENAME is an absolute file name.
 On Unix, absolute file names start with `/'.  In Emacs, an absolute
 file name can also start with an initial `~' or `~USER' component,
@@ -160,10 +160,10 @@ where USER is a valid login name."
 
 ;;;; Defined in subr.el
 
-(compat-defalias fixnump integerp) ;; <OK>
-(compat-defalias bignump ignore) ;; <OK>
+(compat-defalias fixnump integerp) ;; [[compat-tests:fixnump]]
+(compat-defalias bignump ignore) ;; [[compat-tests:bignump]]
 
-(compat-defmacro setq-local (&rest pairs) ;; <OK>
+(compat-defmacro setq-local (&rest pairs) ;; [[compat-tests:setq-local]]
   "Handle multiple assignments."
   :explicit t
   (unless (zerop (mod (length pairs) 2))
@@ -178,7 +178,7 @@ where USER is a valid login name."
               body)))
     (cons 'progn (nreverse body))))
 
-(compat-defun provided-mode-derived-p (mode &rest modes) ;; <OK>
+(compat-defun provided-mode-derived-p (mode &rest modes) ;; 
[[compat-tests:derived-mode-p]]
   "Non-nil if MODE is derived from one of MODES.
 Uses the `derived-mode-parent' property of the symbol to trace backwards.
 If you just want to check `major-mode', use `derived-mode-p'."
@@ -194,12 +194,12 @@ If you just want to check `major-mode', use 
`derived-mode-p'."
          (setq mode (if (and parentfn (symbolp parentfn)) parentfn parent)))))
   mode)
 
-(compat-defun derived-mode-p (&rest modes) ;; <OK>
+(compat-defun derived-mode-p (&rest modes) ;; [[compat-tests:derived-mode-p]]
   "Non-nil if the current major mode is derived from one of MODES.
 Uses the `derived-mode-parent' property of the symbol to trace backwards."
   (apply #'provided-mode-derived-p major-mode modes))
 
-(compat-defmacro ignore-error (condition &rest body) ;; <OK>
+(compat-defmacro ignore-error (condition &rest body) ;; 
[[compat-tests:ignore-error]]
   "Execute BODY; if the error CONDITION occurs, return nil.
 Otherwise, return result of last form in BODY.
 
@@ -235,7 +235,7 @@ print the reporter message followed by the word \"done\".
        (progress-reporter-done ,prep)
        (or ,@(cdr (cdr spec)) nil))))
 
-(compat-defun flatten-tree (tree) ;; <OK>
+(compat-defun flatten-tree (tree) ;; [[compat-tests:flatten-tree]]
   "Return a \"flattened\" copy of TREE.
 In other words, return a list of the non-nil terminal nodes, or
 leaves, of the tree of cons cells rooted at TREE.  Leaves in the
@@ -253,7 +253,7 @@ returned list are in the same order as in TREE.
     (if tree (push tree elems))
     (nreverse elems)))
 
-(compat-defun xor (cond1 cond2) ;; <OK>
+(compat-defun xor (cond1 cond2) ;; [[compat-tests:xor]]
   "Return the boolean exclusive-or of COND1 and COND2.
 If only one of the arguments is non-nil, return it; otherwise
 return nil."
@@ -261,11 +261,11 @@ return nil."
   (cond ((not cond1) cond2)
         ((not cond2) cond1)))
 
-(compat-defvar regexp-unmatchable "\\`a\\`" ;; <OK>
+(compat-defvar regexp-unmatchable "\\`a\\`" ;; 
[[compat-tests:regexp-unmatchable]]
   "Standard regexp guaranteed not to match any string at all."
   :constant t)
 
-(compat-defun assoc-delete-all (key alist &optional test) ;; <OK>
+(compat-defun assoc-delete-all (key alist &optional test) ;; 
[[compat-tests:assoc-delete-all]]
   "Handle optional argument TEST."
   :explicit t
   (unless test (setq test #'equal))
@@ -282,48 +282,48 @@ return nil."
 
 ;;;; Defined in simple.el
 
-(compat-defun decoded-time-second (time) ;; <OK>
+(compat-defun decoded-time-second (time) ;; 
[[compat-tests:decoded-time-accessors]]
   "The seconds in TIME, which is a value returned by `decode-time'.
 This is an integer between 0 and 60 (inclusive).  (60 is a leap
 second, which only some operating systems support.)"
   (nth 0 time))
 
-(compat-defun decoded-time-minute (time) ;; <OK>
+(compat-defun decoded-time-minute (time) ;; 
[[compat-tests:decoded-time-accessors]]
   "The minutes in TIME, which is a value returned by `decode-time'.
 This is an integer between 0 and 59 (inclusive)."
   (nth 1 time))
 
-(compat-defun decoded-time-hour (time) ;; <OK>
+(compat-defun decoded-time-hour (time) ;; 
[[compat-tests:decoded-time-accessors]]
   "The hours in TIME, which is a value returned by `decode-time'.
 This is an integer between 0 and 23 (inclusive)."
   (nth 2 time))
 
-(compat-defun decoded-time-day (time) ;; <OK>
+(compat-defun decoded-time-day (time) ;; 
[[compat-tests:decoded-time-accessors]]
   "The day-of-the-month in TIME, which is a value returned by `decode-time'.
 This is an integer between 1 and 31 (inclusive)."
   (nth 3 time))
 
-(compat-defun decoded-time-month (time) ;; <OK>
+(compat-defun decoded-time-month (time) ;; 
[[compat-tests:decoded-time-accessors]]
   "The month in TIME, which is a value returned by `decode-time'.
 This is an integer between 1 and 12 (inclusive).  January is 1."
   (nth 4 time))
 
-(compat-defun decoded-time-year (time) ;; <OK>
+(compat-defun decoded-time-year (time) ;; 
[[compat-tests:decoded-time-accessors]]
   "The year in TIME, which is a value returned by `decode-time'.
 This is a four digit integer."
   (nth 5 time))
 
-(compat-defun decoded-time-weekday (time) ;; <OK>
+(compat-defun decoded-time-weekday (time) ;; 
[[compat-tests:decoded-time-accessors]]
   "The day-of-the-week in TIME, which is a value returned by `decode-time'.
 This is a number between 0 and 6, and 0 is Sunday."
   (nth 6 time))
 
-(compat-defun decoded-time-dst (time) ;; <OK>
+(compat-defun decoded-time-dst (time) ;; 
[[compat-tests:decoded-time-accessors]]
   "The daylight saving time in TIME, which is a value returned by 
`decode-time'.
 This is t if daylight saving time is in effect, and nil if not."
   (nth 7 time))
 
-(compat-defun decoded-time-zone (time) ;; <OK>
+(compat-defun decoded-time-zone (time) ;; 
[[compat-tests:decoded-time-accessors]]
   "The time zone in TIME, which is a value returned by `decode-time'.
 This is an integer indicating the UTC offset in seconds, i.e.,
 the number of seconds east of Greenwich."
@@ -342,7 +342,7 @@ the number of seconds east of Greenwich."
 
 ;;;; Defined in minibuffer.el
 
-(compat-defmacro with-minibuffer-selected-window (&rest body) ;; <OK>
+(compat-defmacro with-minibuffer-selected-window (&rest body) ;; 
[[compat-tests:with-minibuffer-selected-window]]
   "Execute the forms in BODY from the minibuffer in its original window.
 When used in a minibuffer window, select the window selected just before
 the minibuffer was activated, and execute the forms."
@@ -354,7 +354,7 @@ the minibuffer was activated, and execute the forms."
 
 ;;;; Defined in image.el
 
-(compat-defun image--set-property (image property value) ;; <OK>
+(compat-defun image--set-property (image property value) ;; 
[[compat-tests:image-property]]
   "Set PROPERTY in IMAGE to VALUE.
 Internal use only."
   :explicit t
@@ -379,7 +379,7 @@ Internal use only."
 
 ;;;; Defined in files.el
 
-(compat-defun file-size-human-readable (file-size &optional flavor space unit) 
;; <OK>
+(compat-defun file-size-human-readable (file-size &optional flavor space unit) 
;; [[compat-tests:file-size-human-readable]]
   "Handle the optional arguments SPACE and UNIT.
 
 Optional third argument SPACE is a string put between the number and unit.
@@ -474,7 +474,7 @@ Optional arg PARENTS, if non-nil then creates parent dirs 
as needed."
 
 ;;;; Defined in regexp-opt.el
 
-(compat-defun regexp-opt (strings &optional paren) ;; <OK>
+(compat-defun regexp-opt (strings &optional paren) ;; 
[[compat-tests:regexp-opt]]
   "Handle an empty list of STRINGS."
   :explicit t
   (if (null strings)
@@ -543,7 +543,7 @@ The return value is a string (or nil in case we can’t find 
it)."
 
 ;;;; Defined in time-date.el
 
-(compat-defun date-days-in-month (year month) ;; <OK>
+(compat-defun date-days-in-month (year month) ;; 
[[compat-tests:date-days-in-month]]
   "The number of days in MONTH in YEAR."
   :feature time-date
   (unless (and (numberp month)
@@ -560,7 +560,7 @@ The return value is a string (or nil in case we can’t find 
it)."
 
 ;;;; Defined in text-property-search.el
 
-(compat-defun make-prop-match (&rest attr) ;; <OK>
+(compat-defun make-prop-match (&rest attr) ;; [[compat-tests:make-prop-match]]
   "Constructor for objects of type ‘prop-match’."
   :feature text-property-search
   ;; Vector for older than 26.1, Record on newer Emacs.
@@ -570,7 +570,7 @@ The return value is a string (or nil in case we can’t find 
it)."
            (plist-get attr :end)
            (plist-get attr :value)))
 
-(compat-defun prop-match-p (match) ;; <OK>
+(compat-defun prop-match-p (match) ;; [[compat-tests:make-prop-match]]
   "Return non-nil if MATCH is a `prop-match' object."
   :feature text-property-search
   ;; Vector for older than 26.1, Record on newer Emacs.
@@ -580,22 +580,22 @@ The return value is a string (or nil in case we can’t 
find it)."
            (eq (aref match 0) 'prop-match))
     (eq (type-of match) 'prop-match)))
 
-(compat-defun prop-match-beginning (match) ;; <OK>
+(compat-defun prop-match-beginning (match) ;; [[compat-tests:make-prop-match]]
   "Retrieve the position where MATCH begins."
   :feature text-property-search
   (aref match 1))
 
-(compat-defun prop-match-end (match) ;; <OK>
+(compat-defun prop-match-end (match) ;; [[compat-tests:make-prop-match]]
   "Retrieve the position where MATCH ends."
   :feature text-property-search
   (aref match 2))
 
-(compat-defun prop-match-value (match) ;; <OK>
+(compat-defun prop-match-value (match) ;; [[compat-tests:make-prop-match]]
   "Retrieve the value that MATCH holds."
   :feature text-property-search
   (aref match 3))
 
-(compat-defun text-property-search-forward ;; <OK>
+(compat-defun text-property-search-forward ;; 
[[compat-tests:text-property-search-forward]]
     (property &optional value predicate not-current)
   "Search for the next region of text where PREDICATE is true.
 PREDICATE is used to decide whether a value of PROPERTY should be
@@ -700,7 +700,7 @@ the buffer positions that limit the region, and
         (and (not (eq ended t))
              ended))))))
 
-(compat-defun text-property-search-backward ;; <OK>
+(compat-defun text-property-search-backward ;; 
[[compat-tests:text-property-search-backward]]
     (property &optional value predicate not-current)
   "Search for the previous region of text whose PROPERTY matches VALUE.
 
diff --git a/compat-28.el b/compat-28.el
index e60ea41e4f..e8527d9eb8 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -28,7 +28,7 @@
 ;;;; Defined in fns.c
 
 ;; FIXME Should handle multibyte regular expressions
-(compat-defun string-search (needle haystack &optional start-pos) ;; <OK>
+(compat-defun string-search (needle haystack &optional start-pos) ;; 
[[compat-tests:string-search]]
   "Search for the string NEEDLE in the strign HAYSTACK.
 
 The return value is the position of the first occurrence of
@@ -51,7 +51,7 @@ issues are inherited."
     (let ((case-fold-search nil))
       (string-match (regexp-quote needle) haystack start-pos))))
 
-(compat-defun length= (sequence length) ;; <OK>
+(compat-defun length= (sequence length) ;; [[compat-tests:length=]]
   "Returns non-nil if SEQUENCE has a length equal to LENGTH."
   (cond
    ((null sequence) (zerop length))
@@ -63,7 +63,7 @@ issues are inherited."
     (= (length sequence) length))
    ((signal 'wrong-type-argument sequence))))
 
-(compat-defun length< (sequence length) ;; <OK>
+(compat-defun length< (sequence length) ;; [[compat-tests:length<]]
   "Returns non-nil if SEQUENCE is shorter than LENGTH."
   (cond
    ((null sequence) (not (zerop length)))
@@ -73,7 +73,7 @@ issues are inherited."
     (< (length sequence) length))
    ((signal 'wrong-type-argument sequence))))
 
-(compat-defun length> (sequence length) ;; <OK>
+(compat-defun length> (sequence length) ;; [[compat-tests:length>]]
   "Returns non-nil if SEQUENCE is longer than LENGTH."
   (cond
    ((listp sequence)
@@ -84,7 +84,7 @@ issues are inherited."
 
 ;;;; Defined in fileio.c
 
-(compat-defun file-name-concat (directory &rest components) ;; <OK>
+(compat-defun file-name-concat (directory &rest components) ;; 
[[compat-tests:file-name-concat]]
   "Append COMPONENTS to DIRECTORY and return the resulting string.
 Elements in COMPONENTS must be a string or nil.
 DIRECTORY or the non-final elements in COMPONENTS may or may not end
@@ -107,7 +107,7 @@ inserted before contatenating."
 
 ;;;; Defined in alloc.c
 
-(compat-defalias garbage-collect-maybe ignore) ;; <OK>
+(compat-defalias garbage-collect-maybe ignore) ;; 
[[compat-tests:garbage-collect-maybe]]
 
 ;;;; Defined in filelock.c
 
@@ -126,7 +126,7 @@ continuing as if the error did not occur."
 
 ;;;; Defined in characters.c
 
-(compat-defun string-width (string &optional from to) ;; <OK>
+(compat-defun string-width (string &optional from to) ;; 
[[compat-tests:string-width]]
   "Handle optional arguments FROM and TO.
 Optional arguments FROM and TO specify the substring of STRING to
 consider, and are interpreted as in `substring'."
@@ -205,7 +205,7 @@ If COUNT is non-nil and a natural number, the function will
 
 ;;;; xfaces.c
 
-(compat-defun color-values-from-color-spec (spec) ;; <OK>
+(compat-defun color-values-from-color-spec (spec) ;; 
[[compat-tests:color-values-from-color-spec]]
   "Parse color SPEC as a numeric color and return (RED GREEN BLUE).
 This function recognises the following formats for SPEC:
 
@@ -281,7 +281,7 @@ and BLUE, is normalized to have its value in [0,65535]."
 
 ;;;; Defined in simple.el
 
-(compat-defun make-separator-line (&optional length) ;; <OK>
+(compat-defun make-separator-line (&optional length) ;; 
[[compat-tests:make-separator-line]]
   "Make a string appropriate for usage as a visual separator line.
 If LENGTH is nil, use the window width."
     (concat (propertize (make-string (or length (1- (window-width))) ?-)
@@ -291,7 +291,7 @@ If LENGTH is nil, use the window width."
 ;;;; Defined in subr.el
 
 ;; FIXME Should handle multibyte regular expressions
-(compat-defun string-replace (fromstring tostring instring) ;; <OK>
+(compat-defun string-replace (fromstring tostring instring) ;; 
[[compat-tests:string-replace]]
   "Replace FROMSTRING with TOSTRING in INSTRING each time it occurs."
   (when (equal fromstring "")
     (signal 'wrong-length-argument '(0)))
@@ -301,13 +301,13 @@ If LENGTH is nil, use the window width."
      tostring instring
      t t)))
 
-(compat-defun always (&rest _arguments) ;; <OK>
+(compat-defun always (&rest _arguments) ;; [[compat-tests:always]]
   "Do nothing and return t.
 This function accepts any number of ARGUMENTS, but ignores them.
 Also see `ignore'."
   t)
 
-(compat-defun insert-into-buffer (buffer &optional start end) ;; <OK>
+(compat-defun insert-into-buffer (buffer &optional start end) ;; 
[[compat-tests:insert-into-buffer]]
   "Insert the contents of the current buffer into BUFFER.
 If START/END, only insert that region from the current buffer.
 Point in BUFFER will be placed after the inserted text."
@@ -315,7 +315,7 @@ Point in BUFFER will be placed after the inserted text."
     (with-current-buffer buffer
       (insert-buffer-substring current start end))))
 
-(compat-defun replace-string-in-region (string replacement &optional start 
end) ;; <OK>
+(compat-defun replace-string-in-region (string replacement &optional start 
end) ;; [[compat-tests:replace-string-in-region]]
   "Replace STRING with REPLACEMENT in the region from START to END.
 The number of replaced occurrences are returned, or nil if STRING
 doesn't exist in the region.
@@ -344,7 +344,7 @@ Comparisons and replacements are done with fixed case."
         (and (not (zerop matches))
              matches)))))
 
-(compat-defun replace-regexp-in-region (regexp replacement &optional start 
end) ;; <OK>
+(compat-defun replace-regexp-in-region (regexp replacement &optional start 
end) ;; [[compat-tests:replace-regexp-in-region]]
   "Replace REGEXP with REPLACEMENT in the region from START to END.
 The number of replaced occurrences are returned, or nil if REGEXP
 doesn't exist in the region.
@@ -380,7 +380,7 @@ REPLACEMENT can use the following special elements:
         (and (not (zerop matches))
              matches)))))
 
-(compat-defun buffer-local-boundp (symbol buffer) ;; <OK>
+(compat-defun buffer-local-boundp (symbol buffer) ;; 
[[compat-tests:buffer-local-boundp]]
   "Return non-nil if SYMBOL is bound in BUFFER.
 Also see `local-variable-p'."
   (catch 'fail
@@ -389,7 +389,7 @@ Also see `local-variable-p'."
       (void-variable nil (throw 'fail nil)))
     t))
 
-(compat-defmacro with-existing-directory (&rest body) ;; <OK>
+(compat-defmacro with-existing-directory (&rest body) ;; 
[[compat-tests:with-existing-directory]]
   "Execute BODY with `default-directory' bound to an existing directory.
 If `default-directory' is already an existing directory, it's not changed."
   (declare (indent 0) (debug t))
@@ -405,7 +405,7 @@ If `default-directory' is already an existing directory, 
it's not changed."
               "/")))
      ,@body))
 
-(compat-defmacro dlet (binders &rest body) ;; <OK>
+(compat-defmacro dlet (binders &rest body) ;; [[compat-tests:dlet]]
   "Like `let' but using dynamic scoping."
   (declare (indent 1) (debug let))
   `(let (_)
@@ -414,7 +414,7 @@ If `default-directory' is already an existing directory, 
it's not changed."
                binders)
      (let ,binders ,@body)))
 
-(compat-defun ensure-list (object) ;; <OK>
+(compat-defun ensure-list (object) ;; [[compat-tests:ensure-list]]
   "Return OBJECT as a list.
 If OBJECT is already a list, return OBJECT itself.  If it's
 not a list, return a one-element list containing OBJECT."
@@ -422,15 +422,15 @@ not a list, return a one-element list containing OBJECT."
       object
     (list object)))
 
-(compat-defalias subr-primitive-p subrp) ;; <OK>
+(compat-defalias subr-primitive-p subrp) ;; [[compat-tests:subr-primitive-p]]
 
 ;;;; Defined in data.c
 
-(compat-defalias subr-native-elisp-p ignore) ;; <OK>
+(compat-defalias subr-native-elisp-p ignore) ;; 
[[compat-tests:subr-native-elisp-p]]
 
 ;;;; Defined in subr-x.el
 
-(compat-defun string-clean-whitespace (string) ;; <OK>
+(compat-defun string-clean-whitespace (string) ;; 
[[compat-tests:string-clean-whitespace]]
   "Clean up whitespace in STRING.
 All sequences of whitespaces in STRING are collapsed into a
 single space character, and leading/trailing whitespace is
@@ -442,7 +442,7 @@ removed."
      (replace-regexp-in-string
       blank " " string))))
 
-(compat-defun string-fill (string length) ;; <OK>
+(compat-defun string-fill (string length) ;; [[compat-tests:string-fill]]
   "Clean up whitespace in STRING.
 All sequences of whitespaces in STRING are collapsed into a
 single space character, and leading/trailing whitespace is
@@ -455,12 +455,12 @@ removed."
       (fill-region (point-min) (point-max)))
     (buffer-string)))
 
-(compat-defun string-lines (string &optional omit-nulls) ;; <OK>
+(compat-defun string-lines (string &optional omit-nulls) ;; 
[[compat-tests:string-lines]]
   "Split STRING into a list of lines.
 If OMIT-NULLS, empty lines will be removed from the results."
   (split-string string "\n" omit-nulls))
 
-(compat-defun string-pad (string length &optional padding start) ;; <OK>
+(compat-defun string-pad (string length &optional padding start) ;; 
[[compat-tests:string-pad]]
   "Pad STRING to LENGTH using PADDING.
 If PADDING is nil, the space character is used.  If not nil, it
 should be a character.
@@ -482,13 +482,13 @@ the string."
               (and (not start)
                    (make-string pad-length (or padding ?\s)))))))
 
-(compat-defun string-chop-newline (string) ;; <OK>
+(compat-defun string-chop-newline (string) ;; 
[[compat-tests:string-chop-newline]]
   "Remove the final newline (if any) from STRING."
   (if (and (>= (length string) 1) (= (aref string (1- (length string))) ?\n))
       (substring string 0 -1)
     string))
 
-(compat-defmacro named-let (name bindings &rest body) ;; <OK>
+(compat-defmacro named-let (name bindings &rest body) ;; 
[[compat-tests:named-let]]
   "Looping construct taken from Scheme.
 Like `let', bind variables in BINDINGS and then evaluate BODY,
 but with the twist that BODY can evaluate itself recursively by
@@ -577,7 +577,7 @@ as the new values of the bound variables in the recursive 
invocation."
 
 ;;;; Defined in files.el
 
-(compat-defun file-name-with-extension (filename extension) ;; <OK>
+(compat-defun file-name-with-extension (filename extension) ;; 
[[compat-tests:file-name-with-extension]]
   "Set the EXTENSION of a FILENAME.
 The extension (in a file name) is the part that begins with the last \".\".
 
@@ -609,7 +609,7 @@ See `file-symlink-p' to distinguish symlinks."
   (and (file-directory-p dir)
        (null (directory-files dir nil directory-files-no-dot-files-regexp t))))
 
-(compat-defun file-modes-number-to-symbolic (mode &optional filetype) ;; <OK>
+(compat-defun file-modes-number-to-symbolic (mode &optional filetype) ;; 
[[compat-tests:file-modes-number-to-symbolic]]
   "Return a string describing a file's MODE.
 For instance, if MODE is #o700, then it produces `-rwx------'.
 FILETYPE if provided should be a character denoting the type of file,
@@ -666,7 +666,7 @@ recent files are first."
           (push candidate files))))
     (sort files #'file-newer-than-file-p)))
 
-(compat-defun make-lock-file-name (filename) ;; <OK>
+(compat-defun make-lock-file-name (filename) ;; 
[[compat-tests:make-lock-file-name]]
   "Make a lock file name for FILENAME.
 This prepends \".#\" to the non-directory part of FILENAME, and
 doesn't respect `lock-file-name-transforms', as Emacs 28.1 and
@@ -689,7 +689,7 @@ onwards does."
 
 ;;;; Defined in minibuffer.el
 
-(compat-defun format-prompt (prompt default &rest format-args) ;; <OK>
+(compat-defun format-prompt (prompt default &rest format-args) ;; 
[[compat-tests:format-prompt]]
   "Format PROMPT with DEFAULT.
 If FORMAT-ARGS is nil, PROMPT is used as a plain string.  If
 FORMAT-ARGS is non-nil, PROMPT is used as a format control
@@ -716,7 +716,7 @@ is included in the return value."
 
 ;;;; Defined in windows.el
 
-(compat-defun count-windows (&optional minibuf all-frames) ;; <OK>
+(compat-defun count-windows (&optional minibuf all-frames) ;; 
[[compat-tests:count-windows]]
   "Handle optional argument ALL-FRAMES.
 If ALL-FRAMES is non-nil, count the windows in all frames instead
 just the selected frame."
@@ -751,7 +751,7 @@ where the mouse button is clicked to find the thing nearby."
 
 ;;;; Defined in macroexp.el
 
-(compat-defun macroexp-warn-and-return (msg form &optional _category 
_compile-only _arg) ;; <OK>
+(compat-defun macroexp-warn-and-return (msg form &optional _category 
_compile-only _arg) ;; [[compat-tests:macroexp-warn-and-return]]
   "Return code equivalent to FORM labeled with warning MSG.
 CATEGORY is the category of the warning, like the categories that
 can appear in `byte-compile-warnings'.
@@ -761,7 +761,7 @@ ARG is a symbol (or a form) giving the source code position 
for the message.
 It should normally be a symbol with position and it defaults to FORM."
   (macroexp--warn-and-return msg form))
 
-(compat-defun macroexp-file-name () ;; <OK>
+(compat-defun macroexp-file-name () ;; [[compat-tests:macroexp-file-name]]
   "Return the name of the file from which the code comes.
 Returns nil when we do not know.
 A non-nil result is expected to be reliable when called from a macro in order
@@ -774,7 +774,7 @@ Other uses risk returning non-nil value that point to the 
wrong file."
 
 ;;;; Defined in env.el
 
-(compat-defmacro with-environment-variables (variables &rest body) ;; <OK>
+(compat-defmacro with-environment-variables (variables &rest body) ;; 
[[compat-tests:with-environment-variables]]
   "Set VARIABLES in the environent and execute BODY.
 VARIABLES is a list of variable settings of the form (VAR VALUE),
 where VAR is the name of the variable (a string) and VALUE
@@ -792,7 +792,7 @@ The previous values will be be restored upon exit."
 
 ;;;; Defined in time-data.el
 
-(compat-defun decoded-time-period (time) ;; <OK>
+(compat-defun decoded-time-period (time) ;; 
[[compat-tests:decoded-time-period]]
   "Interpret DECODED as a period and return its length in seconds.
 For computational purposes, years are 365 days long and months
 are 30 days long."
diff --git a/compat-29.el b/compat-29.el
index cd94215dd9..ba0440a52a 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -28,7 +28,7 @@
 
 ;;;; Defined in xdisp.c
 
-(compat-defun get-display-property (position prop &optional object properties) 
;; <OK>
+(compat-defun get-display-property (position prop &optional object properties) 
;; [[compat-tests:get-display-property]]
   "Get the value of the `display' property PROP at POSITION.
 If OBJECT, this should be a buffer or string where the property is
 fetched from.  If omitted, OBJECT defaults to the current buffer.
@@ -57,7 +57,7 @@ the properties at POSITION."
 
 ;;;; Defined in fns.c
 
-(compat-defun ntake (n list) ;; <OK>
+(compat-defun ntake (n list) ;; [[compat-tests:ntake]]
   "Modify LIST to keep only the first N elements.
 If N is zero or negative, return nil.
 If N is greater or equal to the length of LIST, return LIST unmodified.
@@ -66,7 +66,7 @@ Otherwise, return LIST after truncating it."
                  (when cons (setcdr cons nil))
                  list)))
 
-(compat-defun take (n list) ;; <OK>
+(compat-defun take (n list) ;; [[compat-tests:take]]
   "Return the first N elements of LIST.
 If N is zero or negative, return nil.
 If N is greater or equal to the length of LIST, return LIST (or a copy)."
@@ -77,14 +77,14 @@ If N is greater or equal to the length of LIST, return LIST 
(or a copy)."
       (setq n (1- n)))
     (nreverse copy)))
 
-(compat-defun string-equal-ignore-case (string1 string2) ;; <OK>
+(compat-defun string-equal-ignore-case (string1 string2) ;; 
[[compat-tests:string-equal-ignore-case]]
   "Like `string-equal', but case-insensitive.
 Upper-case and lower-case letters are treated as equal.
 Unibyte strings are converted to multibyte for comparison."
   (declare (pure t) (side-effect-free t))
   (eq t (compare-strings string1 0 nil string2 0 nil t)))
 
-(compat-defun plist-get (plist prop &optional predicate) ;; <OK>
+(compat-defun plist-get (plist prop &optional predicate) ;; 
[[compat-tests:plist-get]]
   "Handle optional argument PREDICATE."
   :explicit t
   (if (or (null predicate) (eq predicate 'eq))
@@ -95,7 +95,7 @@ Unibyte strings are converted to multibyte for comparison."
           (throw 'found (cadr plist)))
         (setq plist (cddr plist))))))
 
-(compat-defun plist-put (plist prop val &optional predicate) ;; <OK>
+(compat-defun plist-put (plist prop val &optional predicate) ;; 
[[compat-tests:plist-get]]
   "Handle optional argument PREDICATE."
   :explicit t
   (if (or (null predicate) (eq predicate 'eq))
@@ -109,7 +109,7 @@ Unibyte strings are converted to multibyte for comparison."
           (setq tail (cddr tail))))
       (nconc plist (list prop val)))))
 
-(compat-defun plist-member (plist prop &optional predicate) ;; <OK>
+(compat-defun plist-member (plist prop &optional predicate) ;; 
[[compat-tests:plist-get]]
   "Handle optional argument PREDICATE."
   :explicit t
   (if (or (null predicate) (eq predicate 'eq))
@@ -122,7 +122,7 @@ Unibyte strings are converted to multibyte for comparison."
 
 ;;;; Defined in editfns.c
 
-(compat-defun pos-bol (&optional n) ;; <OK>
+(compat-defun pos-bol (&optional n) ;; [[compat-tests:pos-bol]]
   "Return the position of the first character on the current line.
 With optional argument N, scan forward N - 1 lines first.
 If the scan reaches the end of the buffer, return that position.
@@ -137,7 +137,7 @@ This function does not move point.  Also see 
`line-beginning-position'."
   (let ((inhibit-field-text-motion t))
     (line-beginning-position n)))
 
-(compat-defun pos-eol (&optional n) ;; <OK>
+(compat-defun pos-eol (&optional n) ;; [[compat-tests:pos-bol]]
   "Return the position of the last character on the current line.
 With argument N not nil or 1, move forward N - 1 lines first.
 If scan reaches end of buffer, return that position.
@@ -177,7 +177,7 @@ This function does not move point.  Also see 
`line-end-position'."
 
 ;;;; Defined in subr.el
 
-(compat-defmacro with-memoization (place &rest code) ;; <OK>
+(compat-defmacro with-memoization (place &rest code) ;; 
[[compat-tests:with-memoization]]
   "Return the value of CODE and stash it in PLACE.
 If PLACE's value is non-nil, then don't bother evaluating CODE
 and return the value found in PLACE instead."
@@ -189,9 +189,9 @@ and return the value found in PLACE instead."
                ,(funcall setter val)
                ,val)))))
 
-(compat-defalias string-split split-string) ;; <OK>
+(compat-defalias string-split split-string) ;; [[compat-tests:string-split]]
 
-(compat-defun function-alias-p (func &optional noerror) ;; <OK>
+(compat-defun function-alias-p (func &optional noerror) ;; 
[[compat-tests:function-alias-p]]
   "Return nil if FUNC is not a function alias.
 If FUNC is a function alias, return the function alias chain.
 
@@ -284,7 +284,7 @@ CONDITION."
 
 ;;;; Defined in subr-x.el
 
-(compat-defmacro with-buffer-unmodified-if-unchanged (&rest body) ;; <OK>
+(compat-defmacro with-buffer-unmodified-if-unchanged (&rest body) ;; 
[[compat-tests:with-buffer-unmodified-if-unchanged]]
   "Like `progn', but change buffer-modified status only if buffer text changes.
 If the buffer was unmodified before execution of BODY, and
 buffer text after execution of BODY is identical to what it was
@@ -321,7 +321,7 @@ be marked unmodified, effectively ignoring those changes."
                         (equal ,hash (buffer-hash)))
                (restore-buffer-modified-p nil))))))))
 
-(compat-defun add-display-text-property (start end prop value ;; <OK>
+(compat-defun add-display-text-property (start end prop value ;; 
[[compat-tests:add-display-text-property]]
                                                &optional object)
   "Add display property PROP with VALUE to the text from START to END.
 If any text in the region has a non-nil `display' property, those
@@ -363,7 +363,7 @@ this defaults to the current buffer."
           (put-text-property sub-start sub-end 'display disp object)))
       (setq sub-start sub-end))))
 
-(compat-defmacro while-let (spec &rest body) ;; <OK>
+(compat-defmacro while-let (spec &rest body) ;; [[compat-tests:while-let]]
   "Bind variables according to SPEC and conditionally evaluate BODY.
 Evaluate each binding in turn, stopping if a binding value is nil.
 If all bindings are non-nil, eval BODY and repeat.
@@ -380,7 +380,7 @@ The variable list SPEC is the same as in `if-let*'."
 
 ;;;; Defined in files.el
 
-(compat-defun file-name-split (filename) ;; <OK>
+(compat-defun file-name-split (filename) ;; [[compat-tests:file-name-split]]
   "Return a list of all the components of FILENAME.
 On most systems, this will be true:
 
@@ -407,14 +407,14 @@ On most systems, this will be true:
           (setq filename nil))))
     components))
 
-(compat-defun file-attribute-file-identifier (attributes) ;; <OK>
+(compat-defun file-attribute-file-identifier (attributes) ;; 
[[compat-tests:file-attribute-getters]]
   "The inode and device numbers in ATTRIBUTES returned by `file-attributes'.
 The value is a list of the form (INODENUM DEVICE), where DEVICE could be
 either a single number or a cons cell of two numbers.
 This tuple of numbers uniquely identifies the file."
   (nthcdr 10 attributes))
 
-(compat-defun file-name-parent-directory (filename) ;; <OK>
+(compat-defun file-name-parent-directory (filename) ;; 
[[compat-tests:file-name-parent-directory]]
   "Return the directory name of the parent directory of FILENAME.
 If FILENAME is at the root of the filesystem, return nil.
 If FILENAME is relative, it is interpreted to be relative
@@ -460,7 +460,7 @@ the symbol of the calling function, for example."
 
 ;;;; Defined in keymap.el
 
-(compat-defun key-valid-p (keys) ;; <OK>
+(compat-defun key-valid-p (keys) ;; [[compat-tests:key-valid-p]]
   "Say whether KEYS is a valid key.
 A key is a string consisting of one or more key strokes.
 The key strokes are separated by single space characters.
@@ -524,12 +524,12 @@ which is
                (throw 'exit nil)))
            t))))))
 
-(compat-defun keymap--check (key) ;; <OK>
+(compat-defun keymap--check (key) ;; [[compat-tests:keymap--check]]
   "Signal an error if KEY doesn't have a valid syntax."
   (unless (key-valid-p key)
     (error "%S is not a valid key definition; see `key-valid-p'" key)))
 
-(compat-defun key-parse (keys) ;; <OK>
+(compat-defun key-parse (keys) ;; [[compat-tests:key-parse]]
   "Convert KEYS to the internal Emacs key representation.
 See `kbd' for a descripion of KEYS."
   (declare (pure t) (side-effect-free t))
@@ -621,7 +621,7 @@ See `kbd' for a descripion of KEYS."
               (setq res (vconcat res key))))))
       res)))
 
-(compat-defun keymap-set (keymap key definition) ;; <OK>
+(compat-defun keymap-set (keymap key definition) ;; 
[[compat-tests:defvar-keymap]]
   "Set KEY to DEFINITION in KEYMAP.
 KEY is a string that satisfies `key-valid-p'.
 
@@ -658,7 +658,7 @@ parent keymap to be used."
   (keymap--check key)
   (compat--define-key keymap (key-parse key) nil remove))
 
-(compat-defun keymap-global-set (key command) ;; <OK>
+(compat-defun keymap-global-set (key command) ;; 
[[compat-tests:keymap-global-set]]
   "Give KEY a global binding as COMMAND.
 COMMAND is the command definition to use; usually it is
 a symbol naming an interactively-callable function.
@@ -672,7 +672,7 @@ that you make with this function.
 NOTE: The compatibility version is not a command."
   (keymap-set (current-global-map) key command))
 
-(compat-defun keymap-local-set (key command) ;; <OK>
+(compat-defun keymap-local-set (key command) ;; 
[[compat-tests:keymap-local-set]]
   "Give KEY a local binding as COMMAND.
 COMMAND is the command definition to use; usually it is
 a symbol naming an interactively-callable function.
@@ -760,7 +760,7 @@ a menu, so this function is not useful for non-menu 
keymaps."
   (define-key-after keymap (key-parse key) definition
     (and after (key-parse after))))
 
-(compat-defun keymap-lookup ;; <OK>
+(compat-defun keymap-lookup ;; [[compat-tests:keymap-lookup]]
     (keymap key &optional accept-default no-remap position)
   "Return the binding for command KEY.
 KEY is a string that satisfies `key-valid-p'.
@@ -804,7 +804,7 @@ specified buffer position instead of point are used."
           value))
     (key-binding (kbd key) accept-default no-remap position)))
 
-(compat-defun keymap-local-lookup (keys &optional accept-default) ;; <OK>
+(compat-defun keymap-local-lookup (keys &optional accept-default) ;; 
[[compat-tests:keymap-local-lookup]]
   "Return the binding for command KEYS in current local keymap only.
 KEY is a string that satisfies `key-valid-p'.
 
@@ -816,7 +816,7 @@ about this."
   (when-let ((map (current-local-map)))
     (keymap-lookup map keys accept-default)))
 
-(compat-defun keymap-global-lookup (keys &optional accept-default _message) ;; 
<OK>
+(compat-defun keymap-global-lookup (keys &optional accept-default _message) ;; 
[[compat-tests:keymap-global-lookup]]
   "Return the binding for command KEYS in current global keymap only.
 KEY is a string that satisfies `key-valid-p'.
 
@@ -831,7 +831,7 @@ about this.
 NOTE: The compatibility version is not a command."
   (keymap-lookup (current-global-map) keys accept-default))
 
-(compat-defun define-keymap (&rest definitions) ;; <OK>
+(compat-defun define-keymap (&rest definitions) ;; 
[[compat-tests:defvar-keymap]]
   "Create a new keymap and define KEY/DEFINITION pairs as key bindings.
 The new keymap is returned.
 
@@ -914,7 +914,7 @@ should be a MENU form as accepted by `easy-menu-define'.
               (keymap-set keymap key def)))))
       keymap)))
 
-(compat-defmacro defvar-keymap (variable-name &rest defs) ;; <OK>
+(compat-defmacro defvar-keymap (variable-name &rest defs) ;; 
[[compat-tests:defvar-keymap]]
   "Define VARIABLE-NAME as a variable with a keymap definition.
 See `define-keymap' for an explanation of the keywords and KEY/DEFINITION.
 
@@ -996,7 +996,7 @@ command exists in this specific map, but it doesn't have the
 
 ;;;; Defined in button.el
 
-(compat-defun button--properties (callback data help-echo) ;; <OK>
+(compat-defun button--properties (callback data help-echo) ;; 
[[compat-tests:buttonize]]
   "Helper function."
   (list 'font-lock-face 'button
         'mouse-face 'highlight
@@ -1008,7 +1008,7 @@ command exists in this specific map, but it doesn't have 
the
         'keymap button-map
         'action callback))
 
-(compat-defun buttonize (string callback &optional data help-echo) ;; <OK>
+(compat-defun buttonize (string callback &optional data help-echo) ;; 
[[compat-tests:buttonize]]
   "Make STRING into a button and return it.
 When clicked, CALLBACK will be called with the DATA as the
 function argument.  If DATA isn't present (or is nil), the button
@@ -1024,7 +1024,7 @@ Also see `buttonize-region'."
     (add-face-text-property 0 (length string) 'button t string)
     string))
 
-(compat-defun buttonize-region (start end callback &optional data help-echo) 
;; <OK>
+(compat-defun buttonize-region (start end callback &optional data help-echo) 
;; [[compat-tests:buttonize-region]]
   "Make the region between START and END into a button.
 When clicked, CALLBACK will be called with the DATA as the
 function argument.  If DATA isn't present (or is nil), the button
@@ -1037,7 +1037,7 @@ Also see `buttonize'."
   (add-face-text-property start end 'button t))
 
 ;; Obsolete Alias since 29
-(compat-defalias button-buttonize buttonize :obsolete t)
+(compat-defalias button-buttonize buttonize :obsolete t) ;; 
[[compat-tests:button-buttonize]]
 
 (provide 'compat-29)
 ;;; compat-29.el ends here
diff --git a/compat-tests.el b/compat-tests.el
index 1e977bbe35..b40824b60f 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -24,6 +24,15 @@
 ;; tests yet, please contribute tests here.  NO GUARANTEES ARE MADE FOR
 ;; FUNCTIONS WITHOUT TESTS.
 
+;; Functions which are tested are marked with a link to the testsuite.
+;; The links can be enabled, by executing:
+;;
+;; (add-to-list 'org-link-abbrev-alist
+;;   '("compat-tests" . "file:compat-tests.el::ert-deftest %s ()"))
+;;
+;;  You can then jump to the links with the command
+;;  `org-open-at-point-global', ideally bound to a convenient key.
+
 ;; The tests are written in a simple, explicit style.  Please inspect the
 ;; tests in order to find out the supported calling conventions.  In
 ;; particular, note the use of `compat-call' to call functions, where the
@@ -101,6 +110,14 @@
     (should-equal 'h (get-text-property 0 'help-echo b))
     (should-equal 'h (get-text-property 5 'help-echo b))))
 
+(ert-deftest button-buttonize ()
+  (let ((b (with-no-warnings (button-buttonize "button" 'c 'd))))
+    (should-equal b "button")
+    (should-equal 'c (get-text-property 0 'action b))
+    (should-equal 'c (get-text-property 5 'action b))
+    (should-equal 'd (get-text-property 0 'button-data b))
+    (should-equal 'd (get-text-property 5 'button-data b))))
+
 (ert-deftest buttonize-region ()
   (with-temp-buffer
     (insert "<button>")
@@ -708,9 +725,12 @@
   (should-equal compat-tests--local-c 3))
 
 (ert-deftest gensym ()
-  (should (symbolp (gensym "compat")))
-  (should (string-prefix-p "compat" (symbol-name (gensym 'compat))))
-  (should (string-prefix-p "compat" (symbol-name (gensym "compat")))))
+  (let ((orig gensym-counter))
+    (should (integerp gensym-counter))
+    (should (symbolp (gensym "compat")))
+    (should (string-prefix-p "compat" (symbol-name (gensym 'compat))))
+    (should (string-prefix-p "compat" (symbol-name (gensym "compat"))))
+    (should-equal gensym-counter (+ orig 3))))
 
 (ert-deftest plist-get ()
   (let (list)
@@ -733,7 +753,7 @@
 (ert-deftest garbage-collect-maybe ()
   (garbage-collect-maybe 10))
 
-(ert-deftest buffer-hahs ()
+(ert-deftest buffer-hash ()
   (should-equal (sha1 "foo") "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33")
   (should-equal (with-temp-buffer
                    (insert "foo")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]