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

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

[nongnu] elpa/julia-mode 38b74a9 164/352: emacs-mode fix for emacs 22: n


From: ELPA Syncer
Subject: [nongnu] elpa/julia-mode 38b74a9 164/352: emacs-mode fix for emacs 22: need to check whether codepoints outside the BMP are supported by emacs
Date: Sun, 29 Aug 2021 11:22:37 -0400 (EDT)

branch: elpa/julia-mode
commit 38b74a902c8a692f86884e74252fc6da2ec45bed
Author: Steven G. Johnson <stevenj@alum.mit.edu>
Commit: Yichao Yu <yyc1992@gmail.com>

    emacs-mode fix for emacs 22: need to check whether codepoints outside the 
BMP are supported by emacs
---
 julia-mode.el | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/julia-mode.el b/julia-mode.el
index 7fe5ea6..d01ee28 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -381,12 +381,18 @@ Do not move back beyond MIN."
 
 ; LaTeX-like symbol substitutions, equivalent to those in the Julia REPL,
 ; generated by:
-; for (k,v) in sort!(collect(Base.REPLCompletions.latex_symbols), by=x->x[2])
+;for (k,v) in sort!(collect(Base.REPLCompletions.latex_symbols), by=x->x[2])
+;    ks = escape_string(k)
 ;    vs = escape_string(v)
-;    vs = replace(vs, r"\\U[0-9A-Fa-f]+",
-;                 s -> "\\U" * hex(parseint(s[3:end], 16), 8))
-;    println("(puthash \"$(escape_string(k))\" \"$vs\" julia-latexsubs)")
-; end
+;    if ismatch(r"^\\U[0-9A-Fa-f]+$", vs)
+;        # codepoints outside the BMP can be problematic in older Emacsen
+;        cp = vs[3:end]
+;        println("(let ((c (decode-char 'ucs #x$cp)))\n",
+;                "  (if c (puthash \"$ks\" (char-to-string c) 
julia-latexsubs)))")
+;    else
+;        println("(puthash \"$ks\" \"$vs\" julia-latexsubs)")
+;    end
+;end
 (puthash "\\textexclamdown" "ยก" julia-latexsubs)
 (puthash "\\sterling" "ยฃ" julia-latexsubs)
 (puthash "\\yen" "ยฅ" julia-latexsubs)
@@ -2024,7 +2030,8 @@ Do not move back beyond MIN."
 (puthash "\\mscri" "๐’พ" julia-latexsubs)
 (puthash "\\mscrj" "๐’ฟ" julia-latexsubs)
 (puthash "\\mscrk" "๐“€" julia-latexsubs)
-(puthash "\\mscrl" "\U0001d4c1" julia-latexsubs)
+(let ((c (decode-char 'ucs #x1d4c1)))
+  (if c (puthash "\\mscrl" (char-to-string c) julia-latexsubs)))
 (puthash "\\mscrm" "๐“‚" julia-latexsubs)
 (puthash "\\mscrn" "๐“ƒ" julia-latexsubs)
 (puthash "\\mscrp" "๐“…" julia-latexsubs)
@@ -2494,8 +2501,10 @@ Do not move back beyond MIN."
 (puthash "\\mttx" "๐šก" julia-latexsubs)
 (puthash "\\mtty" "๐šข" julia-latexsubs)
 (puthash "\\mttz" "๐šฃ" julia-latexsubs)
-(puthash "\\imath" "\U0001d6a4" julia-latexsubs)
-(puthash "\\jmath" "\U0001d6a5" julia-latexsubs)
+(let ((c (decode-char 'ucs #x1d6a4)))
+  (if c (puthash "\\imath" (char-to-string c) julia-latexsubs)))
+(let ((c (decode-char 'ucs #x1d6a5)))
+  (if c (puthash "\\jmath" (char-to-string c) julia-latexsubs)))
 (puthash "\\mbfAlpha" "๐šจ" julia-latexsubs)
 (puthash "\\mbfBeta" "๐šฉ" julia-latexsubs)
 (puthash "\\mbfGamma" "๐šช" julia-latexsubs)
@@ -2786,8 +2795,10 @@ Do not move back beyond MIN."
 (puthash "\\mbfitsansvarphi" "๐Ÿ‡" julia-latexsubs)
 (puthash "\\mbfitsansvarrho" "๐Ÿˆ" julia-latexsubs)
 (puthash "\\mbfitsansvarpi" "๐Ÿ‰" julia-latexsubs)
-(puthash "\\mbfDigamma" "\U0001d7ca" julia-latexsubs)
-(puthash "\\mbfdigamma" "\U0001d7cb" julia-latexsubs)
+(let ((c (decode-char 'ucs #x1d7ca)))
+  (if c (puthash "\\mbfDigamma" (char-to-string c) julia-latexsubs)))
+(let ((c (decode-char 'ucs #x1d7cb)))
+  (if c (puthash "\\mbfdigamma" (char-to-string c) julia-latexsubs)))
 (puthash "\\mbfzero" "๐ŸŽ" julia-latexsubs)
 (puthash "\\mbfone" "๐Ÿ" julia-latexsubs)
 (puthash "\\mbftwo" "๐Ÿ" julia-latexsubs)



reply via email to

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