aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/lisp/my/infobox.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/.emacs.d/lisp/my/infobox.el')
-rw-r--r--emacs/.emacs.d/lisp/my/infobox.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/emacs/.emacs.d/lisp/my/infobox.el b/emacs/.emacs.d/lisp/my/infobox.el
index 518c7db..2c33ae9 100644
--- a/emacs/.emacs.d/lisp/my/infobox.el
+++ b/emacs/.emacs.d/lisp/my/infobox.el
@@ -27,6 +27,13 @@
;;; Code:
+(defun infobox-transform-field-value (v)
+ (cond ((stringp v) v)
+ ((eq v t) "YES")
+ ((eq v :json-false) "NO")
+ ((seqp v) (mapconcat #'identity v ", "))
+ (t (format "%s" v))))
+
(defun infobox-default-specs (info)
(seq-map
(lambda (pair)
@@ -47,7 +54,7 @@ something like
(lambda (pair)
(when-let ((val (alist-get (car pair) info)))
(if (or (stringp (cdr pair)) (symbolp (cdr pair)))
- (cons (cdr pair) val)
+ (cons (cdr pair) (infobox-transform-field-value val))
(cons (cadr pair) (funcall (cddr pair) val)))))
specs))