Refactor problem spec code
This commit is contained in:
parent
ef7caec424
commit
52a62591b6
11
config.org
11
config.org
|
@ -3546,15 +3546,14 @@ This section is for code with little or no associated documentation. This could
|
||||||
(problems
|
(problems
|
||||||
(mapcan
|
(mapcan
|
||||||
(lambda (spec)
|
(lambda (spec)
|
||||||
(let* ((match (car (or (--keep
|
(let* ((match
|
||||||
(when-let ((x (cdr-safe
|
(or (--some (-some-> (s-match (car it) spec)
|
||||||
(s-match (car it) spec))))
|
cdr (cons (cdr it)))
|
||||||
(cons x (cdr it)))
|
|
||||||
alist)
|
alist)
|
||||||
(user-error "Invalid problem spec")))))
|
(user-error "Invalid problem spec \"%s\"" spec))))
|
||||||
(apply (cdr match) (mapcar #'string-to-number (car match)))))
|
(apply (cdr match) (mapcar #'string-to-number (car match)))))
|
||||||
specs)))
|
specs)))
|
||||||
(insert "\n")
|
(move-to-left-margin)
|
||||||
(dolist (num problems)
|
(dolist (num problems)
|
||||||
(insert (format "- [ ] %d\n" num)))))
|
(insert (format "- [ ] %d\n" num)))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
Loading…
Reference in a new issue