summaryrefslogtreecommitdiff
path: root/lisp/erc
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2007-11-01 01:12:59 +0000
committerMichael Olson <mwolson@gnu.org>2007-11-01 01:12:59 +0000
commit88406d6ee8a9108ae8265aac2f023e61f4bff827 (patch)
tree2756fffbdbb4bef290fd853db955a886a7a179fe /lisp/erc
parentbce6be12b94d6008266d60dac6d3062d1126611f (diff)
downloademacs-88406d6ee8a9108ae8265aac2f023e61f4bff827.tar.gz
Silence some byte-compiler warnings in ERC
Diffstat (limited to 'lisp/erc')
-rw-r--r--lisp/erc/ChangeLog14
-rw-r--r--lisp/erc/erc-compat.el3
-rw-r--r--lisp/erc/erc-log.el9
-rw-r--r--lisp/erc/erc-stamp.el4
-rw-r--r--lisp/erc/erc.el17
5 files changed, 32 insertions, 15 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 1cd1edb65eb..929df097790 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -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
diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el
index 47bdd94ade2..d6591415867 100644
--- a/lisp/erc/erc-compat.el
+++ b/lisp/erc/erc-compat.el
@@ -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
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el
index 7ea3c63b4b2..8b5e07a383e 100644
--- a/lisp/erc/erc-log.el
+++ b/lisp/erc/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/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el
index 3b7f5ba18f2..64b04051d91 100644
--- a/lisp/erc/erc-stamp.el
+++ b/lisp/erc/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/lisp/erc/erc.el b/lisp/erc/erc.el
index 7b27f278bed..fab8f7ca1b9 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/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))