Code Select
(dolist (temp input-list)
(when (not (or
(starts-with temp "#")
(starts-with temp "t")))
(setq temp (replace " " temp " "))
(push (string temp "<br>") result-list -1))
(when (starts-with temp "#")
(push (heading temp) result-list -1)))
It does what it should do, but not with the first line. It has no (exit) function at the end, so I can look what is in input-list. The first line is "### whatever" and e.g. the fifth is "### whatever-again". But it applies the first (when) to the first line and the second (when) function to all the others starting with "#". This is completely crazy.
Linux my-notebook 3.14-0.bpo.2-686-pae #1 SMP Debian 3.14.15-2~bpo70+1 (2014-08-21) i686 GNU/Linux
newLISP v.10.6.2 32-bit on Linux IPv4/6 UTF-8 libffi