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
|
||||
(mapcan
|
||||
(lambda (spec)
|
||||
(let* ((match (car (or (--keep
|
||||
(when-let ((x (cdr-safe
|
||||
(s-match (car it) spec))))
|
||||
(cons x (cdr it)))
|
||||
(let* ((match
|
||||
(or (--some (-some-> (s-match (car it) spec)
|
||||
cdr (cons (cdr it)))
|
||||
alist)
|
||||
(user-error "Invalid problem spec")))))
|
||||
(user-error "Invalid problem spec \"%s\"" spec))))
|
||||
(apply (cdr match) (mapcar #'string-to-number (car match)))))
|
||||
specs)))
|
||||
(insert "\n")
|
||||
(move-to-left-margin)
|
||||
(dolist (num problems)
|
||||
(insert (format "- [ ] %d\n" num)))))
|
||||
#+end_src
|
||||
|
|
Loading…
Reference in a new issue