diff options
Diffstat (limited to 'lisp/erc')
36 files changed, 464 insertions, 318 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 37e755e7655..847b995997c 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,11 +1,102 @@ +2012-11-30 Glenn Morris <rgm@gnu.org> + + * erc.el (erc-accidental-paste-threshold-seconds): Add :version. + +2012-11-30 Eric Hanchrow <eric.hanchrow@gmail.com> + + * erc.el (erc-last-input-time): New variable. + (erc-accidental-paste-threshold-seconds): New option to avoid + sending accidentally-pasted text to the server (Bug#11592). + (erc-send-current-line): Use it. + +2012-11-30 Chong Yidong <cyd@gnu.org> + + * erc.el (erc-lurker-cleanup, erc-lurker-p): Use float-time. + +2012-11-23 Stefan Monnier <monnier@iro.umontreal.ca> + + * erc-backend.el: Fix last change that missed calls to `second' + (bug#12970). + +2012-11-19 Stefan Monnier <monnier@iro.umontreal.ca> + + Use cl-lib instead of cl, and interactive-p => called-interactively-p. + * erc-track.el, erc-networks.el, erc-netsplit.el, erc-dcc.el: + * erc-backend.el: Use cl-lib, nth, pcase, and called-interactively-p + instead of cl. + * erc-speedbar.el, erc-services.el, erc-pcomplete.el, erc-notify.el: + * erc-match.el, erc-log.el, erc-join.el, erc-ezbounce.el: + * erc-capab.el: Don't require cl since we don't use it. + * erc.el: Use cl-lib, nth, pcase, and called-interactively-p i.s.o cl. + (erc-lurker-ignore-chars, erc-common-server-suffixes): + Move before first use. + +2012-11-16 Glenn Morris <rgm@gnu.org> + + * erc.el (erc-modules): Add "notifications". Tweak "hecomplete" doc. + +2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * erc-backend.el: Only require `erc' during compilation (bug#12740). + +2012-10-18 Stefan Monnier <monnier@iro.umontreal.ca> + + * erc-backend.el: Require `erc' instead of autoloading its macros + (bug#12669). + +2012-10-15 Stefan Monnier <monnier@iro.umontreal.ca> + + * erc.el (erc-log): Make it into a defsubst. + (erc-with-server-buffer, define-erc-module, erc-with-buffer) + (erc-with-all-buffers-of-server): Use `declare'. + * erc-backend.el (erc-log): Adjust autoload accordingly. + +2012-10-07 Deniz Dogan <deniz@dogan.se> + + * erc-log.el (erc-generate-log-file-name-function): + Clarify tags for various choices. (Bug#11186) + +2012-10-07 Glenn Morris <rgm@gnu.org> + + * erc-button.el (erc-button-alist): Remove "finger". (Bug#4443) + +2012-10-07 Antoine Levitt <antoine.levitt@gmail.com> + + * erc-stamp.el (erc-format-timestamp): Don't apply intangible + property to invisible stamps. (Bug#11706) + +2012-10-07 Glenn Morris <rgm@gnu.org> + + * erc-backend.el (NICK): Handle pre-existing buffers. (Bug#12002) + +2012-10-06 Glenn Morris <rgm@gnu.org> + + * erc.el (erc-lurker): + * erc-desktop-notifications.el (erc-notifications): + Add missing group :version tags. + +2012-10-04 Julien Danjou <julien@danjou.info> + + * erc-desktop-notifications.el: Rename from erc-notifications to + avoid clash with 8+3 filename format and erc-notify.el. + +2012-09-25 Chong Yidong <cyd@gnu.org> + + * erc.el (erc-send-command): Use define-obsolete-function-alias. + +2012-09-17 Chong Yidong <cyd@gnu.org> + + * erc-page.el (erc-page-function): + * erc-stamp.el (erc-stamp): Doc fix. + 2012-08-21 Josh Feinstein <jlf@foxtail.org> * erc-join.el (erc-autojoin-timing): Fix defcustom type. 2012-08-21 Julien Danjou <julien@danjou.info> - * erc-match.el (erc-match-message): Use - `erc-match-exclude-server-buffer' not + * erc-match.el (erc-match-message): + Use `erc-match-exclude-server-buffer' not `erc-track-exclude-server-buffer'. 2012-08-20 Josh Feinstein <jlf@foxtail.org> @@ -18,8 +109,8 @@ (erc-lurker-threshold-time): New variables. (erc-lurker-maybe-trim, erc-lurker-initialize, erc-lurker-cleanup) (erc-hide-current-message-p, erc-canonicalize-server-name) - (erc-lurker-update-status, erc-lurker-p): New functions. Together - they maintain state about which users have spoken in the last + (erc-lurker-update-status, erc-lurker-p): New functions. + Together they maintain state about which users have spoken in the last erc-lurker-threshold-time, with all other users being considered lurkers whose messages of types in erc-lurker-hide-list will not be displayed by erc-display-message. @@ -88,7 +179,7 @@ (erc-autojoin-after-ident): Ditto. (erc-autojoin-channels-alist): Mention auth-source. -2012-04-10 Deniz Dogan <deniz@dogan.se> (tiny change) +2012-04-10 Deniz Dogan <deniz@dogan.se> * erc.el (erc-display-prompt): Adds the field text property to the ERC prompt. This allows users to use `kill-whole-line' to kill @@ -154,7 +245,7 @@ * erc.el (erc-ssl): Made into a synonym for erc-tls, which provides a superset of the same functionality. - (erc-open-ssl-stream): Removed. + (erc-open-ssl-stream): Remove. (erc-open-tls-stream): Use `open-network-stream' instead of `open-tls-stream' directly to be able to use the built-in TLS support. diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el index ab429a12589..fd9ac69aa3a 100644 --- a/lisp/erc/erc-autoaway.el +++ b/lisp/erc/erc-autoaway.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2002-2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Jorgen Schaefer <forcer@forcix.cx> +;; Maintainer: FSF ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcAutoAway ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 5da3009c854..9b28916623b 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -4,6 +4,7 @@ ;; Filename: erc-backend.el ;; Author: Lawrence Mitchell <wence@gmx.li> +;; Maintainer: FSF ;; Created: 2004-05-7 ;; Keywords: IRC chat client internet @@ -97,16 +98,18 @@ ;;; Code: (require 'erc-compat) -(eval-when-compile (require 'cl)) -(autoload 'erc-with-buffer "erc" nil nil 'macro) -(autoload 'erc-log "erc" nil nil 'macro) +(eval-when-compile (require 'cl-lib)) +;; There's a fairly strong mutual dependency between erc.el and erc-backend.el. +;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the +;; reverse is true: +(eval-when-compile (provide 'erc-backend) (require 'erc)) ;;;; Variables and options (defvar erc-server-responses (make-hash-table :test #'equal) "Hashtable mapping server responses to their handler hooks.") -(defstruct (erc-response (:conc-name erc-response.)) +(cl-defstruct (erc-response (:conc-name erc-response.)) (unparsed "" :type string) (sender "" :type string) (command "" :type string) @@ -947,7 +950,7 @@ PROCs `process-buffer' is `current-buffer' when this function is called." (push str (erc-response.command-args msg)))) (setf (erc-response.contents msg) - (first (erc-response.command-args msg))) + (car (erc-response.command-args msg))) (setf (erc-response.command-args msg) (nreverse (erc-response.command-args msg))) @@ -1042,7 +1045,7 @@ Finds hooks by looking in the `erc-server-responses' hashtable." (name &rest name) &optional sexp sexp def-body)) -(defmacro* define-erc-response-handler ((name &rest aliases) +(cl-defmacro define-erc-response-handler ((name &rest aliases) &optional extra-fn-doc extra-var-doc &rest fn-body) "Define an ERC handler hook/function pair. @@ -1151,11 +1154,11 @@ add things to `%s' instead." "") name hook-name)) (fn-alternates - (loop for alias in aliases - collect (intern (format "erc-server-%s" alias)))) + (cl-loop for alias in aliases + collect (intern (format "erc-server-%s" alias)))) (var-alternates - (loop for alias in aliases - collect (intern (format "erc-server-%s-functions" alias))))) + (cl-loop for alias in aliases + collect (intern (format "erc-server-%s-functions" alias))))) `(prog2 ;; Normal hook variable. (defvar ,hook-name ',fn-name ,(format hook-doc name)) @@ -1169,19 +1172,19 @@ add things to `%s' instead." (put ',hook-name 'definition-name ',name) ;; Hashtable map of responses to hook variables - ,@(loop for response in (cons name aliases) - for var in (cons hook-name var-alternates) - collect `(puthash ,(format "%s" response) ',var - erc-server-responses)) + ,@(cl-loop for response in (cons name aliases) + for var in (cons hook-name var-alternates) + collect `(puthash ,(format "%s" response) ',var + erc-server-responses)) ;; Alternates. ;; Functions are defaliased, hook variables are defvared so we ;; can add hooks to one alias, but not another. - ,@(loop for fn in fn-alternates - for var in var-alternates - for a in aliases - nconc (list `(defalias ',fn ',fn-name) - `(defvar ,var ',fn-name ,(format hook-doc a)) - `(put ',var 'definition-name ',hook-name)))))) + ,@(cl-loop for fn in fn-alternates + for var in var-alternates + for a in aliases + nconc (list `(defalias ',fn ',fn-name) + `(defvar ,var ',fn-name ,(format hook-doc a)) + `(put ',var 'definition-name ',hook-name)))))) (define-erc-response-handler (ERROR) "Handle an ERROR command from the server." nil @@ -1193,10 +1196,10 @@ add things to `%s' instead." (define-erc-response-handler (INVITE) "Handle invitation messages." nil - (let ((target (first (erc-response.command-args parsed))) + (let ((target (car (erc-response.command-args parsed))) (chnl (erc-response.contents parsed))) - (multiple-value-bind (nick login host) - (values-list (erc-parse-user (erc-response.sender parsed))) + (pcase-let ((`(,nick ,login ,host) + (erc-parse-user (erc-response.sender parsed)))) (setq erc-invitation chnl) (when (string= target (erc-current-nick)) (erc-display-message @@ -1209,8 +1212,8 @@ add things to `%s' instead." nil (let ((chnl (erc-response.contents parsed)) (buffer nil)) - (multiple-value-bind (nick login host) - (values-list (erc-parse-user (erc-response.sender parsed))) + (pcase-let ((`(,nick ,login ,host) + (erc-parse-user (erc-response.sender parsed)))) ;; strip the stupid combined JOIN facility (IRC 2.9) (if (string-match "^\\(.*\\)?\^g.*$" chnl) (setq chnl (match-string 1 chnl))) @@ -1246,12 +1249,12 @@ add things to `%s' instead." (define-erc-response-handler (KICK) "Handle kick messages received from the server." nil - (let* ((ch (first (erc-response.command-args parsed))) - (tgt (second (erc-response.command-args parsed))) + (let* ((ch (nth 0 (erc-response.command-args parsed))) + (tgt (nth 1 (erc-response.command-args parsed))) (reason (erc-trim-string (erc-response.contents parsed))) (buffer (erc-get-buffer ch proc))) - (multiple-value-bind (nick login host) - (values-list (erc-parse-user (erc-response.sender parsed))) + (pcase-let ((`(,nick ,login ,host) + (erc-parse-user (erc-response.sender parsed)))) (erc-remove-channel-member buffer tgt) (cond ((string= tgt (erc-current-nick)) @@ -1274,11 +1277,11 @@ add things to `%s' instead." (define-erc-response-handler (MODE) "Handle server mode changes." nil - (let ((tgt (first (erc-response.command-args parsed))) + (let ((tgt (car (erc-response.command-args parsed))) (mode (mapconcat 'identity (cdr (erc-response.command-args parsed)) " "))) - (multiple-value-bind (nick login host) - (values-list (erc-parse-user (erc-response.sender parsed))) + (pcase-let ((`(,nick ,login ,host) + (erc-parse-user (erc-response.sender parsed)))) (erc-log (format "MODE: %s -> %s: %s" nick tgt mode)) ;; dirty hack (let ((buf (cond ((erc-channel-p tgt) @@ -1302,8 +1305,8 @@ add things to `%s' instead." "Handle nick change messages." nil (let ((nn (erc-response.contents parsed)) bufs) - (multiple-value-bind (nick login host) - (values-list (erc-parse-user (erc-response.sender parsed))) + (pcase-let ((`(,nick ,login ,host) + (erc-parse-user (erc-response.sender parsed)))) (setq bufs (erc-buffer-list-with-nick nick proc)) (erc-log (format "NICK: %s -> %s" nick nn)) ;; if we had a query with this user, make sure future messages will be @@ -1315,7 +1318,7 @@ add things to `%s' instead." (when (equal (erc-default-target) nick) (setq erc-default-recipients (cons nn (cdr erc-default-recipients))) - (rename-buffer nn) + (rename-buffer nn t) ; bug#12002 (erc-update-mode-line) (add-to-list 'bufs (current-buffer))))) (erc-update-user-nick nick nn host nil nil login) @@ -1337,11 +1340,11 @@ add things to `%s' instead." (define-erc-response-handler (PART) "Handle part messages." nil - (let* ((chnl (first (erc-response.command-args parsed))) + (let* ((chnl (car (erc-response.command-args parsed))) (reason (erc-trim-string (erc-response.contents parsed))) (buffer (erc-get-buffer chnl proc))) - (multiple-value-bind (nick login host) - (values-list (erc-parse-user (erc-response.sender parsed))) + (pcase-let ((`(,nick ,login ,host) + (erc-parse-user (erc-response.sender parsed)))) (erc-remove-channel-member buffer nick) (erc-display-message parsed 'notice buffer 'PART ?n nick ?u login @@ -1358,7 +1361,7 @@ add things to `%s' instead." (define-erc-response-handler (PING) "Handle ping messages." nil - (let ((pinger (first (erc-response.command-args parsed)))) + (let ((pinger (car (erc-response.command-args parsed)))) (erc-log (format "PING: %s" pinger)) ;; ping response to the server MUST be forced, or you can lose big (erc-server-send (format "PONG :%s" pinger) t) @@ -1376,7 +1379,7 @@ add things to `%s' instead." (when erc-verbose-server-ping (erc-display-message parsed 'notice proc 'PONG - ?h (first (erc-response.command-args parsed)) ?i erc-server-lag + ?h (car (erc-response.command-args parsed)) ?i erc-server-lag ?s (if (/= erc-server-lag 1) "s" ""))) (erc-update-mode-line)))) @@ -1448,8 +1451,8 @@ add things to `%s' instead." "Another user has quit IRC." nil (let ((reason (erc-response.contents parsed)) bufs) - (multiple-value-bind (nick login host) - (values-list (erc-parse-user (erc-response.sender parsed))) + (pcase-let ((`(,nick ,login ,host) + (erc-parse-user (erc-response.sender parsed)))) (setq bufs (erc-buffer-list-with-nick nick proc)) (erc-remove-user nick) (setq reason (erc-wash-quit-reason reason nick login host)) @@ -1459,12 +1462,12 @@ add things to `%s' instead." (define-erc-response-handler (TOPIC) "The channel topic has changed." nil - (let* ((ch (first (erc-response.command-args parsed))) + (let* ((ch (car (erc-response.command-args parsed))) (topic (erc-trim-string (erc-response.contents parsed))) (time (format-time-string erc-server-timestamp-format (current-time)))) - (multiple-value-bind (nick login host) - (values-list (erc-parse-user (erc-response.sender parsed))) + (pcase-let ((`(,nick ,login ,host) + (erc-parse-user (erc-response.sender parsed)))) (erc-update-channel-member ch nick nick nil nil nil host login) (erc-update-channel-topic ch (format "%s\C-o (%s, %s)" topic nick time)) (erc-display-message parsed 'notice (erc-get-buffer ch proc) @@ -1474,8 +1477,8 @@ add things to `%s' instead." (define-erc-response-handler (WALLOPS) "Display a WALLOPS message." nil (let ((message (erc-response.contents parsed))) - (multiple-value-bind (nick login host) - (values-list (erc-parse-user (erc-response.sender parsed))) + (pcase-let ((`(,nick ,login ,host) + (erc-parse-user (erc-response.sender parsed)))) (erc-display-message parsed 'notice nil 'WALLOPS ?n nick ?m message)))) @@ -1483,7 +1486,7 @@ add things to `%s' instead." (define-erc-response-handler (001) "Set `erc-server-current-nick' to reflect server settings and display the welcome message." nil - (erc-set-current-nick (first (erc-response.command-args parsed))) + (erc-set-current-nick (car (erc-response.command-args parsed))) (erc-update-mode-line) ; needed here? (setq erc-nick-change-attempt-count 0) (setq erc-default-nicks (if (consp erc-nick) erc-nick (list erc-nick))) @@ -1504,16 +1507,16 @@ add things to `%s' instead." (define-erc-response-handler (004) "Display the server's identification." nil - (multiple-value-bind (server-name server-version) - (values-list (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,server-name ,server-version) + (cdr (erc-response.command-args parsed)))) (setq erc-server-version server-version) (setq erc-server-announced-name server-name) (erc-update-mode-line-buffer (process-buffer proc)) (erc-display-message parsed 'notice proc 's004 ?s server-name ?v server-version - ?U (fourth (erc-response.command-args parsed)) - ?C (fifth (erc-response.command-args parsed))))) + ?U (nth 3 (erc-response.command-args parsed)) + ?C (nth 4 (erc-response.command-args parsed))))) (define-erc-response-handler (005) "Set the variable `erc-server-parameters' and display the received message. @@ -1544,7 +1547,7 @@ A server may send more than one 005 message." (define-erc-response-handler (221) "Display the current user modes." nil - (let* ((nick (first (erc-response.command-args parsed))) + (let* ((nick (car (erc-response.command-args parsed))) (modes (mapconcat 'identity (cdr (erc-response.command-args parsed)) " "))) (erc-set-modes nick modes) @@ -1553,17 +1556,17 @@ A server may send more than one 005 message." (define-erc-response-handler (252) "Display the number of IRC operators online." nil (erc-display-message parsed 'notice 'active 's252 - ?i (second (erc-response.command-args parsed)))) + ?i (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (253) "Display the number of unknown connections." nil (erc-display-message parsed 'notice 'active 's253 - ?i (second (erc-response.command-args parsed)))) + ?i (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (254) "Display the number of channels formed." nil (erc-display-message parsed 'notice 'active 's254 - ?i (second (erc-response.command-args parsed)))) + ?i (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (250 251 255 256 257 258 259 265 266 377 378) "Generic display of server messages as notices. @@ -1573,8 +1576,8 @@ See `erc-display-server-message'." nil (define-erc-response-handler (275) "Display secure connection message." nil - (multiple-value-bind (nick user message) - (values-list (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,nick ,user ,message) + (cdr (erc-response.command-args parsed)))) (erc-display-message parsed 'notice 'active 's275 ?n nick @@ -1587,13 +1590,13 @@ See `erc-display-server-message'." nil (define-erc-response-handler (301) "AWAY notice." nil (erc-display-message parsed 'notice 'active 's301 - ?n (second (erc-response.command-args parsed)) + ?n (cadr (erc-response.command-args parsed)) ?r (erc-response.contents parsed))) (define-erc-response-handler (303) "ISON reply" nil (erc-display-message parsed 'notice 'active 's303 - ?n (second (erc-response.command-args parsed)))) + ?n (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (305) "Return from AWAYness." nil @@ -1609,8 +1612,8 @@ See `erc-display-server-message'." nil (define-erc-response-handler (307) "Display nick-identified message." nil - (multiple-value-bind (nick user message) - (values-list (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,nick ,user ,message) + (cdr (erc-response.command-args parsed)))) (erc-display-message parsed 'notice 'active 's307 ?n nick @@ -1621,8 +1624,8 @@ See `erc-display-server-message'." nil "WHOIS/WHOWAS notices." nil (let ((fname (erc-response.contents parsed)) (catalog-entry (intern (format "s%s" (erc-response.command parsed))))) - (multiple-value-bind (nick user host) - (values-list (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,nick ,user ,host) + (cdr (erc-response.command-args parsed)))) (erc-update-user-nick nick nick host nil fname user) (erc-display-message parsed 'notice 'active catalog-entry @@ -1630,8 +1633,8 @@ See `erc-display-server-message'." nil (define-erc-response-handler (312) "Server name response in WHOIS." nil - (multiple-value-bind (nick server-host) - (values-list (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,nick ,server-host)) + (cdr (erc-response.command-args parsed))) (erc-display-message parsed 'notice 'active 's312 ?n nick ?s server-host ?c (erc-response.contents parsed)))) @@ -1640,7 +1643,7 @@ See `erc-display-server-message'." nil "IRC Operator response in WHOIS." nil (erc-display-message parsed 'notice 'active 's313 - ?n (second (erc-response.command-args parsed)))) + ?n (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (315 318 323 369) ;; 315 - End of WHO @@ -1652,8 +1655,8 @@ See `erc-display-server-message'." nil (define-erc-response-handler (317) "IDLE notice." nil - (multiple-value-bind (nick seconds-idle on-since time) - (values-list (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,nick ,seconds-idle ,on-since ,time) + (cdr (erc-response.command-args parsed)))) (setq time (when on-since (format-time-string erc-server-timestamp-format (erc-string-to-emacs-time on-since)))) @@ -1671,14 +1674,14 @@ See `erc-display-server-message'." nil "Channel names in WHOIS response." nil (erc-display-message parsed 'notice 'active 's319 - ?n (second (erc-response.command-args parsed)) + ?n (cadr (erc-response.command-args parsed)) ?c (erc-response.contents parsed))) (define-erc-response-handler (320) "Identified user in WHOIS." nil (erc-display-message parsed 'notice 'active 's320 - ?n (second (erc-response.command-args parsed)))) + ?n (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (321) "LIST header." nil @@ -1693,16 +1696,16 @@ See `erc-display-server-message'." nil (define-erc-response-handler (322) "LIST notice." nil (let ((topic (erc-response.contents parsed))) - (multiple-value-bind (channel num-users) - (values-list (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,channel ,num-users) + (cdr (erc-response.command-args parsed)))) (add-to-list 'erc-channel-list (list channel)) (erc-update-channel-topic channel topic)))) (defun erc-server-322-message (proc parsed) "Display a message for the 322 event." (let ((topic (erc-response.contents parsed))) - (multiple-value-bind (channel num-users) - (values-list (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,channel ,num-users) + (cdr (erc-response.command-args parsed)))) (erc-display-message parsed 'notice proc 's322 ?c channel ?u num-users ?t (or topic ""))))) @@ -1710,7 +1713,7 @@ See `erc-display-server-message'." nil (define-erc-response-handler (324) "Channel or nick modes." nil - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (modes (mapconcat 'identity (cddr (erc-response.command-args parsed)) " "))) (erc-set-modes channel modes) @@ -1720,16 +1723,16 @@ See `erc-display-server-message'." nil (define-erc-response-handler (328) "Channel URL (on freenode network)." nil - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (url (erc-response.contents parsed))) (erc-display-message parsed 'notice (erc-get-buffer channel proc) 's328 ?c channel ?u url))) (define-erc-response-handler (329) "Channel creation date." nil - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (time (erc-string-to-emacs-time - (third (erc-response.command-args parsed))))) + (nth 2 (erc-response.command-args parsed))))) (erc-display-message parsed 'notice (erc-get-buffer channel proc) 's329 ?c channel ?t (format-time-string erc-server-timestamp-format @@ -1745,22 +1748,22 @@ See `erc-display-server-message'." nil ;; authaccount == (aref parsed 4) ;; authmsg == (aref parsed 5) ;; The guesses below are, well, just that. -- Lawrence 2004/05/10 - (let ((nick (second (erc-response.command-args parsed))) - (authaccount (third (erc-response.command-args parsed))) + (let ((nick (cadr (erc-response.command-args parsed))) + (authaccount (nth 2 (erc-response.command-args parsed))) (authmsg (erc-response.contents parsed))) (erc-display-message parsed 'notice 'active 's330 ?n nick ?a authmsg ?i authaccount))) (define-erc-response-handler (331) "No topic set for channel." nil - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (topic (erc-response.contents parsed))) (erc-display-message parsed 'notice (erc-get-buffer channel proc) 's331 ?c channel))) (define-erc-response-handler (332) "TOPIC notice." nil - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (topic (erc-response.contents parsed))) (erc-update-channel-topic channel topic) (erc-display-message parsed 'notice (erc-get-buffer channel proc) @@ -1768,8 +1771,8 @@ See `erc-display-server-message'." nil (define-erc-response-handler (333) "Who set the topic, and when." nil - (multiple-value-bind (channel nick time) - (values-list (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,channel ,nick ,time) + (cdr (erc-response.command-args parsed)))) (setq time (format-time-string erc-server-timestamp-format (erc-string-to-emacs-time time))) (erc-update-channel-topic channel @@ -1781,15 +1784,15 @@ See `erc-display-server-message'." nil (define-erc-response-handler (341) "Let user know when an INVITE attempt has been sent successfully." nil - (multiple-value-bind (nick channel) - (values-list (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,nick ,channel) + (cdr (erc-response.command-args parsed)))) (erc-display-message parsed 'notice (erc-get-buffer channel proc) 's341 ?n nick ?c channel))) (define-erc-response-handler (352) "WHO notice." nil - (multiple-value-bind (channel user host server nick away-flag) - (values-list (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,channel ,user ,host ,server ,nick ,away-flag) + (cdr (erc-response.command-args parsed)))) (let ((full-name (erc-response.contents parsed)) hopcount) (when (string-match "\\(^[0-9]+ \\)\\(.*\\)$" full-name) @@ -1803,7 +1806,7 @@ See `erc-display-server-message'." nil (define-erc-response-handler (353) "NAMES notice." nil - (let ((channel (third (erc-response.command-args parsed))) + (let ((channel (nth 2 (erc-response.command-args parsed))) (users (erc-response.contents parsed))) (erc-display-message parsed 'notice (or (erc-get-buffer channel proc) 'active) @@ -1813,13 +1816,13 @@ See `erc-display-server-message'." nil (define-erc-response-handler (366) "End of NAMES." nil - (erc-with-buffer ((second (erc-response.command-args parsed)) proc) + (erc-with-buffer ((cadr (erc-response.command-args parsed)) proc) (erc-channel-end-receiving-names))) (define-erc-response-handler (367) "Channel ban list entries." nil - (multiple-value-bind (channel banmask setter time) - (values-list (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,channel ,banmask ,setter ,time) + (cdr (erc-response.command-args parsed)))) ;; setter and time are not standard (if setter (erc-display-message parsed 'notice 'active 's367-set-by @@ -1833,7 +1836,7 @@ See `erc-display-server-message'." nil (define-erc-response-handler (368) "End of channel ban list." nil - (let ((channel (second (erc-response.command-args parsed)))) + (let ((channel (cadr (erc-response.command-args parsed)))) (erc-display-message parsed 'notice 'active 's368 ?c channel))) @@ -1842,8 +1845,8 @@ See `erc-display-server-message'." nil ;; FIXME: Yet more magic numbers in original code, I'm guessing this ;; command takes two arguments, and doesn't have any "contents". -- ;; Lawrence 2004/05/10 - (multiple-value-bind (from to) - (values-list (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,from ,to) + (cdr (erc-response.command-args parsed)))) (erc-display-message parsed 'notice 'active 's379 ?c from ?f to))) @@ -1851,12 +1854,12 @@ See `erc-display-server-message'." nil "Server's time string." nil (erc-display-message parsed 'notice 'active - 's391 ?s (second (erc-response.command-args parsed)) - ?t (third (erc-response.command-args parsed)))) + 's391 ?s (cadr (erc-response.command-args parsed)) + ?t (nth 2 (erc-response.command-args parsed)))) (define-erc-response-handler (401) "No such nick/channel." nil - (let ((nick/channel (second (erc-response.command-args parsed)))) + (let ((nick/channel (cadr (erc-response.command-args parsed)))) (when erc-whowas-on-nosuchnick (erc-log (format "cmd: WHOWAS: %s" nick/channel)) (erc-server-send (format "WHOWAS %s 1" nick/channel))) @@ -1866,23 +1869,23 @@ See `erc-display-server-message'." nil (define-erc-response-handler (403) "No such channel." nil (erc-display-message parsed '(notice error) 'active - 's403 ?c (second (erc-response.command-args parsed)))) + 's403 ?c (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (404) "Cannot send to channel." nil (erc-display-message parsed '(notice error) 'active - 's404 ?c (second (erc-response.command-args parsed)))) + 's404 ?c (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (405) "Can't join that many channels." nil (erc-display-message parsed '(notice error) 'active - 's405 ?c (second (erc-response.command-args parsed)))) + 's405 ?c (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (406) "No such nick." nil (erc-display-message parsed '(notice error) 'active - 's406 ?n (second (erc-response.command-args parsed)))) + 's406 ?n (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (412) "No text to send." nil @@ -1891,33 +1894,33 @@ See `erc-display-server-message'." nil (define-erc-response-handler (421) "Unknown command." nil (erc-display-message parsed '(notice error) 'active 's421 - ?c (second (erc-response.command-args parsed)))) + ?c (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (432) "Bad nick." nil (erc-display-message parsed '(notice error) 'active 's432 - ?n (second (erc-response.command-args parsed)))) + ?n (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (433) "Login-time \"nick in use\"." nil - (erc-nickname-in-use (second (erc-response.command-args parsed)) + (erc-nickname-in-use (cadr (erc-response.command-args parsed)) "already in use")) (define-erc-response-handler (437) "Nick temporarily unavailable (on IRCnet)." nil - (let ((nick/channel (second (erc-response.command-args parsed)))) + (let ((nick/channel (cadr (erc-response.command-args parsed)))) (unless (erc-channel-p nick/channel) (erc-nickname-in-use nick/channel "temporarily unavailable")))) (define-erc-response-handler (442) "Not on channel." nil (erc-display-message parsed '(notice error) 'active 's442 - ?c (second (erc-response.command-args parsed)))) + ?c (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (461) "Not enough parameters for command." nil (erc-display-message parsed '(notice error) 'active 's461 - ?c (second (erc-response.command-args parsed)) + ?c (cadr (erc-response.command-args parsed)) ?m (erc-response.contents parsed))) (define-erc-response-handler (465) @@ -1933,37 +1936,37 @@ See `erc-display-server-message'." nil (erc-display-message parsed '(notice error) nil (intern (format "s%s" (erc-response.command parsed))) - ?c (second (erc-response.command-args parsed)))) + ?c (cadr (erc-response.command-args parsed)))) (define-erc-response-handler (475) "Channel key needed." nil (erc-display-message parsed '(notice error) nil 's475 - ?c (second (erc-response.command-args parsed))) + ?c (cadr (erc-response.command-args parsed))) (when erc-prompt-for-channel-key - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (key (read-from-minibuffer (format "Channel %s is mode +k. Enter key (RET to cancel): " - (second (erc-response.command-args parsed)))))) + (cadr (erc-response.command-args parsed)))))) (when (and key (> (length key) 0)) (erc-cmd-JOIN channel key))))) (define-erc-response-handler (477) "Channel doesn't support modes." nil - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (message (erc-response.contents parsed))) (erc-display-message parsed 'notice (erc-get-buffer channel proc) (format "%s: %s" channel message)))) (define-erc-response-handler (482) "You need to be a channel operator to do that." nil - (let ((channel (second (erc-response.command-args parsed))) + (let ((channel (cadr (erc-response.command-args parsed))) (message (erc-response.contents parsed))) (erc-display-message parsed '(error notice) 'active 's482 ?c channel ?m message))) (define-erc-response-handler (671) "Secure connection response in WHOIS." nil - (let ((nick (second (erc-response.command-args parsed))) + (let ((nick (cadr (erc-response.command-args parsed))) (securemsg (erc-response.contents parsed))) (erc-display-message parsed 'notice 'active 's671 ?n nick ?a securemsg))) diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index c8a7fec32bd..433ffc05340 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -3,6 +3,7 @@ ;; Copyright (C) 1996-2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> +;; Maintainer: FSF ;; Keywords: irc, button, url, regexp ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcButton @@ -25,7 +26,7 @@ ;; Heavily borrowed from gnus-art.el. Thanks to the original authors. ;; This buttonizes nicks and other stuff to make it all clickable. -;; To enable, add to your ~/.emacs: +;; To enable, add to your init file: ;; (require 'erc-button) ;; (erc-button-mode 1) ;; @@ -134,7 +135,7 @@ longer than `erc-fill-column'." '(('nicknames 0 erc-button-buttonize-nicks erc-nick-popup 0) (erc-button-url-regexp 0 t browse-url 0) ("<URL: *\\([^<> ]+\\) *>" 0 t browse-url 1) - ("(\\(\\([^~\n \t@][^\n \t@]*\\)@\\([a-zA-Z0-9.:-]+\\)\\)" 1 t finger 2 3) +;;; ("(\\(\\([^~\n \t@][^\n \t@]*\\)@\\([a-zA-Z0-9.:-]+\\)\\)" 1 t finger 2 3) ;; emacs internal ("[`]\\([a-zA-Z][-a-zA-Z_0-9]+\\)[']" 1 t erc-button-describe-symbol 1) ;; pseudo links @@ -182,6 +183,7 @@ PAR is a number of a regexp grouping whose text will be passed to 'nicknames, these are ignored, and CALLBACK will be called with the nickname matched as the argument." :group 'erc-button + :version "24.3" ; remove finger (bug#4443) :type '(repeat (list :tag "Button" (choice :tag "Matches" diff --git a/lisp/erc/erc-capab.el b/lisp/erc/erc-capab.el index 4f6361ee923..e8201f2ea43 100644 --- a/lisp/erc/erc-capab.el +++ b/lisp/erc/erc-capab.el @@ -2,6 +2,10 @@ ;; Copyright (C) 2006-2012 Free Software Foundation, Inc. +;; Maintainer: FSF + +; This file is part of GNU Emacs. + ;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or @@ -48,7 +52,7 @@ ;;; Usage: -;; Put the following in your ~/.emacs file. +;; Put the following in your init file. ;; (require 'erc-capab) ;; (erc-capab-identify-mode 1) @@ -64,7 +68,6 @@ ;;; Code: (require 'erc) -(eval-when-compile (require 'cl)) ;;; Customization: diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el index 1fb3930091e..1e299407fe9 100644 --- a/lisp/erc/erc-compat.el +++ b/lisp/erc/erc-compat.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2002-2003, 2005-2012 Free Software Foundation, Inc. ;; Author: Alex Schroeder <alex@gnu.org> +;; Maintainer: FSF ;; URL: http://www.emacswiki.org/cgi-bin/wiki/ERC ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index 4d0534d3d5e..e31416f0e1a 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -6,7 +6,7 @@ ;; Author: Ben A. Mesander <ben@gnu.ai.mit.edu> ;; Noah Friedman <friedman@prep.ai.mit.edu> ;; Per Persson <pp@sno.pp.se> -;; Maintainer: mlang@delysid.org +;; Maintainer: FSF ;; Keywords: comm, processes ;; Created: 1994-01-23 @@ -54,9 +54,7 @@ ;;; Code: (require 'erc) -(eval-when-compile - (require 'cl) - (require 'pcomplete)) +(eval-when-compile (require 'pcomplete)) ;;;###autoload (autoload 'erc-dcc-mode "erc-dcc") (define-erc-module dcc nil @@ -277,7 +275,7 @@ Argument IP is the address as a string. The result is also a string." (* (nth 1 ips) 65536.0) (* (nth 2 ips) 256.0) (nth 3 ips)))) - (if (interactive-p) + (if (called-interactively-p 'interactive) (message "%s is %.0f" ip res) (format "%.0f" res))))) @@ -380,8 +378,8 @@ created subprocess, or nil." (with-no-warnings ; obsolete since 23.1 (set-process-filter-multibyte process nil))))) (file-error - (unless (and (string= "Cannot bind server socket" (cadr err)) - (string= "address already in use" (caddr err))) + (unless (and (string= "Cannot bind server socket" (nth 1 err)) + (string= "address already in use" (nth 2 err))) (signal (car err) (cdr err))) (setq port (1+ port)) (unless (< port upper) @@ -434,38 +432,38 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc." (pcomplete-here (append '("chat" "close" "get" "list") (when (fboundp 'make-network-process) '("send")))) (pcomplete-here - (case (intern (downcase (pcomplete-arg 1))) - (chat (mapcar (lambda (elt) (plist-get elt :nick)) + (pcase (intern (downcase (pcomplete-arg 1))) + (`chat (mapcar (lambda (elt) (plist-get elt :nick)) + (erc-remove-if-not + #'(lambda (elt) + (eq (plist-get elt :type) 'CHAT)) + erc-dcc-list))) + (`close (erc-delete-dups + (mapcar (lambda (elt) (symbol-name (plist-get elt :type))) + erc-dcc-list))) + (`get (mapcar #'erc-dcc-nick (erc-remove-if-not #'(lambda (elt) - (eq (plist-get elt :type) 'CHAT)) + (eq (plist-get elt :type) 'GET)) erc-dcc-list))) - (close (erc-delete-dups - (mapcar (lambda (elt) (symbol-name (plist-get elt :type))) - erc-dcc-list))) - (get (mapcar #'erc-dcc-nick - (erc-remove-if-not - #'(lambda (elt) - (eq (plist-get elt :type) 'GET)) - erc-dcc-list))) - (send (pcomplete-erc-all-nicks)))) + (`send (pcomplete-erc-all-nicks)))) (pcomplete-here - (case (intern (downcase (pcomplete-arg 2))) - (get (mapcar (lambda (elt) (plist-get elt :file)) - (erc-remove-if-not - #'(lambda (elt) - (and (eq (plist-get elt :type) 'GET) - (erc-nick-equal-p (erc-extract-nick - (plist-get elt :nick)) - (pcomplete-arg 1)))) - erc-dcc-list))) - (close (mapcar #'erc-dcc-nick - (erc-remove-if-not - #'(lambda (elt) - (eq (plist-get elt :type) - (intern (upcase (pcomplete-arg 1))))) - erc-dcc-list))) - (send (pcomplete-entries))))) + (pcase (intern (downcase (pcomplete-arg 2))) + (`get (mapcar (lambda (elt) (plist-get elt :file)) + (erc-remove-if-not + #'(lambda (elt) + (and (eq (plist-get elt :type) 'GET) + (erc-nick-equal-p (erc-extract-nick + (plist-get elt :nick)) + (pcomplete-arg 1)))) + erc-dcc-list))) + (`close (mapcar #'erc-dcc-nick + (erc-remove-if-not + #'(lambda (elt) + (eq (plist-get elt :type) + (intern (upcase (pcomplete-arg 1))))) + erc-dcc-list))) + (`send (pcomplete-entries))))) (defun erc-dcc-do-CHAT-command (proc &optional nick) (when nick @@ -1248,7 +1246,7 @@ other client." (defun erc-dcc-no-such-nick (proc parsed) "Detect and handle no-such-nick replies from the IRC server." - (let* ((elt (erc-dcc-member :nick (second (erc-response.command-args parsed)) + (let* ((elt (erc-dcc-member :nick (nth 1 (erc-response.command-args parsed)) :parent proc)) (peer (plist-get elt :peer))) (when (or (and (processp peer) (not (eq (process-status peer) 'open))) diff --git a/lisp/erc/erc-notifications.el b/lisp/erc/erc-desktop-notifications.el index 4faffc913c5..2cc3c80a8ea 100644 --- a/lisp/erc/erc-notifications.el +++ b/lisp/erc/erc-desktop-notifications.el @@ -1,4 +1,4 @@ -;; erc-notifications.el -- Send notification on PRIVMSG or mentions +;; erc-desktop-notifications.el -- Send notification on PRIVMSG or mentions ;; Copyright (C) 2012 Free Software Foundation, Inc. @@ -35,6 +35,7 @@ (defgroup erc-notifications nil "Send notifications on PRIVMSG or mentions." + :version "24.3" :group 'erc) (defvar erc-notifications-last-notification nil @@ -75,7 +76,7 @@ This will replace the last notification sent with this function." (member nick erc-track-exclude))) (erc-notifications-notify nick msg))))) -;;;###autoload(autoload 'erc-notifications-mode "erc-notifications" "" t) +;;;###autoload(autoload 'erc-notifications-mode "erc-desktop-notifications" "" t) (define-erc-module notifications nil "Send notifications on private message reception and mentions." ;; Enable @@ -85,6 +86,6 @@ This will replace the last notification sent with this function." ((remove-hook 'erc-server-PRIVMSG-functions 'erc-notifications-PRIVMSG) (remove-hook 'erc-text-matched-hook 'erc-notifications-notify-on-match))) -(provide 'erc-notifications) +(provide 'erc-desktop-notifications) -;;; erc-notifications.el ends here +;;; erc-desktop-notifications.el ends here diff --git a/lisp/erc/erc-ezbounce.el b/lisp/erc/erc-ezbounce.el index f40eaa8c549..6bcc17e4bc0 100644 --- a/lisp/erc/erc-ezbounce.el +++ b/lisp/erc/erc-ezbounce.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2002, 2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Andreas Fuchs <asf@void.at> +;; Maintainer: FSF ;; Keywords: comm ;; This file is part of GNU Emacs. @@ -25,7 +26,6 @@ ;;; Code: (require 'erc) -(eval-when-compile (require 'cl)) (defgroup erc-ezbounce nil "Interface to the EZBounce IRC bouncer (a virtual IRC server)" diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index 2422ca10d0a..35e14eb0e29 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -4,6 +4,7 @@ ;; Author: Andreas Fuchs <asf@void.at> ;; Mario Lang <mlang@delysid.org> +;; Maintainer: FSF ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcFilling ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index 49820b78ff6..892f82e2eba 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2001-2012 Free Software Foundation, Inc. ;; Author: Jorgen Schaefer <forcer@forcix.cx> +;; Maintainer: FSF ;; Most code is taken verbatim from erc.el, see there for the original ;; authors. diff --git a/lisp/erc/erc-ibuffer.el b/lisp/erc/erc-ibuffer.el index 1a713009c85..d1e74fd4c54 100644 --- a/lisp/erc/erc-ibuffer.el +++ b/lisp/erc/erc-ibuffer.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2002, 2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> +;; Maintainer: FSF ;; Keywords: comm ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcIbuffer diff --git a/lisp/erc/erc-identd.el b/lisp/erc/erc-identd.el index aee808c0921..9586dd698a0 100644 --- a/lisp/erc/erc-identd.el +++ b/lisp/erc/erc-identd.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2003, 2006-2012 Free Software Foundation, Inc. ;; Author: John Wiegley <johnw@gnu.org> +;; Maintainer: FSF ;; Keywords: comm, processes ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-imenu.el b/lisp/erc/erc-imenu.el index 53dc9e7abf2..7346fca1b8a 100644 --- a/lisp/erc/erc-imenu.el +++ b/lisp/erc/erc-imenu.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2001-2002, 2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> +;; Maintainer: FSF ;; Keywords: comm ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcImenu diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index ae7f90003a6..e285cfb4ec5 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2002-2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Alex Schroeder <alex@gnu.org> +;; Maintainer: FSF ;; Keywords: irc ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcAutoJoin @@ -33,7 +34,6 @@ (require 'erc) (require 'auth-source) -(eval-when-compile (require 'cl)) (defgroup erc-autojoin nil "Enable autojoining." diff --git a/lisp/erc/erc-lang.el b/lisp/erc/erc-lang.el index 11384a25885..2d7f555971e 100644 --- a/lisp/erc/erc-lang.el +++ b/lisp/erc/erc-lang.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002, 2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Alex Schroeder <alex@gnu.org> -;; Maintainer: Alex Schroeder <alex@gnu.org> +;; Maintainer: FSF ;; Version: 1.0.0 ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcLang ;; Keywords: comm languages processes diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el index f7d33ffbc28..19afe2e79ee 100644 --- a/lisp/erc/erc-list.el +++ b/lisp/erc/erc-list.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2008-2012 Free Software Foundation, Inc. ;; Author: Tom Tromey <tromey@redhat.com> +;; Maintainer: FSF ;; Version: 0.1 ;; Keywords: comm diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index eefe51ae706..1ff2951e09e 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2003-2012 Free Software Foundation, Inc. ;; Author: Lawrence Mitchell <wence@gmx.li> +;; Maintainer: FSF ;; Keywords: IRC, chat, client, Internet, logging ;; Created 2003-04-26 @@ -92,9 +93,7 @@ ;;; Code: (require 'erc) -(eval-when-compile - (require 'erc-networks) - (require 'cl)) +(eval-when-compile (require 'erc-networks)) (defgroup erc-log nil "Logging facilities for ERC." @@ -113,11 +112,13 @@ If you want to write logs into different directories, make a custom function which returns the directory part and set `erc-log-channels-directory' to its name." :group 'erc-log - :type '(choice (const :tag "Long style" erc-generate-log-file-name-long) - (const :tag "Long, but with network name rather than server" + :type '(choice (const :tag "#channel!nick@server:port.txt" + erc-generate-log-file-name-long) + (const :tag "#channel!nick@network.txt" erc-generate-log-file-name-network) - (const :tag "Short" erc-generate-log-file-name-short) - (const :tag "With date" erc-generate-log-file-name-with-date) + (const :tag "#channel.txt" erc-generate-log-file-name-short) + (const :tag "#channel@date.txt" + erc-generate-log-file-name-with-date) (function :tag "Other function"))) (defcustom erc-truncate-buffer-on-save nil @@ -426,7 +427,8 @@ You can save every individual message by putting this function on file t 'nomessage)))) (let ((coding-system-for-write coding-system)) (write-region start end file t 'nomessage)))) - (if (and erc-truncate-buffer-on-save (interactive-p)) + (if (and erc-truncate-buffer-on-save + (called-interactively-p 'interactive)) (progn (let ((inhibit-read-only t)) (erase-buffer)) (move-marker erc-last-saved-position (point-max)) diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index cac042c0298..f1219427360 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2002-2012 Free Software Foundation, Inc. ;; Author: Andreas Fuchs <asf@void.at> +;; Maintainer: FSF ;; Keywords: comm, faces ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcMatch @@ -29,12 +30,11 @@ ;; customizable variables. ;; Usage: -;; Put (erc-match-mode 1) into your ~/.emacs file. +;; Put (erc-match-mode 1) into your init file. ;;; Code: (require 'erc) -(eval-when-compile (require 'cl)) ;; Customization: diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el index 5d96fc4d487..1aec2ad417f 100644 --- a/lisp/erc/erc-menu.el +++ b/lisp/erc/erc-menu.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2001-2002, 2004-2012 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> +;; Maintainer: FSF ;; Keywords: comm, processes, menu ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el index 44fbc9563d6..cbaf62b1a61 100644 --- a/lisp/erc/erc-netsplit.el +++ b/lisp/erc/erc-netsplit.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2002-2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> +;; Maintainer: FSF ;; Keywords: comm ;; This file is part of GNU Emacs. @@ -23,14 +24,13 @@ ;;; Commentary: ;; This module hides quit/join messages if a netsplit occurs. -;; To enable, add the following to your ~/.emacs: +;; To enable, add the following to your init file: ;; (require 'erc-netsplit) ;; (erc-netsplit-mode 1) ;;; Code: (require 'erc) -(eval-when-compile (require 'cl)) (defgroup erc-netsplit nil "Netsplit detection tries to automatically figure when a @@ -106,7 +106,7 @@ join from that split has been detected or not.") (dolist (elt erc-netsplit-list) (if (member nick (nthcdr 3 elt)) (progn - (if (not (caddr elt)) + (if (not (nth 2 elt)) (progn (erc-display-message parsed 'notice (process-buffer proc) @@ -148,7 +148,7 @@ join from that split has been detected or not.") ;; element for this netsplit exists already (progn (setcdr (nthcdr 2 ass) (cons nick (nthcdr 3 ass))) - (when (caddr ass) + (when (nth 2 ass) ;; There was already a netjoin for this netsplit, it ;; seems like the old one didn't get finished... (erc-display-message @@ -193,7 +193,7 @@ join from that split has been detected or not.") nil 'notice 'active 'netsplit-wholeft ?s (car elt) ?n (mapconcat 'erc-extract-nick (nthcdr 3 elt) " ") - ?t (if (caddr elt) + ?t (if (nth 2 elt) "(joining)" ""))))) t) diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el index 9a3c562f0a6..5089ff6b4ba 100644 --- a/lisp/erc/erc-networks.el +++ b/lisp/erc/erc-networks.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2002, 2004-2012 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@lexx.delysid.org> +;; Maintainer: FSF ;; Keywords: comm ;; This file is part of GNU Emacs. @@ -39,7 +40,7 @@ ;;; Code: (require 'erc) -(eval-when-compile (require 'cl)) +(eval-when-compile (require 'cl-lib)) ;; Variables @@ -728,10 +729,10 @@ search for a match in `erc-networks-alist'." (or ;; Loop through `erc-networks-alist' looking for a match. (let ((server (or erc-server-announced-name erc-session-server))) - (loop for (name matcher) in erc-networks-alist - when (and matcher - (string-match (concat matcher "\\'") server)) - do (return name))) + (cl-loop for (name matcher) in erc-networks-alist + when (and matcher + (string-match (concat matcher "\\'") server)) + do (cl-return name))) 'Unknown))) (defun erc-network () @@ -788,8 +789,8 @@ As an example: (cond ((numberp p) (push p result)) ((listp p) - (setq result (nconc (loop for i from (cadr p) downto (car p) - collect i) + (setq result (nconc (cl-loop for i from (cadr p) downto (car p) + collect i) result))))) (nreverse result))) diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el index 3bf82c13f19..b9d7ff78cd8 100644 --- a/lisp/erc/erc-notify.el +++ b/lisp/erc/erc-notify.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2002-2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@lexx.delysid.org> +;; Maintainer: FSF ;; Keywords: comm ;; This file is part of GNU Emacs. @@ -29,9 +30,7 @@ (require 'erc) (require 'erc-networks) -(eval-when-compile - (require 'cl) - (require 'pcomplete)) +(eval-when-compile (require 'pcomplete)) ;;;; Customizable variables diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el index e6b670c91ba..8eae6c83d15 100644 --- a/lisp/erc/erc-page.el +++ b/lisp/erc/erc-page.el @@ -2,6 +2,8 @@ ;; Copyright (C) 2002, 2004, 2006-2012 Free Software Foundation, Inc. +;; Maintainer: FSF + ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify @@ -45,7 +47,7 @@ If nil, this prints the page message in the minibuffer and calls `beep'. If non-nil, it must be a function that takes two arguments: SENDER and MSG, both strings. -Example for your ~/.emacs file: +Example for your init file: \(setq erc-page-function (lambda (sender msg) diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el index d3cbe8a5804..d6bb8019b15 100644 --- a/lisp/erc/erc-pcomplete.el +++ b/lisp/erc/erc-pcomplete.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2002-2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Sacha Chua <sacha@free.net.ph> +;; Maintainer: FSF ;; Keywords: comm, convenience ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcCompletion @@ -42,7 +43,6 @@ (require 'erc) (require 'erc-compat) (require 'time-date) -(eval-when-compile (require 'cl)) (defgroup erc-pcomplete nil "Programmable completion for ERC" diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el index 04c5885bc3e..3d4a5d311b1 100644 --- a/lisp/erc/erc-replace.el +++ b/lisp/erc/erc-replace.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2001-2002, 2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Andreas Fuchs <asf@void.at> -;; Maintainer: Mario Lang (mlang@delysid.org) +;; Maintainer: FSF ;; Keywords: IRC, client, Internet ;; This file is part of GNU Emacs. @@ -25,7 +25,7 @@ ;; This module allows you to systematically replace text in incoming ;; messages. Load erc-replace, and customize `erc-replace-alist'. -;; Then add to your ~/.emacs: +;; Then add to your init file: ;; (require 'erc-replace) ;; (erc-replace-mode 1) diff --git a/lisp/erc/erc-ring.el b/lisp/erc/erc-ring.el index 94af8a09200..6b3f3e3c3aa 100644 --- a/lisp/erc/erc-ring.el +++ b/lisp/erc/erc-ring.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2001-2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Alex Schroeder <alex@gnu.org> +;; Maintainer: FSF ;; Keywords: comm ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcHistory diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el index 5986d81efed..b75ad8e9517 100644 --- a/lisp/erc/erc-services.el +++ b/lisp/erc/erc-services.el @@ -2,6 +2,8 @@ ;; Copyright (C) 2002-2004, 2006-2012 Free Software Foundation, Inc. +;; Maintainer: FSF + ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify @@ -60,7 +62,7 @@ (require 'erc) (require 'erc-networks) -(eval-when-compile (require 'cl)) +(eval-when-compile (require 'cl-lib)) ;; Customization: diff --git a/lisp/erc/erc-sound.el b/lisp/erc/erc-sound.el index 8b44cb5146c..55336a68cfe 100644 --- a/lisp/erc/erc-sound.el +++ b/lisp/erc/erc-sound.el @@ -2,6 +2,8 @@ ;; Copyright (C) 2002-2003, 2006-2012 Free Software Foundation, Inc. +;; Maintainer: FSF + ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el index 1e028e22642..22053945159 100644 --- a/lisp/erc/erc-speedbar.el +++ b/lisp/erc/erc-speedbar.el @@ -4,6 +4,7 @@ ;; Author: Mario Lang <mlang@delysid.org> ;; Contributor: Eric M. Ludlam <eric@siege-engine.com> +;; Maintainer: FSF ;; This file is part of GNU Emacs. @@ -37,7 +38,6 @@ (require 'erc) (require 'speedbar) (condition-case nil (require 'dframe) (error nil)) -(eval-when-compile (require 'cl)) ;;; Customization: diff --git a/lisp/erc/erc-spelling.el b/lisp/erc/erc-spelling.el index 441e3536e19..5f40cc39e89 100644 --- a/lisp/erc/erc-spelling.el +++ b/lisp/erc/erc-spelling.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2005-2012 Free Software Foundation, Inc. ;; Author: Jorgen Schaefer <forcer@forcix.cx> +;; Maintainer: FSF ;; Keywords: irc ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcSpelling diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index 5831233affe..4fa3f9f5915 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2002-2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> +;; Maintainer: FSF ;; Keywords: comm, processes, timestamp ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcStamp @@ -43,7 +44,7 @@ group provides settings related to the format and display of timestamp information in `erc-mode' buffer. For timestamping to be activated, you just need to load `erc-stamp' -in your .emacs file or interactively using `load-library'." +in your init file or interactively using `load-library'." :group 'erc) (defcustom erc-timestamp-format "[%H:%M]" @@ -352,8 +353,9 @@ Return the empty string if FORMAT is nil." 'isearch-open-invisible 'timestamp ts) ;; N.B. Later use categories instead of this harmless, but ;; inelegant, hack. -- BPT - (when erc-timestamp-intangible - (erc-put-text-property 0 (length ts) 'intangible t ts)) + (and erc-timestamp-intangible + (not erc-hide-timestamps) ; bug#11706 + (erc-put-text-property 0 (length ts) 'intangible t ts)) ts) "")) diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index 9c56c724224..976d2a21030 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2002-2012 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> +;; Maintainer: FSF ;; Keywords: comm, faces ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcChannelTracking @@ -24,7 +25,7 @@ ;;; Commentary: ;; Highlights keywords and pals (friends), and hides or highlights fools -;; (using a dark color). Add to your ~/.emacs: +;; (using a dark color). Add to your init file: ;; (require 'erc-track) ;; (erc-track-mode 1) @@ -33,7 +34,7 @@ ;; * Add extensibility so that custom functions can track ;; custom modification types. -(eval-when-compile (require 'cl)) +(eval-when-compile (require 'cl-lib)) (require 'erc) (require 'erc-compat) (require 'erc-match) @@ -483,7 +484,7 @@ START is the minimum length of the name used." ;;; Test: -(assert +(cl-assert (and ;; verify examples from the doc strings (equal (let ((erc-track-shorten-aggressively nil)) @@ -868,7 +869,7 @@ Use `erc-make-mode-line-buffer-name' to create buttons." (setq erc-modified-channels-alist (delete (assq buffer erc-modified-channels-alist) erc-modified-channels-alist)) - (when (interactive-p) + (when (called-interactively-p 'interactive) (erc-modified-channels-display))) (defun erc-track-find-face (faces) @@ -979,7 +980,7 @@ is in `erc-mode'." (add-to-list 'faces cur))) faces)) -(assert +(cl-assert (let ((str "is bold")) (put-text-property 3 (length str) 'face '(bold erc-current-nick-face) @@ -1029,17 +1030,17 @@ relative to `erc-track-switch-direction'" (let ((dir erc-track-switch-direction) offset) (when (< arg 0) - (setq dir (case dir - (oldest 'newest) - (newest 'oldest) - (mostactive 'leastactive) - (leastactive 'mostactive) - (importance 'oldest))) + (setq dir (pcase dir + (`oldest 'newest) + (`newest 'oldest) + (`mostactive 'leastactive) + (`leastactive 'mostactive) + (`importance 'oldest))) (setq arg (- arg))) - (setq offset (case dir - ((oldest leastactive) + (setq offset (pcase dir + ((or `oldest `leastactive) (- (length erc-modified-channels-alist) arg)) - (t (1- arg)))) + (_ (1- arg)))) ;; normalize out of range user input (cond ((>= offset (length erc-modified-channels-alist)) (setq offset (1- (length erc-modified-channels-alist)))) diff --git a/lisp/erc/erc-truncate.el b/lisp/erc/erc-truncate.el index dd47c601ea8..8a219500ecb 100644 --- a/lisp/erc/erc-truncate.el +++ b/lisp/erc/erc-truncate.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2003-2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Andreas Fuchs <asf@void.at> +;; Maintainer: FSF ;; Keywords: IRC, chat, client, Internet, logging ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc-xdcc.el b/lisp/erc/erc-xdcc.el index 0328c407aa0..85356b39033 100644 --- a/lisp/erc/erc-xdcc.el +++ b/lisp/erc/erc-xdcc.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2003-2004, 2006-2012 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> +;; Maintainer: FSF ;; Keywords: comm, processes ;; This file is part of GNU Emacs. diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index feef75940f3..bead7759e13 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -9,7 +9,7 @@ ;; Andreas Fuchs (afs@void.at) ;; Gergely Nagy (algernon@midgard.debian.net) ;; David Edmondson (dme@dme.org) -;; Maintainer: Michael Olson (mwolson@gnu.org) +;; Maintainer: FSF ;; Keywords: IRC, chat, client, Internet ;; Version: 5.3 @@ -67,7 +67,7 @@ (defconst erc-version-string "Version 5.3" "ERC version. This is used by function `erc-version'.") -(eval-when-compile (require 'cl)) +(eval-when-compile (require 'cl-lib)) (require 'font-lock) (require 'pp) (require 'thingatpt) @@ -102,6 +102,7 @@ (defgroup erc-lurker nil "Hide specified message types sent by lurkers" + :version "24.3" :group 'erc-ignore) (defgroup erc-query nil @@ -139,8 +140,8 @@ (message (concat "ERC: The function `defvaralias' is not bound. See the " "NEWS file for variable name changes since ERC 5.0.4."))) -(defalias 'erc-send-command 'erc-server-send) -(erc-make-obsolete 'erc-send-command 'erc-server-send "ERC 5.1") +(define-obsolete-function-alias 'erc-send-command + 'erc-server-send "ERC 5.1") ;; tunable connection and authentication parameters @@ -361,15 +362,14 @@ nicknames with erc-server-user struct instances.") (defmacro erc-with-server-buffer (&rest body) "Execute BODY in the current ERC server buffer. If no server buffer exists, return nil." + (declare (indent 0) (debug (body))) (let ((buffer (make-symbol "buffer"))) `(let ((,buffer (erc-server-buffer))) (when (buffer-live-p ,buffer) (with-current-buffer ,buffer ,@body))))) -(put 'erc-with-server-buffer 'lisp-indent-function 0) -(put 'erc-with-server-buffer 'edebug-form-spec '(body)) -(defstruct (erc-server-user (:type vector) :named) +(cl-defstruct (erc-server-user (:type vector) :named) ;; User data nickname host login full-name info ;; Buffers @@ -379,7 +379,7 @@ If no server buffer exists, return nil." (buffers nil) ) -(defstruct (erc-channel-user (:type vector) :named) +(cl-defstruct (erc-channel-user (:type vector) :named) op voice ;; Last message time (in the form of the return value of ;; (current-time) @@ -1235,6 +1235,7 @@ Example: 'erc-replace-insert)) ((remove-hook 'erc-insert-modify-hook 'erc-replace-insert)))" + (declare (doc-string 3)) (let* ((sn (symbol-name name)) (mode (intern (format "erc-%s-mode" (downcase sn)))) (group (intern (format "erc-%s" (downcase sn)))) @@ -1280,8 +1281,6 @@ if ARG is omitted or nil. (put ',enable 'definition-name ',name) (put ',disable 'definition-name ',name)))) -(put 'define-erc-module 'doc-string-elt 3) - (defun erc-once-with-server-event (event &rest forms) "Execute FORMS the next time EVENT occurs in the `current-buffer'. @@ -1333,10 +1332,10 @@ connection over which the data was received that triggered EVENT." (add-hook hook fun nil nil) fun)) -(defmacro erc-log (string) +(defsubst erc-log (string) "Logs STRING if logging is on (see `erc-log-p')." - `(when erc-log-p - (erc-log-aux ,string))) + (when erc-log-p + (erc-log-aux string))) (defun erc-server-buffer () "Return the server buffer for the current buffer's process. @@ -1387,7 +1386,7 @@ If BUFFER is nil, the current buffer is used." t)) (erc-server-send (format "ISON %s" nick)) (while (eq erc-online-p 'unknown) (accept-process-output)) - (if (interactive-p) + (if (called-interactively-p 'interactive) (message "%s is %sonline" (or erc-online-p nick) (if erc-online-p "" "not ")) @@ -1620,6 +1619,7 @@ See `erc-get-buffer' for details. See also `with-current-buffer'. \(fn (TARGET [PROCESS]) BODY...)" + (declare (indent 1) (debug ((form &optional form) body))) (let ((buf (make-symbol "buf")) (proc (make-symbol "proc")) (target (make-symbol "target")) @@ -1636,8 +1636,6 @@ See also `with-current-buffer'. (when (buffer-live-p ,buf) (with-current-buffer ,buf ,@body))))) -(put 'erc-with-buffer 'lisp-indent-function 1) -(put 'erc-with-buffer 'edebug-form-spec '((form &optional form) body)) (defun erc-get-buffer (target &optional proc) "Return the buffer matching TARGET in the process PROC. @@ -1687,6 +1685,7 @@ needs to match PROC." FORMS will be evaluated in all buffers having the process PROCESS and where PRED matches or in all buffers of the server process if PRED is nil." + (declare (indent 1) (debug (form form body))) ;; Make the evaluation have the correct order (let ((pre (make-symbol "pre")) (pro (make-symbol "pro"))) @@ -1700,8 +1699,6 @@ nil." ;; 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)) ;; (iswitchb-mode) will autoload iswitchb.el (defvar iswitchb-temp-buflist) @@ -1846,7 +1843,7 @@ removed from the list will be disabled." capab-identify) (const :tag "completion: Complete nicknames and commands (programmable)" completion) - (const :tag "hecomplete: Complete nicknames and commands (old)" hecomplete) + (const :tag "hecomplete: Complete nicknames and commands (obsolete, use \"completion\")" hecomplete) (const :tag "dcc: Provide Direct Client-to-Client support" dcc) (const :tag "fill: Wrap long lines" fill) (const :tag "identd: Launch an identd server on port 8113" identd) @@ -1866,6 +1863,8 @@ removed from the list will be disabled." (const :tag "notify: Notify when the online status of certain users changes" notify) + (const :tag "notifications: Send notifications on PRIVMSG or nickname mentions" + notifications) (const :tag "page: Process CTCP PAGE requests from IRC" page) (const :tag "readonly: Make displayed lines read-only" readonly) (const :tag "replace: Replace text in messages" replace) @@ -2158,11 +2157,11 @@ functions in here get called with the parameters SERVER and NICK." (list :server server :port port :nick nick :password passwd))) ;;;###autoload -(defun* erc (&key (server (erc-compute-server)) - (port (erc-compute-port)) - (nick (erc-compute-nick)) - password - (full-name (erc-compute-full-name))) +(cl-defun erc (&key (server (erc-compute-server)) + (port (erc-compute-port)) + (nick (erc-compute-nick)) + password + (full-name (erc-compute-full-name))) "ERC is a powerful, modular, and extensible IRC client. This function is the main entry point for ERC. @@ -2384,24 +2383,24 @@ If STRING is nil, the function does nothing." (while list (setq elt (car list)) (cond ((integerp elt) ; POSITION - (incf (car list) shift)) + (cl-incf (car list) shift)) ((or (atom elt) ; nil, EXTENT ;; (eq t (car elt)) ; (t . TIME) (markerp (car elt))) ; (MARKER . DISTANCE) nil) ((integerp (car elt)) ; (BEGIN . END) - (incf (car elt) shift) - (incf (cdr elt) shift)) + (cl-incf (car elt) shift) + (cl-incf (cdr elt) shift)) ((stringp (car elt)) ; (TEXT . POSITION) - (incf (cdr elt) (* (if (natnump (cdr elt)) 1 -1) shift))) + (cl-incf (cdr elt) (* (if (natnump (cdr elt)) 1 -1) shift))) ((null (car elt)) ; (nil PROPERTY VALUE BEG . END) (let ((cons (nthcdr 3 elt))) - (incf (car cons) shift) - (incf (cdr cons) shift))) + (cl-incf (car cons) shift) + (cl-incf (cdr cons) shift))) ((and (featurep 'xemacs) (extentp (car elt))) ; (EXTENT START END) - (incf (nth 1 elt) shift) - (incf (nth 2 elt) shift))) + (cl-incf (nth 1 elt) shift) + (cl-incf (nth 2 elt) shift))) (setq list (cdr list)))))) (defvar erc-valid-nick-regexp "[]a-zA-Z^[;\\`_{}|][]^[;\\`_{}|a-zA-Z0-9-]*" @@ -2478,6 +2477,13 @@ purposes." :group 'erc-lurker :type 'boolean) +(defcustom erc-lurker-ignore-chars "`_" + "Characters at the end of a nick to strip for activity tracking purposes. + +See also `erc-lurker-trim-nicks'." + :group 'erc-lurker + :type 'string) + (defun erc-lurker-maybe-trim (nick) "Maybe trim trailing `erc-lurker-ignore-chars' from NICK. @@ -2492,13 +2498,6 @@ non-nil." "" nick) nick)) -(defcustom erc-lurker-ignore-chars "`_" - "Characters at the end of a nick to strip for activity tracking purposes. - -See also `erc-lurker-trim-nicks'." - :group 'erc-lurker - :type 'string) - (defcustom erc-lurker-hide-list nil "List of IRC type messages to hide when sent by lurkers. @@ -2535,9 +2534,9 @@ consumption for long-lived IRC or Emacs sessions." (maphash (lambda (nick last-PRIVMSG-time) (when - (> (time-to-seconds (time-subtract - (current-time) - last-PRIVMSG-time)) + (> (float-time (time-subtract + (current-time) + last-PRIVMSG-time)) erc-lurker-threshold-time) (remhash nick hash))) hash) @@ -2581,7 +2580,8 @@ updates of `erc-lurker-state'." (server (erc-canonicalize-server-name erc-server-announced-name))) (when (equal command "PRIVMSG") - (when (>= (incf erc-lurker-cleanup-count) erc-lurker-cleanup-interval) + (when (>= (cl-incf erc-lurker-cleanup-count) + erc-lurker-cleanup-interval) (setq erc-lurker-cleanup-count 0) (erc-lurker-cleanup)) (unless (gethash server erc-lurker-state) @@ -2602,10 +2602,21 @@ server within `erc-lurker-threshold-time'. See also (gethash (erc-lurker-maybe-trim nick) (gethash server erc-lurker-state (make-hash-table))))) (or (null last-PRIVMSG-time) - (> (time-to-seconds + (> (float-time (time-subtract (current-time) last-PRIVMSG-time)) erc-lurker-threshold-time)))) +(defcustom erc-common-server-suffixes + '(("openprojects.net$" . "OPN") + ("freenode.net$" . "freenode") + ("oftc.net$" . "OFTC")) + "Alist of common server name suffixes. +This variable is used in mode-line display to save screen +real estate. Set it to nil if you want to avoid changing +displayed hostnames." + :group 'erc-mode-line-and-header + :type 'alist) + (defun erc-canonicalize-server-name (server) "Returns the canonical network name for SERVER if any, otherwise `erc-server-announced-name'. SERVER is matched against @@ -3116,37 +3127,37 @@ If SERVER is non-nil, use that, rather than the current server." (add-to-list 'symlist (cons (erc-once-with-server-event 311 `(string= ,nick - (second + (nth 1 (erc-response.command-args parsed)))) 'erc-server-311-functions)) (add-to-list 'symlist (cons (erc-once-with-server-event 312 `(string= ,nick - (second + (nth 1 (erc-response.command-args parsed)))) 'erc-server-312-functions)) (add-to-list 'symlist (cons (erc-once-with-server-event 318 `(string= ,nick - (second + (nth 1 (erc-response.command-args parsed)))) 'erc-server-318-functions)) (add-to-list 'symlist (cons (erc-once-with-server-event 319 `(string= ,nick - (second + (nth 1 (erc-response.command-args parsed)))) 'erc-server-319-functions)) (add-to-list 'symlist (cons (erc-once-with-server-event 320 `(string= ,nick - (second + (nth 1 (erc-response.command-args parsed)))) 'erc-server-320-functions)) (add-to-list 'symlist (cons (erc-once-with-server-event 330 `(string= ,nick - (second + (nth 1 (erc-response.command-args parsed)))) 'erc-server-330-functions)) (add-to-list 'symlist @@ -4329,8 +4340,8 @@ See also: `erc-echo-notice-in-user-buffers', (defun erc-banlist-store (proc parsed) "Record ban entries for a channel." - (multiple-value-bind (channel mask whoset) - (values-list (cdr (erc-response.command-args parsed))) + (pcase-let ((`(,channel ,mask ,whoset) + (cdr (erc-response.command-args parsed)))) ;; Determine to which buffer the message corresponds (let ((buffer (erc-get-buffer channel proc))) (with-current-buffer buffer @@ -4341,7 +4352,7 @@ See also: `erc-echo-notice-in-user-buffers', (defun erc-banlist-finished (proc parsed) "Record that we have received the banlist." - (let* ((channel (second (erc-response.command-args parsed))) + (let* ((channel (nth 1 (erc-response.command-args parsed))) (buffer (erc-get-buffer channel proc))) (with-current-buffer buffer (put 'erc-channel-banlist 'received-from-server t))) @@ -4350,7 +4361,7 @@ See also: `erc-echo-notice-in-user-buffers', (defun erc-banlist-update (proc parsed) "Check MODE commands for bans and update the banlist appropriately." ;; FIXME: Possibly incorrect. -- Lawrence 2004-05-11 - (let* ((tgt (first (erc-response.command-args parsed))) + (let* ((tgt (car (erc-response.command-args parsed))) (mode (erc-response.contents parsed)) (whoset (erc-response.sender parsed)) (buffer (erc-get-buffer tgt proc))) @@ -5204,42 +5215,66 @@ Specifically, return the position of `erc-insert-marker'." "Return the value of `point' at the end of the input line." (point-max)) +(defvar erc-last-input-time 0 + "Time of last call to `erc-send-current-line'. +If that function has never been called, the value is 0.") + +(defcustom erc-accidental-paste-threshold-seconds nil + "Minimum time, in seconds, before sending new lines via IRC. +If the value is a number, `erc-send-current-line' signals an +error if its previous invocation was less than this much time +ago. This is useful so that if you accidentally enter large +amounts of text into the ERC buffer, that text is not sent to the +IRC server. + +If the value is nil, `erc-send-current-line' always considers any +submitted line to be intentional." + :group 'erc + :version "24.4" + :type '(choice number (other :tag "disabled" nil))) + (defun erc-send-current-line () "Parse current line and send it to IRC." (interactive) - (save-restriction - (widen) - (if (< (point) (erc-beg-of-input-line)) - (erc-error "Point is not in the input area") - (let ((inhibit-read-only t) - (str (erc-user-input)) - (old-buf (current-buffer))) - (if (and (not (erc-server-buffer-live-p)) - (not (erc-command-no-process-p str))) - (erc-error "ERC: No process running") - (erc-set-active-buffer (current-buffer)) - - ;; Kill the input and the prompt - (delete-region (erc-beg-of-input-line) - (erc-end-of-input-line)) - - (unwind-protect - (erc-send-input str) - ;; Fix the buffer if the command didn't kill it - (when (buffer-live-p old-buf) - (with-current-buffer old-buf - (save-restriction - (widen) - (goto-char (point-max)) - (when (processp erc-server-process) - (set-marker (process-mark erc-server-process) (point))) - (set-marker erc-insert-marker (point)) - (let ((buffer-modified (buffer-modified-p))) - (erc-display-prompt) - (set-buffer-modified-p buffer-modified)))))) - - ;; Only when last hook has been run... - (run-hook-with-args 'erc-send-completed-hook str)))))) + (let ((now (float-time))) + (if (or (not erc-accidental-paste-threshold-seconds) + (< erc-accidental-paste-threshold-seconds + (- now erc-last-input-time))) + (save-restriction + (widen) + (if (< (point) (erc-beg-of-input-line)) + (erc-error "Point is not in the input area") + (let ((inhibit-read-only t) + (str (erc-user-input)) + (old-buf (current-buffer))) + (if (and (not (erc-server-buffer-live-p)) + (not (erc-command-no-process-p str))) + (erc-error "ERC: No process running") + (erc-set-active-buffer (current-buffer)) + ;; Kill the input and the prompt + (delete-region (erc-beg-of-input-line) + (erc-end-of-input-line)) + (unwind-protect + (erc-send-input str) + ;; Fix the buffer if the command didn't kill it + (when (buffer-live-p old-buf) + (with-current-buffer old-buf + (save-restriction + (widen) + (goto-char (point-max)) + (when (processp erc-server-process) + (set-marker (process-mark erc-server-process) (point))) + (set-marker erc-insert-marker (point)) + (let ((buffer-modified (buffer-modified-p))) + (erc-display-prompt) + (set-buffer-modified-p buffer-modified)))))) + + ;; Only when last hook has been run... + (run-hook-with-args 'erc-send-completed-hook str)))) + (setq erc-last-input-time now)) + (switch-to-buffer "*ERC Accidental Paste Overflow*") + (lwarn 'erc :warning + "You seem to have accidentally pasted some text!")))) (defun erc-user-input () "Return the input of the user in the current buffer." @@ -6001,7 +6036,7 @@ entry of `channel-members'." (if cuser (setq op (erc-channel-user-op cuser) voice (erc-channel-user-voice cuser))) - (if (interactive-p) + (if (called-interactively-p 'interactive) (message "%s is %s@%s%s%s" nick login host (if full-name (format " (%s)" full-name) "") @@ -6089,17 +6124,6 @@ Otherwise, use the `erc-header-line' face." :group 'erc-paranoia :type 'boolean) -(defcustom erc-common-server-suffixes - '(("openprojects.net$" . "OPN") - ("freenode.net$" . "freenode") - ("oftc.net$" . "OFTC")) - "Alist of common server name suffixes. -This variable is used in mode-line display to save screen -real estate. Set it to nil if you want to avoid changing -displayed hostnames." - :group 'erc-mode-line-and-header - :type 'alist) - (defcustom erc-mode-line-away-status-format "(AWAY since %a %b %d %H:%M) " "When you're away on a server, this is shown in the mode line. @@ -6303,7 +6327,7 @@ If optional argument HERE is non-nil, insert version number at point." (format "ERC %s (GNU Emacs %s)" erc-version-string emacs-version))) (if here (insert version-string) - (if (interactive-p) + (if (called-interactively-p 'interactive) (message "%s" version-string) version-string)))) @@ -6323,7 +6347,7 @@ If optional argument HERE is non-nil, insert version number at point." ", "))) (if here (insert string) - (if (interactive-p) + (if (called-interactively-p 'interactive) (message "%s" string) string)))) |
