]> git.eshelyaron.com Git - emacs.git/commitdiff
Silence some byte-compiler warnings in ERC
authorMichael Olson <mwolson@gnu.org>
Thu, 1 Nov 2007 01:12:59 +0000 (01:12 +0000)
committerMichael Olson <mwolson@gnu.org>
Thu, 1 Nov 2007 01:12:59 +0000 (01:12 +0000)
lisp/erc/ChangeLog
lisp/erc/erc-compat.el
lisp/erc/erc-log.el
lisp/erc/erc-stamp.el
lisp/erc/erc.el

index 1cd1edb65eb81af9a05b415f0ca9c75031c1d237..929df097790dfbb1ee36a97f3927862d66963a06 100644 (file)
@@ -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
index 47bdd94ade2ae387f70abc67768ded6caf82393b..d659141586794e2fdcbaccaa06234257a08bd82f 100644 (file)
@@ -50,6 +50,9 @@ See `erc-encoding-coding-alist'."
 (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
index 7ea3c63b4b2c1f0c538669c41ec7b7b41f690537..8b5e07a383e8c5671e3806bcbeb2a81da14db92a 100644 (file)
@@ -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
index 3b7f5ba18f24c0631c721772c50ee3d3fdec4530..64b04051d9146b7b2afa814ebf250a308d113c90 100644 (file)
@@ -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
index 7b27f278bed456a17aba80fc782c4faf331be4f0..fab8f7ca1b95504ba7313894189e81889bc931ee 100644 (file)
@@ -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))