Complete multiple channels when joining.
[riece] / lisp / riece-log.el
index 93a4ed9..c525d25 100644 (file)
@@ -1,4 +1,4 @@
-;;; riece-log.el --- Save IRC logs
+;;; riece-log.el --- Save IRC logs -*- lexical-binding: t -*-
 ;; Copyright (C) 2003 OHASHI Akira
 ;; Copyright (C) 2004 Daiki Ueno
 
@@ -31,6 +31,7 @@
 
 (require 'riece-message)
 (require 'riece-button)
+(require 'riece-mcat)
 
 (defgroup riece-log nil
   "Save IRC logs."
@@ -101,8 +102,7 @@ It is created if there is at least one instance of Emacs running riece-log.")
                                              'coding-system)))))
             (file (riece-log-make-file-name (riece-message-target message)
                                             coding-system-for-write))
-            file-name-coding-system
-            default-file-name-coding-system)
+            (file-name-coding-system 'no-conversion))
        (unless (file-directory-p (file-name-directory file))
          (make-directory (file-name-directory file) t))
        (write-region (concat (format-time-string "%H:%M") " "
@@ -111,7 +111,7 @@ It is created if there is at least one instance of Emacs running riece-log.")
                      riece-log-lock-file))))
 
 (defun riece-log-make-file-name (identity coding-system)
-  (expand-file-name (if (featurep 'mule)
+  (expand-file-name (if (and (featurep 'mule) coding-system)
                        (format "%s.txt.%s"
                                (format-time-string "%Y%m%d")
                                coding-system)
@@ -184,8 +184,7 @@ It is created if there is at least one instance of Emacs running riece-log.")
 (defun riece-log-insert (identity lines)
   "Insert logs for IDENTITY at most LINES.
 If LINES is t, insert today's logs entirely."
-  (let* (file-name-coding-system
-        default-file-name-coding-system
+  (let* ((file-name-coding-system 'no-conversion)
         (files (riece-log-list-files identity
                                      (if (eq lines t) (current-time))))
         name coding-system date point)
@@ -237,8 +236,9 @@ If LINES is t, insert today's logs entirely."
   (when riece-log-flashback
     (riece-insert-info (current-buffer)
                       (if (eq riece-log-flashback t)
-                          "Recent messages of the day:\n"
-                        (format "Recent messages up to %d lines:\n"
+                          (riece-mcat "Recent messages of the day:\n")
+                        (format (riece-mcat
+                                 "Recent messages up to %d lines:\n")
                                 riece-log-flashback)))
     (let (buffer-read-only
          (point (goto-char (point-max))))