diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-08-22 00:06:45 -0400 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-08-22 00:06:45 -0400 |
| commit | d0fcaff514d2be16ccf73817f658318cf85221e3 (patch) | |
| tree | 4487e4c21b07bdb58fdbf8a5a9b4512d05fbd310 /lisp/erc/erc-notify.el | |
| parent | 8352b530871b89683c6a64e76ff22ed26e1701fd (diff) | |
| download | emacs-d0fcaff514d2be16ccf73817f658318cf85221e3.tar.gz | |
* lisp/erc/erc.el: Use lexical-binding.
(erc-user-full-name): Minor CSE simplification.
(erc-mode-map): Assume command-remapping is available.
(erc-once-with-server-event): Replace `forms' arg with a function arg.
(erc-once-with-server-event-global): Remove.
(erc-ison-p): Adjust to change in erc-once-with-server-event.
(erc-get-buffer-create): Remove arg `proc'.
(iswitchb-make-buflist-hook): Declare.
(erc-setup-buffer): Use pcase; avoid ((lambda ..) ..).
(read-passwd): Assume it exists.
(erc-display-line, erc-cmd-IDLE): Avoid add-to-list, adjust to change
in erc-once-with-server-event.
(erc-cmd-JOIN, erc-set-channel-limit, erc-set-channel-key)
(erc-add-query): Minor CSE simplification.
(erc-cmd-BANLIST, erc-cmd-MASSUNBAN): Adjust to change
in erc-once-with-server-event.
(erc-echo-notice-in-user-and-target-buffers): Avoid add-to-list.
* lisp/erc/erc-track.el: Use lexical-binding.
(erc-make-mode-line-buffer-name): Use closures instead of `(lambda...).
(erc-faces-in): Avoid add-to-list.
* lisp/erc/erc-notify.el: Use lexical-binding.
(erc-notify-timer): Adjust to change in erc-once-with-server-event.
(erc-notify-QUIT): Use a closure instead of `(lambda...).
* lisp/erc/erc-list.el: Use lexical-binding.
(erc-list-install-322-handler, erc-cmd-LIST): Adjust to change in
erc-once-with-server-event.
* lisp/erc/erc-button.el: Use lexical-binding.
(erc-button-next-function): Use a closure instead of `(lambda...).
Diffstat (limited to 'lisp/erc/erc-notify.el')
| -rw-r--r-- | lisp/erc/erc-notify.el | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el index db7067eec08..064bb53f215 100644 --- a/lisp/erc/erc-notify.el +++ b/lisp/erc/erc-notify.el @@ -1,4 +1,4 @@ -;;; erc-notify.el --- Online status change notification +;;; erc-notify.el --- Online status change notification -*- lexical-binding:t -*- ;; Copyright (C) 2002-2004, 2006-2013 Free Software Foundation, Inc. @@ -115,27 +115,28 @@ changes." erc-notify-interval)) (erc-once-with-server-event 303 - '(let* ((server (erc-response.sender parsed)) - (ison-list (delete "" (split-string - (erc-response.contents parsed)))) - (new-list ison-list) - (old-list (erc-with-server-buffer erc-last-ison))) - (while new-list - (when (not (erc-member-ignore-case (car new-list) old-list)) - (run-hook-with-args 'erc-notify-signon-hook server (car new-list)) - (erc-display-message - parsed 'notice proc - 'notify_on ?n (car new-list) ?m (erc-network-name))) - (setq new-list (cdr new-list))) - (while old-list - (when (not (erc-member-ignore-case (car old-list) ison-list)) - (run-hook-with-args 'erc-notify-signoff-hook server (car old-list)) - (erc-display-message - parsed 'notice proc - 'notify_off ?n (car old-list) ?m (erc-network-name))) - (setq old-list (cdr old-list))) - (setq erc-last-ison ison-list) - t)) + (lambda (proc parsed) + (let* ((server (erc-response.sender parsed)) + (ison-list (delete "" (split-string + (erc-response.contents parsed)))) + (new-list ison-list) + (old-list (erc-with-server-buffer erc-last-ison))) + (while new-list + (when (not (erc-member-ignore-case (car new-list) old-list)) + (run-hook-with-args 'erc-notify-signon-hook server (car new-list)) + (erc-display-message + parsed 'notice proc + 'notify_on ?n (car new-list) ?m (erc-network-name))) + (setq new-list (cdr new-list))) + (while old-list + (when (not (erc-member-ignore-case (car old-list) ison-list)) + (run-hook-with-args 'erc-notify-signoff-hook server (car old-list)) + (erc-display-message + parsed 'notice proc + 'notify_off ?n (car old-list) ?m (erc-network-name))) + (setq old-list (cdr old-list))) + (setq erc-last-ison ison-list) + t))) (erc-server-send (concat "ISON " (mapconcat 'identity erc-notify-list " "))) (setq erc-last-ison-time now))) @@ -179,10 +180,11 @@ nick from `erc-last-ison' to prevent any further notifications." (let ((nick (erc-extract-nick (erc-response.sender parsed)))) (when (and (erc-member-ignore-case nick erc-notify-list) (erc-member-ignore-case nick erc-last-ison)) - (setq erc-last-ison (erc-delete-if `(lambda (el) - (string= ,(erc-downcase nick) - (erc-downcase el))) - erc-last-ison)) + (setq erc-last-ison (erc-delete-if + (let ((nick-down (erc-downcase nick))) + (lambda (el) + (string= nick-down (erc-downcase el)))) + erc-last-ison)) (run-hook-with-args 'erc-notify-signoff-hook (or erc-server-announced-name erc-session-server) nick) |
