erc-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Erc-commit] [commit][master] Fix some byte-compiler warnings


From: mwolson
Subject: [Erc-commit] [commit][master] Fix some byte-compiler warnings
Date: Wed, 31 Oct 2007 21:20:07 -0400

commit d65e9d7dd24ca25439f4fa00e976b52d5f883c83
Author: Michael W. Olson <address@hidden>
Date:   Wed Oct 31 21:08:45 2007 -0400

    Fix some byte-compiler warnings
    
    * 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.

diff --git a/ChangeLog b/ChangeLog
index 24e7e71..97d5100 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2007-11-01  Michael Olson  <address@hidden>
+
+       * 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  <address@hidden>
 
        * erc-ibuffer.el (erc-modified-channels-alist): Use
diff --git a/erc-compat.el b/erc-compat.el
index 672b11e..626d812 100644
--- a/erc-compat.el
+++ b/erc-compat.el
@@ -208,6 +208,19 @@ one is kept."
       ((fboundp 'replace-in-string)
        (defun erc-replace-regexp-in-string (regexp rep string &optional 
fixedcase literal)
          (replace-in-string string regexp rep literal))))
+
+;;; Several different Emacsen have different variables for setting
+;;; write hooks.
+(cond ((boundp 'write-file-functions)
+       (defun erc-set-write-file-functions (new-val)
+        (set (make-local-variable 'write-file-functions) new-val)))
+      ((boundp 'local-write-file-hooks)
+       (defun erc-set-write-file-functions (new-val)
+        (setq local-write-file-hooks new-val)))
+      (t
+       (defun erc-set-write-file-functions (new-val)
+        (set (make-local-variable 'write-file-hooks) new-val))))
+
 ;;; Done!
 
 ;; XEmacs has a string representation of the build time.  It's
diff --git a/erc-log.el b/erc-log.el
index 7ea3c63..8b5e07a 100644
--- a/erc-log.el
+++ b/erc-log.el
@@ -268,14 +268,7 @@ The current buffer is given by BUFFER."
     (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
diff --git a/erc-stamp.el b/erc-stamp.el
index 3b7f5ba..64b0405 100644
--- a/erc-stamp.el
+++ b/erc-stamp.el
@@ -264,6 +264,10 @@ property to get to the POSth column."
                       (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
diff --git a/erc.el b/erc.el
index 18efee6..2b6494c 100644
--- a/erc.el
+++ b/erc.el
@@ -1680,13 +1680,16 @@ nil."
   ;; 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))
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]