21 lines
585 B
EmacsLisp
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")))
|