From 66d637451e2fa063b5c5e8f26f5df020f1bceb76 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Tue, 9 Jul 2013 14:59:11 +0000 Subject: Tweak HTML output a little more. --- paredit.el | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'paredit.el') diff --git a/paredit.el b/paredit.el index 57d7dd8..2083066 100644 --- a/paredit.el +++ b/paredit.el @@ -534,19 +534,26 @@ Paredit behaves badly if parentheses are unbalanced, so exercise "Insert HTML for a paredit quick reference table." (interactive) (let ((insert-lines - (lambda (&rest lines) (dolist (line lines) (insert line) (newline))))) + (lambda (&rest lines) (dolist (line lines) (insert line) (newline)))) + (initp nil)) (paredit-do-commands (spec keys fn examples) - (funcall insert-lines (concat "

" spec "

")) - (let ((name (symbol-name fn))) - (funcall insert-lines (concat "

" name "

")) + (progn (if initp + (funcall insert-lines "") + (setq initp t)) + (funcall insert-lines (concat "

" spec "

")) + (funcall insert-lines "")) + (let ((name (symbol-name fn)) + (keys + (mapconcat (lambda (key) + (concat "" (paredit-html-quote key) "")) + keys + ", "))) + (funcall insert-lines "") + (funcall insert-lines (concat " ")) + (funcall insert-lines (concat " ")) + (funcall insert-lines "") (funcall insert-lines - "

Keys: " - (mapconcat (lambda (key) - (concat "" (paredit-html-quote key) "")) - keys - ", ") - "

") - (funcall insert-lines "
" name "" keys "
") + "
") (dolist (example examples) (let ((prefix "")) (funcall insert-lines (concat prefix examples suffix)))) - (funcall insert-lines "
")
                 (examples
@@ -555,7 +562,8 @@ Paredit behaves badly if parentheses are unbalanced, so exercise
                             (concat "
")))
                 (suffix "
"))))) + (funcall insert-lines "
"))) + (funcall insert-lines ""))) (defun paredit-html-quote (string) (with-temp-buffer -- cgit v1.2.1