emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* oc-basic: CSL-JSON year as number vs. string (nativecomp?)
@ 2022-06-18  6:34 David Lukeš
  2022-06-19  1:44 ` Ihor Radchenko
  0 siblings, 1 reply; 13+ messages in thread
From: David Lukeš @ 2022-06-18  6:34 UTC (permalink / raw)
  To: emacs-orgmode

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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-07-31  4:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-18  6:34 oc-basic: CSL-JSON year as number vs. string (nativecomp?) David Lukeš
2022-06-19  1:44 ` Ihor Radchenko
2022-06-19  1:55   ` Bruce D'Arcus
2022-06-19  3:31     ` David Lukeš
2022-06-19 13:39       ` Bruce D'Arcus
2022-06-20 12:06         ` Ihor Radchenko
2022-06-20 13:11           ` Bruce D'Arcus
2022-06-20 14:13             ` David Lukeš
2022-06-20 14:24               ` Bruce D'Arcus
2022-06-21  3:28               ` Ihor Radchenko
2022-06-21 12:02                 ` David Lukeš
2022-07-31  4:05                   ` Ihor Radchenko
2022-06-20 12:04       ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).