[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/paredit 0c805ec 188/224: Rework HTML output to simplify an
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/paredit 0c805ec 188/224: Rework HTML output to simplify and prettify everything. |
Date: |
Sat, 7 Aug 2021 09:22:47 -0400 (EDT) |
branch: elpa/paredit
commit 0c805ec381996f02c2be2ebf8a124cf70ca4a2ff
Author: Taylor R Campbell <campbell@mumble.net>
Commit: Taylor R Campbell <campbell@mumble.net>
Rework HTML output to simplify and prettify everything.
---
paredit.el | 62 ++++++++++++++++++++------------------------------------------
1 file changed, 20 insertions(+), 42 deletions(-)
diff --git a/paredit.el b/paredit.el
index 0f7a990..57d7dd8 100644
--- a/paredit.el
+++ b/paredit.el
@@ -534,50 +534,28 @@ Paredit behaves badly if parentheses are unbalanced, so
exercise
"Insert HTML for a paredit quick reference table."
(interactive)
(let ((insert-lines
- (lambda (&rest lines)
- (mapc (lambda (line) (insert line) (newline))
- lines)))
- (html-keys
- (lambda (keys)
- (mapconcat 'paredit-html-quote keys ", ")))
- (html-example
- (lambda (example)
- (concat "<table><tr><td><pre>"
- (mapconcat 'paredit-html-quote
- example
- (concat "</pre></td></tr><tr><td>"
- " --->"
- "</td></tr><tr><td><pre>"))
- "</pre></td></tr></table>")))
- (firstp t))
+ (lambda (&rest lines) (dolist (line lines) (insert line) (newline)))))
(paredit-do-commands (spec keys fn examples)
- (progn (if (not firstp)
- (insert "</table>\n")
- (setq firstp nil))
- (funcall insert-lines
- (concat "<h3>" spec "</h3>")
- "<table border=\"1\" cellpadding=\"1\">"
- " <tr>"
- " <th>Command</th>"
- " <th>Keys</th>"
- " <th>Examples</th>"
- " </tr>"))
+ (funcall insert-lines (concat "<h3>" spec "</h3>"))
(let ((name (symbol-name fn)))
- (if (string-match (symbol-name 'paredit-) name)
- (funcall insert-lines
- " <tr>"
- (concat " <td><tt>" name "</tt></td>")
- (concat " <td align=\"center\">"
- (funcall html-keys keys)
- "</td>")
- (concat " <td>"
- (if examples
- (mapconcat html-example examples
- "<hr>")
- "(no examples)")
- "</td>")
- " </tr>")))))
- (insert "</table>\n"))
+ (funcall insert-lines (concat "<h4>" name "</h4>"))
+ (funcall insert-lines
+ "<p>Keys: "
+ (mapconcat (lambda (key)
+ (concat "<tt>" (paredit-html-quote key) "</tt>"))
+ keys
+ ", ")
+ "</p>")
+ (funcall insert-lines "<table cellpadding=\"10\">")
+ (dolist (example examples)
+ (let ((prefix "<tr><td><pre>")
+ (examples
+ (mapconcat 'paredit-html-quote
+ example
+ (concat "</pre></td><td>→</td><td><pre>")))
+ (suffix "</pre></td></tr>"))
+ (funcall insert-lines (concat prefix examples suffix))))
+ (funcall insert-lines "</table>")))))
(defun paredit-html-quote (string)
(with-temp-buffer
- [nongnu] elpa/paredit 18cf19f 164/224: Implement `paredit-preserving-column'., (continued)
- [nongnu] elpa/paredit 18cf19f 164/224: Implement `paredit-preserving-column'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 5840f55 165/224: Preserve column better in `paredit-join'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 9838fe2 174/224: In check.sh, use $EMACS if set, defaulting to `emacs'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 3bdd840 175/224: Rework paredit-semicolon and add some tests for it., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 014cdfe 177/224: Handle shift selection in motion commands in recent GNU Emacs., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit be28e85 178/224: Mention shift selection for motion commands in NEWS., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 42a0494 179/224: Use $EMACS in genhtml.sh too., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 856d927 180/224: Use `paredit-preserving-column' in `paredit-reindent-defun'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit a26c148 182/224: Bind M-[ to paredit-wrap-square., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 4e5ba81 184/224: Make slurping `(|) foo' yield `(|foo)', not `(| foo)'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 0c805ec 188/224: Rework HTML output to simplify and prettify everything.,
ELPA Syncer <=
- [nongnu] elpa/paredit 5114a62 193/224: If in a string, slurp into the enclosing list if necessary., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 8b38538 190/224: A little more HTML tweaking. Not perfect, but enough for the day., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 6304b64 191/224: Suggest `M-x enable-paredit-mode RET'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit b68216f 197/224: Add news item about changes to HTML reference., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit cde0dbb 199/224: Note nicer slurpage into an empty list in NEWS., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit d36f200 200/224: Add autoload cookie for `enable-paredit-mode'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit bf19566 198/224: Note omission of `backward-down-list' in NEWS., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 848a68b 204/224: Bump version number 24->25., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 35dc7b1 207/224: Appease `version-to-list' syntax in Version: keyword., ELPA Syncer, 2021/08/07
- [nongnu] elpa/paredit 9a696fd 208/224: Make the mode line lighter a configurable variable., ELPA Syncer, 2021/08/07