I propose that LISP-like code snippets be posted not with [code] tags, but instead, with [m] tags.
I suggest this because the prettyprint script Shiichan uses is designed for C-like languages. We've all experienced an entire post worth of greentext because of an "unmatched" apostrophe. It's distracting!
It's not a perfect solution, but it's the best one we have. But it's not so bad: the color isn't as significant so much as the fixed-width formatting anyway. So when posting LISP-like code, use [m] tags!
Also, please don't try to use [aa] tags. That could cause a real mess!
or you know we could just use (quote foo) instead of 'foo. Or perhaps quasiquote if the following test is successful (define (hax a . b)
(define (haxit x) `(hax my ,x))
(if (null? b)
(haxit a)
`(,@(map haxit (cons a b))))) ; yes i know i could have just used the map by itself, but i want to see if shitchan matches backticks (hax (quote anus))
(hax my anus) (hax (quote anus) (quote thread) (quote post))
((hax my anus) (hax my thread) (hax my post))
I tend to use m-tags if I have # or ' in the code, otherwise code-tags.
I also have my own formatter that looks like: (defun write-tag (tag s) (format nil "[~a]~a[/~a]" tag s tag))
(defun escape-slash (s) (substitute "\" "\\" s))
(defun fancy-format (s) (escape-slash (write-tag "m" (with-output-to-string (o) (loop for c across s
do (princ (case c ((#[b]([/b] #[b])[/b])(write-tag "b" c)) (t c))
o))))))
I only use it from time to time, as I don't always feel like testing for possible bbcode failures (like now).
And that obviously had to fuck up somehow... I forgot to account for the damn Emacs tabs which I should have turned off to begin with.
(defun write-tag (tag s) (format nil "[~a]~a[/~a]" tag s tag))
(defun escape-slash (s) (substitute "\" "\\" s))
(defun fancy-format (s) (escape-slash (write-tag "m" (with-output-to-string (o) (loop for c across s
do (princ (case c ((#[b]([/b] #[b])[/b])(write-tag "b" c)) (t c))
o))))))
>>7
It only does that when there is no genuine bold font available and it has to fake it based on the regular-weight one, which isn't going to happen for the vast majority of fonts a user is likely to have installed.