X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;ds=sidebyside;f=lisp%2Friece-log.el;h=352fa03c086d6a1fbe16d4c282c3fcd050a91971;hb=503c9a229a8a8ee049091ef6d2cdff38d0704f43;hp=a2573feb8b37f09ddf45aad18d7d1c0d4e99eaff;hpb=495493e8e3978d3e178ce15f341b192177dbba88;p=riece diff --git a/lisp/riece-log.el b/lisp/riece-log.el index a2573fe..352fa03 100644 --- a/lisp/riece-log.el +++ b/lisp/riece-log.el @@ -30,8 +30,8 @@ ;;; Code: -(eval-when-compile (require 'riece-message) - (require 'riece-button)) +(require 'riece-message) +(require 'riece-button) (defgroup riece-log nil "Save irc log" @@ -68,6 +68,9 @@ If integer, flash back only this line numbers. t means all lines." (defvar riece-log-enabled nil) +(defconst riece-log-description + "Saving IRC logs") + (defun riece-log-display-message-function (message) (if riece-log-enabled (let ((file (riece-log-get-file (riece-message-target message))) @@ -102,7 +105,7 @@ If integer, flash back only this line numbers. t means all lines." (expand-file-name name riece-log-directory)))) (defun riece-log-flashback (identity) - (when (and riece-log-enabled riece-log-flashback) + (when riece-log-flashback (let ((file (riece-log-get-file identity))) (when (file-exists-p file) (let (string) @@ -124,8 +127,9 @@ If integer, flash back only this line numbers. t means all lines." (riece-make-identity (riece-match-string-no-properties 1) (riece-identity-server identity)))) - (if (memq 'riece-button riece-addons) - (riece-button-update-buffer)) + (when (and (memq 'riece-button riece-addons) + riece-button-enabled) + (riece-button-update-buffer)) (goto-char (point-max)) (set-window-point (get-buffer-window (current-buffer)) (point))))))))