From b1597d1d04111259b2deed336826ff1a85a51328 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 12 Jan 2019 22:55:37 +0100 Subject: Improve IRC timestamp logging --- emacs/.emacs.d/init.el | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index b9b4d36..e10892f 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -134,7 +134,14 @@ '(erc-log-insert-log-on-open t) '(erc-log-mode t) '(erc-mode-line-format "%t") + '(erc-modules + (quote + (autojoin button completion irccontrols list match menu move-to-prompt netsplit networks noncommands readonly ring stamp track))) '(erc-prompt ">") + '(erc-stamp-mode t) + '(erc-timestamp-format "%H:%M ") + '(erc-timestamp-only-if-changed-flag t) + '(erc-timestamp-use-align-to nil) '(erc-track-exclude-server-buffer t) '(erc-track-exclude-types (quote @@ -400,6 +407,22 @@ (setq indent-tabs-mode nil) (setq show-trailing-whitespace))) +;; IRC + +(make-variable-buffer-local + (defvar erc-last-datestamp nil)) + +;; Show minute timestamps on the left and a date header when they change +(defun ks-timestamp (string) + (erc-insert-timestamp-left string) + (let ((datestamp (erc-format-timestamp (current-time) erc-datestamp-format))) + (unless (string= datestamp erc-last-datestamp) + (erc-insert-timestamp-left datestamp) + (setq erc-last-datestamp datestamp)))) + +(setq erc-datestamp-format "[%Y-%m-%d %a]\n" + erc-insert-timestamp-function 'ks-timestamp) + ;; PDF (defun my-doc-view-hook () -- cgit v1.2.1