Files
dotemacs/mostalive/convert-chats-to-org.el
T
Willem van den Ende ecfeb97728 WIP example instead of test
output is \"marcevers\\n 17\\n sentence1\\n\")))

plus a lot of junk
2023-04-12 19:07:39 +02:00

21 lines
585 B
EmacsLisp

;;; mostalive/convert-chats-to-org.el -*- lexical-binding: t; -*-
(defun chat-remove-hourse-ago ()
"Format chat messages by adding '|' separator and user names."
(interactive)
(save-excursion
(goto-char (point-min))
(while (re-search-forward "hours ago" nil t)
(replace-match ""))))
(ert-deftest test-format-chat-messages-adds-separators ()
(should
(string=
(with-temp-buffer
(org-mode)
(insert "marcevers\n 17 hours ago\n sentence 1\n")
(goto-char (point-min))
(format-chat-messages)
)
"|marcevers | sentence1\n")))