;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/erc/erc-log-incal.el (require 'erc-log) (require 'erc-stamp) (setq erc-timestamp-format nil) (setq erc-timestamp-format-left nil) (let ((insert-fun #'ignore)) (setq erc-insert-timestamp-function insert-fun) (setq erc-insert-away-timestamp-function insert-fun) ) ;; (setq erc-timestamp-format "[%s]") ;; (setq erc-timestamp-format-left "[%F]\n") ;; ;; (let ((insert-fun #'erc-insert-timestamp-right)) ;; (setq erc-insert-timestamp-function insert-fun) ;; (setq erc-insert-away-timestamp-function insert-fun) ) (defun erc-pop-to-log (&optional buf) (interactive) (or buf (setq buf (current-buffer))) (let*((log (erc-current-logfile buf)) (log-buf (get-file-buffer log)) ) (if (bufferp log-buf) (progn (pop-to-buffer log-buf) (revert-buffer t t) ) (find-file log) ) (goto-char (point-max)) )) (defun erc-cmd-LOGF (&optional _line) (interactive) (erc-pop-to-log) ) (put 'erc-cmd-LOGF 'do-not-parse-args t) (defalias 'erc-cmd-LOGI #'erc-cmd-LOGF) (defalias 'logf #'erc-cmd-LOGF) (defalias 'logi #'erc-cmd-LOGF) (defun erc-log-subdirectory (_buffer _target _nick server _port) (let ((dir (format "%s%s%s" user-emacs-directory "erc-log/" server))) (unless (file-accessible-directory-p dir) (make-directory dir) ) dir) ) (setq erc-log-channels-directory #'erc-log-subdirectory) (setq erc-generate-log-file-name-function #'erc-generate-log-file-name-short) (setq erc-log-write-after-insert t) (setq erc-log-write-after-send t) (erc-log-enable) (provide 'erc-log-incal)