summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2021-04-19 20:15:54 -0400
committerAmin Bandali <bandali@gnu.org>2021-04-19 20:15:54 -0400
commit07e389456cc015e1d2ab505822983f5207f6e74a (patch)
tree691d02b85935b4c0667266137059ac00f95c398c
parent42afc39eeb7616d04cb0ef448f43ceeaf5fdbdd8 (diff)
downloadconfigs-07e389456cc015e1d2ab505822983f5207f6e74a.tar.gz
configs-07e389456cc015e1d2ab505822983f5207f6e74a.tar.xz
configs-07e389456cc015e1d2ab505822983f5207f6e74a.zip
* .emacs.d/lisp/bandali-erc.el: Custom log directory and file names
Diffstat (limited to '')
-rw-r--r--.emacs.d/lisp/bandali-erc.el18
1 files changed, 16 insertions, 2 deletions
diff --git a/.emacs.d/lisp/bandali-erc.el b/.emacs.d/lisp/bandali-erc.el
index 803ba91..5fed2bc 100644
--- a/.emacs.d/lisp/bandali-erc.el
+++ b/.emacs.d/lisp/bandali-erc.el
@@ -92,10 +92,24 @@
;; (erc-fill-mode -1)
;; 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"))
(csetq
;; erc-enable-logging 'erc-log-all-but-server-buffers
- erc-generate-log-file-name-function 'erc-generate-log-file-name-with-date
- erc-log-channels-directory (b/var "erc/logs")
+ 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