aboutsummaryrefslogtreecommitdiff
path: root/compat-29.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-08-01 17:22:17 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2023-08-01 17:22:17 +0200
commit3d0e0469197ee574b3c3d310bd7987a5ec60f087 (patch)
tree1662d798569e94a1db7d431499b0853122ec262d /compat-29.el
parentba8091c57fbb822c6b7093d0a01d455fa60d49ff (diff)
compat-29: Add char-uppercase-p
Diffstat (limited to 'compat-29.el')
-rw-r--r--compat-29.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/compat-29.el b/compat-29.el
index 675d2c7..fc17e0f 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -506,6 +506,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)))