Update --ux

This commit is contained in:
Marcus Kammer 2023-02-23 18:25:29 +01:00
parent 8932b39d6b
commit ad337f8b49

View file

@ -319,3 +319,11 @@
(let* ((questions (ux:questions-by-category category))
(lang-questions (remove nil (mapcar #'(lambda (x) (member lang x)) questions))))
(remove lang (flatten-tree lang-questions))))
(defun ux:filtered-tbl (sym tbl)
"Return entry of table when SYM is member of entry"
(remove nil (mapcar (lambda (entry) (when (member sym (car (cl-remove-if-not #'listp entry))) entry)) tbl)))
(defun ux:filter-tbl (sym tbl)
(cond ((null sym) tbl)
(t (ux:filter-tbl (cdr sym) (ux:filtered-tbl (car sym) tbl)))))