summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-09-27 15:49:13 -0400
committerSacha Chua <sacha@sachachua.com>2022-09-27 15:49:13 -0400
commit1a6997d1da94f3bed859f5170a1e2f70ce6aa1a0 (patch)
tree04ee85abed3419e000c6e4ca0c10225c4d1ee949
parente1e49b49b168ab2df4fb2c28b3d4ed4a5ded962c (diff)
downloademacsconf-el-1a6997d1da94f3bed859f5170a1e2f70ce6aa1a0.tar.xz
emacsconf-el-1a6997d1da94f3bed859f5170a1e2f70ce6aa1a0.zip
Import comments
-rw-r--r--emacsconf.el39
1 files changed, 39 insertions, 0 deletions
diff --git a/emacsconf.el b/emacsconf.el
index f1d1cc8..63fb6f0 100644
--- a/emacsconf.el
+++ b/emacsconf.el
@@ -680,5 +680,44 @@ Include some other things, too, such as emacsconf-year, title, name, email, url,
time
emacsconf-timezone))))
+;;; Etherpad
+(defun emacsconf-import-comments-from-etherpad-text (filename)
+ (interactive "FEtherpad text export: ")
+ (with-temp-buffer
+ (insert-file-contents filename)
+ (goto-char (point-min))
+ (while (re-search-forward "^\t+Comments for \\([^:]+\\)" nil t)
+ (let ((slug (match-string 1))
+ comments)
+ (forward-line 1)
+ (setq comments
+ (split-string
+ (replace-regexp-in-string
+ "\t\t\\*"
+ "- "
+ (buffer-substring-no-properties
+ (point)
+ (if (re-search-forward "^[^\t]" nil t)
+ (match-beginning 0)
+ (point-max))))
+ "\n"))
+ (save-window-excursion
+ (emacsconf-with-talk-heading slug
+ ;; Do we already have a heading for comments?
+ (if (re-search-forward "^\\(\\*+\\) +Review comments" (save-excursion (org-end-of-subtree)) t)
+ (org-end-of-meta-data)
+ (org-end-of-subtree)
+ (org-insert-heading-after-current)
+ (insert "Review comments\n"))
+ ;; Are these comments already included?
+ (save-restriction
+ (org-narrow-to-subtree)
+ (mapc (lambda (o)
+ (goto-char (point-min))
+ (unless (re-search-forward (regexp-quote o) nil t)
+ (goto-char (point-max))
+ (unless (bolp) (insert "\n"))
+ (insert o "\n")))
+ comments))))))))
(provide 'emacsconf)
;;; emacsconf.el ends here