]> code.delx.au - gnu-emacs/blobdiff - lisp/erc/erc-track.el
* lisp/erc/erc.el: Use lexical-binding.
[gnu-emacs] / lisp / erc / erc-track.el
index 054c135fa67ba7e0034822f4eccf88f1d23f1b03..e6d5b3119a28b69c807af9977ac08c0984782677 100644 (file)
@@ -1,4 +1,4 @@
-;;; erc-track.el --- Track modified channel buffers
+;;; erc-track.el --- Track modified channel buffers  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 2002-2013 Free Software Foundation, Inc.
 
@@ -710,7 +710,7 @@ inactive."
 to consider when `erc-track-visibility' is set to
 only consider active buffers visible.")
 
-(defun erc-user-is-active (&rest ignore)
+(defun erc-user-is-active (&rest _ignore)
   "Set `erc-buffer-activity'."
   (when erc-server-connected
     (setq erc-buffer-activity (erc-current-time))
@@ -745,7 +745,7 @@ only consider active buffers visible.")
 times.  Without it, you cannot debug `erc-modified-channels-display',
 because the debugger also cases changes to the window-configuration.")
 
-(defun erc-modified-channels-update (&rest args)
+(defun erc-modified-channels-update (&rest _args)
   "This function updates the information in `erc-modified-channels-alist'
 according to buffer visibility.  It calls
 `erc-modified-channels-display' at the end. This should usually be
@@ -791,19 +791,19 @@ If FACES are provided, color STRING with them."
                          (int-to-string count))
                (copy-sequence string))))
     (define-key map (vector 'mode-line 'mouse-2)
-      `(lambda (e)
-        (interactive "e")
-        (save-selected-window
-          (select-window
-           (posn-window (event-start e)))
-          (switch-to-buffer ,buffer))))
+      (lambda (e)
+       (interactive "e")
+       (save-selected-window
+         (select-window
+          (posn-window (event-start e)))
+         (switch-to-buffer buffer))))
     (define-key map (vector 'mode-line 'mouse-3)
-      `(lambda (e)
-        (interactive "e")
-        (save-selected-window
-          (select-window
-           (posn-window (event-start e)))
-          (switch-to-buffer-other-window ,buffer))))
+      (lambda (e)
+       (interactive "e")
+       (save-selected-window
+         (select-window
+          (posn-window (event-start e)))
+         (switch-to-buffer-other-window buffer))))
     (put-text-property 0 (length name) 'local-map map name)
     (put-text-property
      0 (length name)
@@ -976,8 +976,9 @@ is in `erc-mode'."
        cur)
     (while (and (setq i (next-single-property-change i 'face str m))
                (not (= i m)))
-      (when (setq cur (get-text-property i 'face str))
-       (add-to-list 'faces cur)))
+      (and (setq cur (get-text-property i 'face str))
+          (not (member cur faces))
+          (push cur faces)))
     faces))
 
 (cl-assert