- ;; erc-match
- (csetq
- erc-pal-highlight-type 'nick
- erc-pals
- '("bremner" "^gopar" "^iank" "quidam" "^rwp" "sudoman"
- "technomancy" "thomzane"))
+ ;; erc-log
+ (defun b/erc-log-directory (buffer target _nick server _port)
+ (let ((directory (concat (b/var "erc/logs/")
+ ;; (or (with-current-buffer buffer
+ ;; (symbol-name erc-network))
+ ;; server)
+ server
+ (if (erc-server-buffer-p buffer)
+ (concat "/" server)
+ (and target (concat "/" target))))))
+ (unless (file-exists-p directory)
+ (make-directory directory 'make-parents))
+ directory))
+ (defun b/erc-log-file-name (&rest _)
+ (concat (format-time-string "%Y-%m-%d") ".log"))
+ (setq
+ ;; erc-enable-logging 'erc-log-all-but-server-buffers
+ erc-generate-log-file-name-function #'b/erc-log-file-name
+ erc-log-channels-directory #'b/erc-log-directory
+ erc-log-file-coding-system 'utf-8
+ erc-log-write-after-insert t
+ erc-log-write-after-send t
+ erc-save-buffer-on-part nil
+ erc-save-queries-on-quit nil)
+