[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
oc-basic: CSL-JSON year as number vs. string (nativecomp?)
From: |
David Lukeš |
Subject: |
oc-basic: CSL-JSON year as number vs. string (nativecomp?) |
Date: |
Sat, 18 Jun 2022 08:34:01 +0200 |
Hi all,
I've run into more problems with CSL-JSON support in oc-basic
(previously:
https://list.orgmode.org/CAEPTPExcZKGAm3v-brzezfCwMM4h3hQtOq+89Qg+5ULJq1K4Yw@mail.gmail.com/).
I recently started to get errors like the following:
Error during redisplay: (jit-lock-function 544) signaled
(wrong-type-argument "Argument is not a string or a secondary string:
2007")
This patch makes them go away:
diff --git a/lisp/oc-basic.el b/lisp/oc-basic.el
index a937f7513..9e00310a4 100644
--- a/lisp/oc-basic.el
+++ b/lisp/oc-basic.el
@@ -189,7 +189,7 @@ Return a hash table with citation references as
keys and fields alist as values.
(cons 'year
(cond
((consp date)
- (caar date))
+ (number-to-string (caar date)))
((stringp date)
(replace-regexp-in-string
(rx
In this case, date is an array of numbers, so (caar date) is a number
(the publication year). Converting it to a string is the obvious fix.
Not sure why I haven't run into this error earlier, but I switched to
Emacs 28 somewhat recently, so nativecomp may be the problem here? It
sure seems plausible it wouldn't like a number where a string is
expected.
Best,
David
- oc-basic: CSL-JSON year as number vs. string (nativecomp?),
David Lukeš <=
- Re: oc-basic: CSL-JSON year as number vs. string (nativecomp?), Ihor Radchenko, 2022/06/18
- Re: oc-basic: CSL-JSON year as number vs. string (nativecomp?), Bruce D'Arcus, 2022/06/18
- Re: oc-basic: CSL-JSON year as number vs. string (nativecomp?), David Lukeš, 2022/06/18
- Re: oc-basic: CSL-JSON year as number vs. string (nativecomp?), Bruce D'Arcus, 2022/06/19
- Re: oc-basic: CSL-JSON year as number vs. string (nativecomp?), Ihor Radchenko, 2022/06/20
- Re: oc-basic: CSL-JSON year as number vs. string (nativecomp?), Bruce D'Arcus, 2022/06/20
- Re: oc-basic: CSL-JSON year as number vs. string (nativecomp?), David Lukeš, 2022/06/20
- Re: oc-basic: CSL-JSON year as number vs. string (nativecomp?), Bruce D'Arcus, 2022/06/20
- Re: oc-basic: CSL-JSON year as number vs. string (nativecomp?), Ihor Radchenko, 2022/06/20
- Re: oc-basic: CSL-JSON year as number vs. string (nativecomp?), David Lukeš, 2022/06/21