From: ueno Date: Sat, 22 Nov 2003 01:12:07 +0000 (+0000) Subject: * riece-log.el (riece-log-coding-system): New user option. X-Git-Tag: riece-0_1_7~24 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=619ea78a4c09e5105c2e600b800aa541547417df;p=elisp%2Friece.git * riece-log.el (riece-log-coding-system): New user option. (riece-log-display-message-function): Bind coding-system-for-write; don't create temp buffer. * riece-rdcc.el (riece-rdcc-filter): Use write-region instead of append-to-file to suppress "Wrote file" messages. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a642dff..957cf15 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2003-11-22 Daiki Ueno + + * riece-log.el (riece-log-coding-system): New user option. + (riece-log-display-message-function): Bind + coding-system-for-write; don't create temp buffer. + + * riece-rdcc.el (riece-rdcc-filter): Use write-region instead of + append-to-file to suppress "Wrote file" messages. + 2003-11-10 Daiki Ueno * Riece: Version 0.1.6 released. diff --git a/lisp/riece-log.el b/lisp/riece-log.el index 8acc9da..caa1e9c 100644 --- a/lisp/riece-log.el +++ b/lisp/riece-log.el @@ -55,6 +55,11 @@ If integer, flash back only this line numbers. t means all lines." (boolean :tag "flash back or not")) :group 'riece-log) +(defcustom riece-log-coding-system nil + "*Coding system used for log files." + :type 'symbol + :group 'riece-log) + (defun riece-log-display-message-function (message) (let ((open-bracket (funcall riece-message-make-open-bracket-function message)) @@ -62,14 +67,14 @@ If integer, flash back only this line numbers. t means all lines." (funcall riece-message-make-close-bracket-function message)) (name (funcall riece-message-make-name-function message)) - (file (riece-log-get-file (riece-message-target message)))) + (file (riece-log-get-file (riece-message-target message))) + (coding-system-for-write riece-log-coding-system)) (unless (file-directory-p (file-name-directory file)) (make-directory (file-name-directory file) t)) - (with-temp-buffer - (insert (concat (format-time-string "%H:%M") " " - open-bracket name close-bracket - " " (riece-message-text message) "\n")) - (write-region (point-min) (point-max) file t 0)))) + (write-region (concat (format-time-string "%H:%M") " " + open-bracket name close-bracket + " " (riece-message-text message) "\n") + nil file t 0))) (defun riece-log-get-file (identity) (expand-file-name @@ -80,7 +85,7 @@ If integer, flash back only this line numbers. t means all lines." (let ((channel (riece-identity-prefix identity)) (server (riece-identity-server identity)) (map (assoc (riece-format-identity identity) riece-log-directory-map)) - name) + name) (cond (map (setq name (cdr map))) ((string-match riece-channel-regexp channel) (let ((suffix (match-string 2 channel))) diff --git a/lisp/riece-rdcc.el b/lisp/riece-rdcc.el index 55eccc5..188fb76 100644 --- a/lisp/riece-rdcc.el +++ b/lisp/riece-rdcc.el @@ -189,7 +189,7 @@ puts(\"#{" address " >> 24 & 0xFF}.#{" address " >> 16 & 0xFF}.#{" (insert input) (let ((coding-system-for-write 'binary) jka-compr-compression-info-list jam-zcat-filename-list) - (append-to-file (point-min) (point-max) riece-rdcc-temp-file)) + (write-region (point-min) (point-max) riece-rdcc-temp-file t 0)) (message "Receiving %s from %s...(%s/%s)" (file-name-nondirectory riece-rdcc-request-file) riece-rdcc-request-user