aboutsummaryrefslogtreecommitdiff
path: root/compat-29.el
diff options
context:
space:
mode:
authorMartin Edström <meedstrom91@gmail.com>2025-11-04 15:25:07 +0100
committerGitHub <noreply@github.com>2025-11-04 15:25:07 +0100
commit393c6b02fe1f5bcd02d7f419ff4b08a6087c032a (patch)
tree66d9fd6036aa459d9a2b9abe57d6907931064ffa /compat-29.el
parentcccd41f549fa88031a32deb26253b462021d7e12 (diff)
compat-29: Add string-glyph-compose and string-glyph-decompose (#76)
Diffstat (limited to 'compat-29.el')
-rw-r--r--compat-29.el24
1 files changed, 24 insertions, 0 deletions
diff --git a/compat-29.el b/compat-29.el
index a0831e6..2896fc8 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -641,6 +641,30 @@ The variable list SPEC is the same as in `if-let*'."
,@body)
(throw ',done nil))))))
+;;;; Defined in ucs-normalize.el
+
+(compat-defun string-glyph-compose (string) ;; <compat-tests:string-glyph-compose>
+ "Compose STRING according to the Unicode NFC.
+This returns a new string obtained by canonical decomposition
+of STRING (see `ucs-normalize-NFC-string') followed by canonical
+composition, a.k.a. the \"Unicode Normalization Form C\" of STRING.
+For instance:
+
+ (string-glyph-compose \"Å\") => \"Å\""
+ (unless (fboundp 'ucs-normalize-NFC-string)
+ (require 'ucs-normalize))
+ (ucs-normalize-NFC-string string))
+
+(compat-defun string-glyph-decompose (string) ;; <compat-tests:string-glyph-decompose>
+ "Decompose STRING according to the Unicode NFD.
+This returns a new string that is the canonical decomposition of STRING,
+a.k.a. the \"Unicode Normalization Form D\" of STRING. For instance:
+
+ (ucs-normalize-NFD-string \"Å\") => \"Å\""
+ (unless (fboundp 'ucs-normalize-NFD-string)
+ (require 'ucs-normalize))
+ (ucs-normalize-NFD-string string))
+
;;;; Defined in files.el
(compat-defun directory-abbrev-make-regexp (directory) ;; <compat-tests:directory-abbrev-make-regexp>