changeset 85845:e95712050fdc

Silence some byte-compiler warnings in ERC
author Michael Olson <mwolson@gnu.org>
date Thu, 01 Nov 2007 01:12:59 +0000
parents cf0d3de08293
children 56cec281e296
files lisp/erc/ChangeLog lisp/erc/erc-compat.el lisp/erc/erc-log.el lisp/erc/erc-stamp.el lisp/erc/erc.el
diffstat 5 files changed, 32 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/erc/ChangeLog	Wed Oct 31 21:17:32 2007 +0000
+++ b/lisp/erc/ChangeLog	Thu Nov 01 01:12:59 2007 +0000
@@ -1,3 +1,17 @@
+2007-11-01  Michael Olson  <mwolson@gnu.org>
+
+	* erc-compat.el (erc-set-write-file-functions): New compatibility
+	function to set the write hooks appropriately.
+
+	* erc-log.el (erc-log-setup-logging): Use
+	erc-set-write-file-functions.  This fixes a byte-compiler warning.
+
+	* erc-stamp.el: Silence byte-compiler warning about
+	erc-fill-column.
+
+	* erc.el (erc-with-all-buffers-of-server): Bind the result of
+	mapcar to a variable in order to silence a byte-compiler warning.
+
 2007-10-29  Michael Olson  <mwolson@gnu.org>
 
 	* erc-ibuffer.el (erc-modified-channels-alist): Use
--- a/lisp/erc/erc-compat.el	Wed Oct 31 21:17:32 2007 +0000
+++ b/lisp/erc/erc-compat.el	Thu Nov 01 01:12:59 2007 +0000
@@ -50,6 +50,9 @@
 (defalias 'erc-delete-dups 'delete-dups)
 (defalias 'erc-replace-regexp-in-string 'replace-regexp-in-string)
 
+(defun erc-set-write-file-functions (new-val)
+  (set (make-local-variable 'write-file-functions) new-val))
+
 (defvar erc-emacs-build-time
   (if (stringp emacs-build-time)
       emacs-build-time
--- a/lisp/erc/erc-log.el	Wed Oct 31 21:17:32 2007 +0000
+++ b/lisp/erc/erc-log.el	Thu Nov 01 01:12:59 2007 +0000
@@ -268,14 +268,7 @@
     (with-current-buffer buffer
       (auto-save-mode -1)
       (setq buffer-file-name nil)
-      (cond ((boundp 'write-file-functions)
-	     (set (make-local-variable 'write-file-functions)
-		  '(erc-save-buffer-in-logs)))
-	    ((boundp 'local-write-file-hooks)
-	     (setq local-write-file-hooks '(erc-save-buffer-in-logs)))
-	    (t
-	     (set (make-local-variable 'write-file-hooks)
-		  '(erc-save-buffer-in-logs))))
+      (erc-set-write-file-functions '(erc-save-buffer-in-logs))
       (when erc-log-insert-log-on-open
 	(ignore-errors (insert-file-contents (erc-current-logfile))
 		       (move-marker erc-last-saved-position
--- a/lisp/erc/erc-stamp.el	Wed Oct 31 21:17:32 2007 +0000
+++ b/lisp/erc/erc-stamp.el	Thu Nov 01 01:12:59 2007 +0000
@@ -264,6 +264,10 @@
 		       (list 'space ':align-to pos)))
   (insert string))
 
+;; Silence byte-compiler
+(eval-when-compile
+  (defvar erc-fill-column))
+
 (defun erc-insert-timestamp-right (string)
   "Insert timestamp on the right side of the screen.
 STRING is the timestamp to insert.  The function is a possible value
--- a/lisp/erc/erc.el	Wed Oct 31 21:17:32 2007 +0000
+++ b/lisp/erc/erc.el	Thu Nov 01 01:12:59 2007 +0000
@@ -1680,13 +1680,16 @@
   ;; Make the evaluation have the correct order
   (let ((pre (make-symbol "pre"))
 	(pro (make-symbol "pro")))
-    `(let ((,pro ,process)
-	   (,pre ,pred))
-       (mapcar (lambda (buffer)
-		 (with-current-buffer buffer
-		   ,@forms))
-	       (erc-buffer-list ,pre
-				,pro)))))
+    `(let* ((,pro ,process)
+	    (,pre ,pred)
+	    (res (mapcar (lambda (buffer)
+			   (with-current-buffer buffer
+			     ,@forms))
+			 (erc-buffer-list ,pre
+					  ,pro))))
+       ;; Silence the byte-compiler by binding the result of mapcar to
+       ;; a variable.
+       res)))
 (put 'erc-with-all-buffers-of-server 'lisp-indent-function 1)
 (put 'erc-with-all-buffers-of-server 'edebug-form-spec '(form form body))