branch: externals/compat
commit bf4b9aaa2e80cae253f23561b93a2feacf74d004
Merge: d843192e64 75d0b8527f
Author: Philip Kaludercic <phil...@posteo.net>
Commit: Philip Kaludercic <phil...@posteo.net>

    Merge branch 'master' into emacs-30
---
 .github/workflows/makefile.yml |  1 +
 NEWS.org                       |  7 +++++++
 compat-28.el                   |  5 ++---
 compat-29.el                   | 18 ++++++++++++++----
 compat-tests.el                | 22 +++++++++++++++++++++-
 compat.el                      |  2 +-
 compat.texi                    | 27 +++++++++++++++++++++++----
 7 files changed, 69 insertions(+), 13 deletions(-)

diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml
index 49c0728a28..027cc2d5aa 100644
--- a/.github/workflows/makefile.yml
+++ b/.github/workflows/makefile.yml
@@ -31,6 +31,7 @@ jobs:
           - '27.2'
           - '28.1'
           - '28.2'
+          - '29.1'
           - 'release-snapshot'
           - 'snapshot'
     steps:
diff --git a/NEWS.org b/NEWS.org
index d938a193e5..daaf138539 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -4,12 +4,19 @@
 
 * Development
 
+- compat-29: Add function =char-uppercase-p=.
+- compat-29: Add function =window-configuration-equal-p=.
+
+* Release of "Compat" Version 29.1.4.2
+
 - compat-28: Improve =make-separator-line= visuals on graphic displays.
 - compat-28: Add =native-comp-available-p=, which always returns nil.
 - compat-29: Add variable =lisp-directory=.
 - compat-30: Replace ~copy-tree~ with version from Emacs 30, support
   copying records with non-nil optional second argument.
 
+(Release <2023-07-30 Sun>)
+
 * Release of "Compat" Version 29.1.4.1
 
 - compat-29: Add ~directory-abbrev-apply~.
diff --git a/compat-28.el b/compat-28.el
index fe69315522..b305ab2fff 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -52,9 +52,8 @@ issues are inherited."
   (when (and start-pos (or (< (length haystack) start-pos)
                            (< start-pos 0)))
     (signal 'args-out-of-range (list start-pos)))
-  (save-match-data
-    (let ((case-fold-search nil))
-      (string-match (regexp-quote needle) haystack start-pos))))
+  (let (case-fold-search)
+    (string-match-p (regexp-quote needle) haystack start-pos)))
 
 (compat-defun length= (sequence length) ;; [[compat-tests:length=]]
   "Returns non-nil if SEQUENCE has a length equal to LENGTH."
diff --git a/compat-29.el b/compat-29.el
index b02424bead..3db94c944b 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -25,11 +25,9 @@
 (compat-require compat-28 "28.1")
 
 ;; Preloaded in loadup.el
-;; TODO Update to 29.1 as soon as the Emacs emacs-29 branch version bumped
-(compat-require seq "29.0.90") ;; <compat-tests:seq>
+(compat-require seq "29.1") ;; <compat-tests:seq>
 
-;; TODO Update to 29.1 as soon as the Emacs emacs-29 branch version bumped
-(compat-version "29.0.90")
+(compat-version "29.1")
 
 ;;;; Defined in startup.el
 
@@ -39,6 +37,10 @@
       (locate-file "simple" load-path (get-load-suffixes))))
   "Directory where Emacs's own *.el and *.elc Lisp files are installed.")
 
+;;;; Defined in window.c
+
+(compat-defalias window-configuration-equal-p compare-window-configurations) 
;; <compat-tests:window-configuration-equal-p>
+
 ;;;; Defined in xdisp.c
 
 (compat-defun get-display-property (position prop &optional object properties) 
;; <compat-tests:get-display-property>
@@ -508,6 +510,14 @@ thus overriding the value of the TIMEOUT argument to that 
function.")
 
 ;;;; Defined in simple.el
 
+(compat-defun char-uppercase-p (char) ;; <compat-tests:char-uppercase-p>
+  "Return non-nil if CHAR is an upper-case character.
+If the Unicode tables are not yet available, e.g. during bootstrap,
+then gives correct answers only for ASCII characters."
+  (cond ((unicode-property-table-internal 'lowercase)
+         (characterp (get-char-code-property char 'lowercase)))
+        ((and (>= char ?A) (<= char ?Z)))))
+
 (compat-defun use-region-noncontiguous-p () ;; 
<compat-tests:region-noncontiguous-p>
   "Return non-nil for a non-contiguous region if `use-region-p'."
   (and (use-region-p) (region-noncontiguous-p)))
diff --git a/compat-tests.el b/compat-tests.el
index 37935743a8..1bb1f3ed35 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -406,6 +406,15 @@
       (should-equal (getenv A) B))
     (should-not (getenv A))))
 
+(ert-deftest compat-window-configuration-equal-p ()
+  (let ((wc (current-window-configuration)))
+    (should (window-configuration-equal-p wc wc))
+    (save-window-excursion
+      (with-temp-buffer
+        (pop-to-buffer (current-buffer))
+        (should-not (window-configuration-equal-p 
(current-window-configuration) wc))))
+    (should (window-configuration-equal-p (current-window-configuration) wc))))
+
 (ert-deftest compat-with-window-non-dedicated ()
   (unwind-protect
       (progn
@@ -1828,6 +1837,12 @@
       (should-equal (replace-regexp-in-region " bar" "" (point-min) 8) 1)
       (should-equal (buffer-string) "foo bar"))))
 
+(ert-deftest compat-char-uppercase-p ()
+  (dolist (c (list ?R ?S ?Ω ?Ψ))
+    (should (char-uppercase-p c)))
+  (dolist (c (list ?a ?b ?α ?β))
+    (should-not (char-uppercase-p c))))
+
 (ert-deftest compat-string-split ()
   (should-equal '("a" "b" "c") (split-string "a b c"))
   (should-equal '("a" "b" "c") (string-split "a b c")))
@@ -2121,7 +2136,12 @@
     ;; backport this behaviour.
     (should-equal 2 (string-search (compat-tests--string-to-multibyte "\377") 
"ab\377c"))
     (should-equal 2 (string-search (compat-tests--string-to-multibyte 
"o\303\270")
-                                   "foo\303\270"))))
+                                   "foo\303\270")))
+  ;; Ensure that `match-data' is preserved by `string-search'
+  (string-match (rx (* "a") (group (* "b")) (* "a")) "abba")
+  (should-equal '(0 4 1 3) (match-data))
+  (should (string-search "foo" "foobar"))
+  (should-equal '(0 4 1 3) (match-data)))
 
 (ert-deftest compat-string-replace ()
   (should-equal "bba" (string-replace "aa" "bb" "aaa"))
diff --git a/compat.el b/compat.el
index 215216a479..14e061f10b 100644
--- a/compat.el
+++ b/compat.el
@@ -4,7 +4,7 @@
 
 ;; Author: Philip Kaludercic <phil...@posteo.net>, Daniel Mendler 
<m...@daniel-mendler.de>
 ;; Maintainer: Daniel Mendler <m...@daniel-mendler.de>, Compat Development 
<~pkal/compat-de...@lists.sr.ht>
-;; Version: 29.1.4.1
+;; Version: 29.1.4.2
 ;; URL: https://github.com/emacs-compat/compat
 ;; Package-Requires: ((emacs "24.4") (seq "2.3"))
 ;; Keywords: lisp, maint
diff --git a/compat.texi b/compat.texi
index f0db42f470..178106c564 100644
--- a/compat.texi
+++ b/compat.texi
@@ -31,7 +31,7 @@ modify this GNU manual.”
 @finalout
 @titlepage
 @title "Compat" Manual
-@subtitle For version 29.1.4.1
+@subtitle For version 29.1.4.2
 @author Philip Kaludercic, Daniel Mendler
 @page
 @vskip 0pt plus 1filll
@@ -46,7 +46,7 @@ modify this GNU manual.”
 
 This manual documents the usage of the "Compat" Emacs lisp library,
 the forward-compatibility library for Emacs Lisp, corresponding to
-version 29.1.4.1.
+version 29.1.4.2.
 
 @insertcopying
 @end ifnottex
@@ -108,7 +108,7 @@ mirrors the version of Emacs releases.  The current version 
of Compat
 corresponds to the upcoming Emacs 29 release.
 
 @example
-;; Package-Requires: ((emacs "24.4") (compat "29.1.4.1"))
+;; Package-Requires: ((emacs "24.4") (compat "29.1.4.2"))
 @end example
 
 There is no need to depend on @code{emacs 24.4} specifically.  One can
@@ -2444,6 +2444,12 @@ Like @code{line-end-position}, but ignores fields (and 
is more
 efficient).
 @end defun
 
+@c copied from lispref/display.texi
+@defun char-uppercase-p char
+Return non-@code{nil} if @var{char} is an uppercase character
+according to Unicode.
+@end defun
+
 @c copied from lispref/display.texi
 @defmac with-delayed-message (timeout message) body@dots{}
 Sometimes it's unclear whether an operation will take a long time to
@@ -2908,7 +2914,7 @@ local map.
 @xref{Key Binding Commands,,,elisp}.
 @end defun
 
-@c based on from lisp/keymap.el
+@c based on lisp/keymap.el
 @defun keymap-substitute keymap olddef newdef &optional oldmap prefix
 Replace @var{olddef} with @var{newdef} for any keys in @var{keymap}
 now defined as @var{olddef}.  In other words, @var{olddef} is replaced
@@ -3056,6 +3062,13 @@ Like @code{when-let}, but repeat until a binding in 
@var{spec} is
 This is comparable to @code{and-let*}.
 @end defmac
 
+@c copied from lispref/windows.texi
+@defun window-configuration-equal-p config1 config2
+This function says whether two window configurations have the same
+window layout, but ignores the values of point and the saved scrolling
+positions---it can return @code{t} even if those aspects differ.
+@end defun
+
 @c based on lisp/emacs-lisp/ert-x.el
 @defmac ert-with-temp-file name &rest body
 Bind @var{name} to the name of a new temporary file and evaluate
@@ -3302,6 +3315,10 @@ The function @code{minibuffer-lazy-highlight-setup}.
 @item
 The function @code{pp-emacs-lisp-code}.
 @item
+The function @code{bidi-string-strip-control-characters}.
+@item
+The native function @code{current-cpu-time}.
+@item
 The functions @code{xdg-state-home}, @code{xdg-current-desktop} and 
@code{xdg-session-type}.
 @item
 The macro @code{setopt}.
@@ -3317,6 +3334,8 @@ The @code{string-edit} library.
 The @code{vtable} library.
 @item
 The @code{pixel-fill} library.
+@item
+Support for symbols with position information.
 @end itemize
 
 @node Emacs 30.1

Reply via email to