summaryrefslogtreecommitdiff
path: root/lisp/erc
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/erc')
-rw-r--r--lisp/erc/erc-autoaway.el2
-rw-r--r--lisp/erc/erc-backend.el65
-rw-r--r--lisp/erc/erc-button.el22
-rw-r--r--lisp/erc/erc-capab.el4
-rw-r--r--lisp/erc/erc-compat.el4
-rw-r--r--lisp/erc/erc-dcc.el148
-rw-r--r--lisp/erc/erc-desktop-notifications.el2
-rw-r--r--lisp/erc/erc-ezbounce.el2
-rw-r--r--lisp/erc/erc-fill.el2
-rw-r--r--lisp/erc/erc-goodies.el4
-rw-r--r--lisp/erc/erc-ibuffer.el2
-rw-r--r--lisp/erc/erc-identd.el2
-rw-r--r--lisp/erc/erc-imenu.el5
-rw-r--r--lisp/erc/erc-join.el2
-rw-r--r--lisp/erc/erc-lang.el14
-rw-r--r--lisp/erc/erc-list.el2
-rw-r--r--lisp/erc/erc-log.el2
-rw-r--r--lisp/erc/erc-match.el2
-rw-r--r--lisp/erc/erc-menu.el2
-rw-r--r--lisp/erc/erc-netsplit.el2
-rw-r--r--lisp/erc/erc-networks.el2
-rw-r--r--lisp/erc/erc-notify.el2
-rw-r--r--lisp/erc/erc-page.el2
-rw-r--r--lisp/erc/erc-pcomplete.el2
-rw-r--r--lisp/erc/erc-replace.el5
-rw-r--r--lisp/erc/erc-ring.el2
-rw-r--r--lisp/erc/erc-services.el17
-rw-r--r--lisp/erc/erc-sound.el2
-rw-r--r--lisp/erc/erc-speedbar.el2
-rw-r--r--lisp/erc/erc-spelling.el2
-rw-r--r--lisp/erc/erc-stamp.el2
-rw-r--r--lisp/erc/erc-status-sidebar.el2
-rw-r--r--lisp/erc/erc-track.el2
-rw-r--r--lisp/erc/erc-truncate.el2
-rw-r--r--lisp/erc/erc-xdcc.el2
-rw-r--r--lisp/erc/erc.el120
36 files changed, 247 insertions, 211 deletions
diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el
index 979f93f693c..8d970bd6b96 100644
--- a/lisp/erc/erc-autoaway.el
+++ b/lisp/erc/erc-autoaway.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2002-2004, 2006-2022 Free Software Foundation, Inc.
;; Author: Jorgen Schaefer <forcer@forcix.cx>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; URL: https://www.emacswiki.org/emacs/ErcAutoAway
;; This file is part of GNU Emacs.
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 9e85d285d5c..1252a5b4fac 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -4,7 +4,7 @@
;; Filename: erc-backend.el
;; Author: Lawrence Mitchell <wence@gmx.li>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Created: 2004-05-7
;; Keywords: comm, IRC, chat, client, internet
@@ -199,6 +199,11 @@ active, use the `erc-server-process-alive' function instead.")
(defvar-local erc-server-reconnecting nil
"Non-nil if the user requests an explicit reconnect, and the
current IRC process is still alive.")
+(make-obsolete-variable 'erc-server-reconnecting
+ "see `erc--server-reconnecting'" "29.1")
+
+(defvar-local erc--server-reconnecting nil
+ "Non-nil when reconnecting.")
(defvar-local erc-server-timed-out nil
"Non-nil if the IRC server failed to respond to a ping.")
@@ -310,8 +315,7 @@ This will only be consulted if the coding system in
:version "24.1"
:type '(repeat coding-system))
-(defcustom erc-server-coding-system (if (and (fboundp 'coding-system-p)
- (coding-system-p 'undecided)
+(defcustom erc-server-coding-system (if (and (coding-system-p 'undecided)
(coding-system-p 'utf-8))
'(utf-8 . undecided)
nil)
@@ -459,7 +463,7 @@ If POS is out of range, the value is nil."
(defun erc-bounds-of-word-at-point ()
"Return the bounds of word at point, or nil if we're not at a word.
If no `subword-mode' is active, then this is
-\(bounds-of-thing-at-point 'word)."
+\(bounds-of-thing-at-point \\='word)."
(if (or (erc-word-at-arg-p (point))
(erc-word-at-arg-p (1- (point))))
(save-excursion
@@ -533,7 +537,8 @@ TLS (see `erc-session-client-certificate' for more details)."
(with-current-buffer buffer
(setq erc-server-process process)
(setq erc-server-quitting nil)
- (setq erc-server-reconnecting nil)
+ (setq erc-server-reconnecting nil
+ erc--server-reconnecting nil)
(setq erc-server-timed-out nil)
(setq erc-server-banned nil)
(setq erc-server-error-occurred nil)
@@ -616,36 +621,42 @@ Make sure you are in an ERC buffer when running this."
(erc-log-irc-protocol line nil)
(erc-parse-server-response process line)))))))
-(define-inline erc-server-reconnect-p (event)
+(defun erc--server-reconnect-p (event)
+ "Return non-nil when ERC should attempt to reconnect.
+EVENT is the message received from the closed connection process."
+ (and erc-server-auto-reconnect
+ (not erc-server-banned)
+ ;; make sure we don't infinitely try to reconnect, unless the
+ ;; user wants that
+ (or (eq erc-server-reconnect-attempts t)
+ (and (integerp erc-server-reconnect-attempts)
+ (< erc-server-reconnect-count
+ erc-server-reconnect-attempts)))
+ (or erc-server-timed-out
+ (not (string-match "^deleted" event)))
+ ;; open-network-stream-nowait error for connection refused
+ (if (string-match "^failed with code 111" event) 'nonblocking t)))
+
+(defun erc-server-reconnect-p (event)
"Return non-nil if ERC should attempt to reconnect automatically.
EVENT is the message received from the closed connection process."
- (inline-letevals (event)
- (inline-quote
- (or erc-server-reconnecting
- (and erc-server-auto-reconnect
- (not erc-server-banned)
- ;; make sure we don't infinitely try to reconnect, unless the
- ;; user wants that
- (or (eq erc-server-reconnect-attempts t)
- (and (integerp erc-server-reconnect-attempts)
- (< erc-server-reconnect-count
- erc-server-reconnect-attempts)))
- (or erc-server-timed-out
- (not (string-match "^deleted" ,event)))
- ;; open-network-stream-nowait error for connection refused
- (if (string-match "^failed with code 111" ,event) 'nonblocking t))))))
+ (declare (obsolete "see `erc--server-reconnect-p'" "29.1"))
+ (or (with-suppressed-warnings ((obsolete erc-server-reconnecting))
+ erc-server-reconnecting)
+ (erc--server-reconnect-p event)))
(defun erc-process-sentinel-2 (event buffer)
"Called when `erc-process-sentinel-1' has detected an unexpected disconnect."
(if (not (buffer-live-p buffer))
(erc-update-mode-line)
(with-current-buffer buffer
- (let ((reconnect-p (erc-server-reconnect-p event)) message delay)
+ (let ((reconnect-p (erc--server-reconnect-p event)) message delay)
(setq message (if reconnect-p 'disconnected 'disconnected-noreconnect))
(erc-display-message nil 'error (current-buffer) message)
(if (not reconnect-p)
;; terminate, do not reconnect
(progn
+ (setq erc--server-reconnecting nil)
(erc-display-message nil 'error (current-buffer)
'terminated ?e event)
;; Update mode line indicators
@@ -654,7 +665,8 @@ EVENT is the message received from the closed connection process."
;; reconnect
(condition-case nil
(progn
- (setq erc-server-reconnecting nil
+ (setq erc-server-reconnecting nil
+ erc--server-reconnecting t
erc-server-reconnect-count (1+ erc-server-reconnect-count))
(setq delay erc-server-reconnect-timeout)
(run-at-time delay nil
@@ -1169,7 +1181,8 @@ Would expand to:
\(fn (NAME &rest ALIASES) &optional EXTRA-FN-DOC EXTRA-VAR-DOC &rest FN-BODY)"
(declare (debug (&define [&name "erc-response-handler@"
(symbolp &rest symbolp)]
- &optional sexp sexp def-body)))
+ &optional sexp sexp def-body))
+ (indent defun))
(if (numberp name) (setq name (intern (format "%03i" name))))
(setq aliases (mapcar (lambda (a)
(if (numberp a)
@@ -1178,7 +1191,7 @@ Would expand to:
aliases))
(let* ((hook-name (intern (format "erc-server-%s-functions" name)))
(fn-name (intern (format "erc-server-%s" name)))
- (hook-doc (format-message "\
+ (hook-doc (format "\
%sHook called upon receiving a %%s server response.
Each function is called with two arguments, the process associated
with the response and the parsed response. If the function returns
@@ -1189,7 +1202,7 @@ See also `%s'."
(concat extra-var-doc "\n\n")
"")
fn-name))
- (fn-doc (format-message "\
+ (fn-doc (format "\
%sHandler for a %s server response.
PROC is the server process which returned the response.
PARSED is the actual response as an `erc-response' struct.
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index 680de6d5aab..aeada705c4a 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1996-2004, 2006-2022 Free Software Foundation, Inc.
;; Author: Mario Lang <mlang@delysid.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm, irc, button, url, regexp
;; URL: https://www.emacswiki.org/emacs/ErcButton
@@ -125,7 +125,7 @@ longer than `erc-fill-column'."
;; a button, it makes no sense to optimize performance by
;; bytecompiling lambdas in this alist. On the other hand, it makes
;; things hard to maintain.
- '(('nicknames 0 erc-button-buttonize-nicks erc-nick-popup 0)
+ '((nicknames 0 erc-button-buttonize-nicks erc-nick-popup 0)
(erc-button-url-regexp 0 t browse-url-button-open-url 0)
("<URL: *\\([^<> ]+\\) *>" 0 t browse-url-button-open-url 1)
;;; ("(\\(\\([^~\n \t@][^\n \t@]*\\)@\\([a-zA-Z0-9.:-]+\\)\\)" 1 t finger 2 3)
@@ -158,12 +158,12 @@ REGEXP is the string matching text around the button or a symbol
strings, or an alist with the strings in the car. Note that
entries in lists or alists are considered to be nicks or other
complete words. Therefore they are enclosed in \\< and \\>
- while searching. REGEXP can also be the quoted symbol
- \\='nicknames, which matches the nickname of any user on the
+ while searching. REGEXP can also be the symbol
+ `nicknames', which matches the nickname of any user on the
current server.
BUTTON is the number of the regexp grouping actually matching the
- button. This is ignored if REGEXP is \\='nicknames.
+ button. This is ignored if REGEXP is `nicknames'.
FORM is a Lisp expression which must eval to true for the button to
be added.
@@ -174,17 +174,15 @@ CALLBACK is the function to call when the user push this button.
PAR is a number of a regexp grouping whose text will be passed to
CALLBACK. There can be several PAR arguments. If REGEXP is
- \\='nicknames, these are ignored, and CALLBACK will be called with
+ `nicknames', these are ignored, and CALLBACK will be called with
the nickname matched as the argument."
- :version "24.1" ; remove finger (bug#4443)
+ :version "29.1"
:type '(repeat
(list :tag "Button"
(choice :tag "Matches"
regexp
(variable :tag "Variable containing regexp")
- ;; FIXME It really does mean 'nicknames
- ;; rather than just nicknames.
- (const :tag "Nicknames" 'nicknames))
+ (const :tag "Nicknames" nicknames))
(integer :tag "Number of the regexp section that matches")
(choice :tag "When to buttonize"
(const :tag "Always" t)
@@ -256,7 +254,9 @@ specified by `erc-button-alist'."
regexp)
(erc-button-remove-old-buttons)
(dolist (entry alist)
- (if (equal (car entry) (quote (quote nicknames)))
+ (if (or (eq (car entry) 'nicknames)
+ ;; Old form retained for backward compatibility.
+ (equal (car entry) (quote 'nicknames)))
(erc-button-add-nickname-buttons entry)
(progn
(setq regexp (or (and (stringp (car entry)) (car entry))
diff --git a/lisp/erc/erc-capab.el b/lisp/erc/erc-capab.el
index 7b7773d5e13..8d0f40af994 100644
--- a/lisp/erc/erc-capab.el
+++ b/lisp/erc/erc-capab.el
@@ -2,9 +2,9 @@
;; Copyright (C) 2006-2022 Free Software Foundation, Inc.
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
-; This file is part of GNU Emacs.
+;; 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
diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el
index 0541d1604cb..16cfb15a5ae 100644
--- a/lisp/erc/erc-compat.el
+++ b/lisp/erc/erc-compat.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2002-2003, 2005-2022 Free Software Foundation, Inc.
;; Author: Alex Schroeder <alex@gnu.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; URL: https://www.emacswiki.org/emacs/ERC
;; This file is part of GNU Emacs.
@@ -27,8 +27,6 @@
;;; Code:
-(require 'format-spec)
-
;;;###autoload(autoload 'erc-define-minor-mode "erc-compat")
(define-obsolete-function-alias 'erc-define-minor-mode
#'define-minor-mode "28.1")
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index 399e5fb114c..ff486b2d4ea 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -1,12 +1,11 @@
;;; erc-dcc.el --- CTCP DCC module for ERC -*- lexical-binding: t; -*-
-;; Copyright (C) 1993-1995, 1998, 2002-2004, 2006-2022 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1993-2022 Free Software Foundation, Inc.
;; Author: Ben A. Mesander <ben@gnu.ai.mit.edu>
;; Noah Friedman <friedman@prep.ai.mit.edu>
;; Per Persson <pp@sno.pp.se>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm
;; Created: 1994-01-23
@@ -44,7 +43,7 @@
;; /dcc chat nick - Either accept pending chat offer from nick, or offer
;; DCC chat to nick
;; /dcc close type [nick] - Close DCC connection (SEND/GET/CHAT) with nick
-;; /dcc get nick [file] - Accept DCC offer from nick
+;; /dcc get [-t][-s] nick [file] - Accept DCC offer from nick
;; /dcc list - List all DCC offers/connections
;; /dcc send nick file - Offer DCC SEND to nick
@@ -106,7 +105,11 @@ Looks like:
:file - for outgoing sends, the full path to the file. For incoming sends,
the suggested filename or vetted filename
- :size - size of the file, may be nil on incoming DCCs")
+ :size - size of the file, may be nil on incoming DCCs
+
+ :secure - optional item indicating sender support for TLS
+
+ :turbo - optional item indicating sender support for TSEND")
(defun erc-dcc-list-add (type nick peer parent &rest args)
"Add a new entry of type TYPE to `erc-dcc-list' and return it."
@@ -120,12 +123,13 @@ Looks like:
;; more: the entry data from erc-dcc-list for this particular process.
(defvar erc-dcc-connect-function 'erc-dcc-open-network-stream)
-(defun erc-dcc-open-network-stream (procname buffer addr port _entry)
+(defun erc-dcc-open-network-stream (procname buffer addr port entry)
;; FIXME: Time to try activating this again!?
(if nil; (fboundp 'open-network-stream-nowait) ;; this currently crashes
;; cvs emacs
(open-network-stream-nowait procname buffer addr port)
- (open-network-stream procname buffer addr port)))
+ (open-network-stream procname buffer addr port
+ :type (and (plist-get entry :secure) 'tls))))
(erc-define-catalog
'english
@@ -145,13 +149,14 @@ Looks like:
(dcc-get-bytes-received . "DCC: %f: %b bytes received")
(dcc-get-complete
. "DCC: file %f transfer complete (%s bytes in %t seconds)")
+ (dcc-get-failed . "DCC: file %f transfer failed at %s of %v in %t seconds")
(dcc-get-cmd-aborted . "DCC: Aborted getting %f from %n")
(dcc-get-file-too-long
. "DCC: %f: File longer than sender claimed; aborting transfer")
(dcc-get-notfound . "DCC: %n hasn't offered %f for DCC transfer")
- (dcc-list-head . "DCC: From Type Active Size Filename")
- (dcc-list-line . "DCC: -------- ---- ------ -------------- --------")
- (dcc-list-item . "DCC: %-8n %-4t %-6a %-14s %f")
+ (dcc-list-head . "DCC: From Type Active Size Filename")
+ (dcc-list-line . "DCC: -------- ---- ------ ----------------- --------")
+ (dcc-list-item . "DCC: %-8n %-4t %-6a %-17s %f%u")
(dcc-list-end . "DCC: End of list.")
(dcc-malformed . "DCC: error: %n (%u@%h) sent malformed request: %q")
(dcc-privileged-port
@@ -183,9 +188,7 @@ compared with `erc-nick-equal-p' which is IRC case-insensitive."
(let ((prop (car prem))
(val (cadr prem)))
(setq prem (cddr prem)
- ;; plist-member is a predicate in xemacs
- test (and (plist-member elt prop)
- (plist-get elt prop)))
+ test (cadr (plist-member elt prop)))
;; if the property exists and is equal, we continue, else, try the
;; next element of the list
(or (and (eq prop :nick) (if (>= emacs-major-version 28)
@@ -198,7 +201,7 @@ compared with `erc-nick-equal-p' which is IRC case-insensitive."
(erc-extract-nick test)
(erc-extract-nick val)))
;; not a nick
- (eq test val)
+ (equal test val)
(setq cont nil))))
(if cont
(setq result elt)
@@ -508,8 +511,12 @@ At least one of TYPE and NICK must be provided."
FILE is the filename. If FILE is split into multiple arguments,
re-join the arguments, separated by a space.
PROC is the server process."
- (setq file (and file (mapconcat #'identity file " ")))
- (let* ((elt (erc-dcc-member :nick nick :type 'GET))
+ (let* ((args (seq-group-by (lambda (s) (eq ?- (aref s 0))) (cons nick file)))
+ (flags (prog1 (cdr (assq t args))
+ (setq args (cdr (assq nil args))
+ nick (pop args)
+ file (and args (mapconcat #'identity args " ")))))
+ (elt (erc-dcc-member :nick nick :type 'GET :file file))
(filename (or file (plist-get elt :file) "unknown")))
(if elt
(let* ((file (read-file-name
@@ -529,7 +536,13 @@ PROC is the server process."
'dcc-get-cmd-aborted
?n nick ?f filename)))
(t
- (erc-dcc-get-file elt file proc))))
+ (erc-dcc-get-file elt file proc)))
+ (when (member "-s" flags)
+ (setq erc-dcc-list (cons (plist-put elt :secure t)
+ (delq elt erc-dcc-list))))
+ (when (member "-t" flags)
+ (setq erc-dcc-list (cons (plist-put elt :turbo t)
+ (delq elt erc-dcc-list)))))
(erc-display-message
nil '(notice error) 'active
'dcc-get-notfound ?n nick ?f filename))))
@@ -567,6 +580,7 @@ It lists the current state of `erc-dcc-list' in an easy to read manner."
(process-status (plist-get elt :peer))
"no")
?s (concat size
+ ;; FIXME consider uniquified names, e.g., foo.bin<2>
(if (and (eq 'GET (plist-get elt :type))
(plist-member elt :file)
(buffer-live-p (get-buffer (plist-get elt :file)))
@@ -578,7 +592,12 @@ It lists the current state of `erc-dcc-list' in an easy to read manner."
(format " (%d%%)"
(floor (* 100.0 byte-count)
(plist-get elt :size))))))
- ?f (or (and (plist-member elt :file) (plist-get elt :file)) "")))
+ ?f (or (and (plist-member elt :file) (plist-get elt :file)) "")
+ ?u (if-let* ((flags (concat (and (plist-get elt :turbo) "t")
+ (and (plist-get elt :secure) "s")))
+ ((not (string-empty-p flags))))
+ (concat " (" flags ")")
+ "")))
(erc-display-message
nil 'notice 'active
'dcc-list-end)
@@ -605,6 +624,10 @@ separated by a space."
(defvar erc-dcc-query-handler-alist
'(("SEND" . erc-dcc-handle-ctcp-send)
+ ("TSEND" . erc-dcc-handle-ctcp-send)
+ ("SSEND" . erc-dcc-handle-ctcp-send)
+ ("TSSEND" . erc-dcc-handle-ctcp-send)
+ ("STSEND" . erc-dcc-handle-ctcp-send)
("CHAT" . erc-dcc-handle-ctcp-chat)))
;;;###autoload
@@ -623,12 +646,16 @@ that subcommand."
?q query ?n nick ?u login ?h host))))
(defconst erc-dcc-ctcp-query-send-regexp
- (concat "^DCC SEND \\(?:"
+ (rx bot "DCC " (group-n 6 (: (** 0 2 (any "TS")) "SEND")) " "
;; Following part matches either filename without spaces
;; or filename enclosed in double quotes with any number
;; of escaped double quotes inside.
- "\"\\(\\(?:\\\\\"\\|[^\"\\]\\)+\\)\"\\|\\([^ ]+\\)"
- "\\) \\([0-9]+\\) \\([0-9]+\\) *\\([0-9]*\\)"))
+ (: (or (: ?\" (group-n 1 (+ (or (: ?\\ ?\") (not (any ?\" ?\\))))) ?\")
+ (group-n 2 (+ (not " ")))))
+ (: " " (group-n 3 (+ digit))
+ " " (group-n 4 (+ digit))
+ (* " ") (group-n 5 (* digit)))
+ eot))
(define-inline erc-dcc-unquote-filename (filename)
(inline-quote
@@ -653,12 +680,14 @@ It extracts the information about the dcc request and adds it to
'dcc-request-bogus
?r "SEND" ?n nick ?u login ?h host))
((string-match erc-dcc-ctcp-query-send-regexp query)
- (let ((filename
- (or (match-string 2 query)
- (erc-dcc-unquote-filename (match-string 1 query))))
- (ip (erc-decimal-to-ip (match-string 3 query)))
- (port (match-string 4 query))
- (size (match-string 5 query)))
+ (let* ((filename (or (match-string 2 query)
+ (erc-dcc-unquote-filename (match-string 1 query))))
+ (ip (erc-decimal-to-ip (match-string 3 query)))
+ (port (match-string 4 query))
+ (size (match-string 5 query))
+ (sub (substring (match-string 6 query) 0 -4))
+ (secure (seq-contains-p sub ?S #'eq))
+ (turbo (seq-contains-p sub ?T #'eq)))
;; FIXME: a warning really should also be sent
;; if the ip address != the host the dcc sender is on.
(erc-display-message
@@ -675,7 +704,9 @@ It extracts the information about the dcc request and adds it to
'GET (format "%s!%s@%s" nick login host)
nil proc
:ip ip :port port :file filename
- :size (string-to-number size))
+ :size (string-to-number size)
+ :turbo (and turbo t)
+ :secure (and secure t))
(if (and (eq erc-dcc-send-request 'auto)
(erc-dcc-auto-mask-p (format "\"%s!%s@%s\"" nick login host)))
(erc-dcc-get-file (car erc-dcc-list) filename proc))))
@@ -771,7 +802,7 @@ the matching regexp, or nil if none found."
PROC is the process-object of the DCC connection. Returns the number of
bytes sent."
(let* ((elt (erc-dcc-member :peer proc))
- (confirmed-marker (plist-get elt :sent))
+ (confirmed-marker (plist-get elt :confirmed))
(sent-marker (plist-get elt :sent)))
(with-current-buffer (process-buffer proc)
(when erc-dcc-verbose
@@ -923,8 +954,7 @@ and making the connection."
(inhibit-file-name-operation 'write-region))
(write-region (point) (point) erc-dcc-file-name nil 'nomessage))
- (setq erc-server-process parent-proc
- erc-dcc-entry-data entry)
+ (setq erc-server-process parent-proc)
(setq erc-dcc-byte-count 0)
(setq proc
(funcall erc-dcc-connect-function
@@ -938,8 +968,8 @@ and making the connection."
(set-process-filter proc #'erc-dcc-get-filter)
(set-process-sentinel proc #'erc-dcc-get-sentinel)
- (setq entry (plist-put entry :start-time (erc-current-time)))
- (setq entry (plist-put entry :peer proc)))))
+ (setq erc-dcc-entry-data (plist-put (plist-put entry :peer proc)
+ :start-time (erc-current-time))))))
(defun erc-dcc-append-contents (buffer _file)
"Append the contents of BUFFER to FILE.
@@ -955,6 +985,16 @@ The contents of the BUFFER will then be erased."
(setq erc-dcc-byte-count (+ (buffer-size) erc-dcc-byte-count))
(erase-buffer))))
+;; If people really need this, we can convert it into a proper option.
+
+(defvar erc-dcc--X-send-final-turbo-ack nil
+ "Workaround for maverick turbo senders that only require a final ACK.
+The only known culprit is WeeChat, with its xfer.network.fast_send
+option, which is on by default. Leaving this set to nil and calling
+/DCC GET -t works just fine, but WeeChat sees it as a failure even
+though the file arrives in its entirety. Setting this to t may
+alleviate such problems.")
+
(defun erc-dcc-get-filter (proc str)
"This is the process filter for transfers from other clients to this one.
It reads incoming bytes from the network and stores them in the DCC
@@ -989,31 +1029,43 @@ rather than every 1024 byte block, but nobody seems to care."
'dcc-get-file-too-long
?f (file-name-nondirectory (buffer-name)))
(delete-process proc))
- (t
- (process-send-string
- proc (erc-pack-int received-bytes)))))))
-
+ ;; Some senders want us to hang up. Only observed w. TSEND.
+ ((and (plist-get erc-dcc-entry-data :turbo)
+ (= received-bytes (plist-get erc-dcc-entry-data :size)))
+ (when erc-dcc--X-send-final-turbo-ack
+ (process-send-string proc (erc-pack-int received-bytes)))
+ (delete-process proc))
+ ((not (or (plist-get erc-dcc-entry-data :turbo)
+ (process-get proc :reportingp)))
+ (process-put proc :reportingp t)
+ (process-send-string proc (erc-pack-int received-bytes))
+ (process-put proc :reportingp nil))))))
-(defun erc-dcc-get-sentinel (proc _event)
+(defun erc-dcc-get-sentinel (proc event)
"This is the process sentinel for CTCP DCC SEND connections.
It shuts down the connection and notifies the user that the
transfer is complete."
;; FIXME, we should look at EVENT, and also check size.
+ (unless (member event '("connection broken by remote peer\n"
+ "deleted\n"))
+ (lwarn 'erc :warning "Unexpected sentinel event %S for %s"
+ (string-trim-right event) proc))
(with-current-buffer (process-buffer proc)
(delete-process proc)
(setq erc-dcc-list (delete erc-dcc-entry-data erc-dcc-list))
(unless (= (point-min) (point-max))
(erc-dcc-append-contents (current-buffer) erc-dcc-file-name))
- (erc-display-message
- nil 'notice erc-server-process
- 'dcc-get-complete
- ?f erc-dcc-file-name
- ?s (number-to-string erc-dcc-byte-count)
- ?t (format "%.0f"
- (erc-time-diff (plist-get erc-dcc-entry-data :start-time)
- nil))))
- (kill-buffer (process-buffer proc))
- (delete-process proc))
+ (let ((done (= erc-dcc-byte-count (plist-get erc-dcc-entry-data :size))))
+ (erc-display-message
+ nil (if done 'notice '(notice error)) erc-server-process
+ (if done 'dcc-get-complete 'dcc-get-failed)
+ ?v (plist-get erc-dcc-entry-data :size)
+ ?f erc-dcc-file-name
+ ?s (number-to-string erc-dcc-byte-count)
+ ?t (format "%.0f"
+ (erc-time-diff (plist-get erc-dcc-entry-data :start-time)
+ nil))))
+ (kill-buffer)))
;;; CHAT handling
diff --git a/lisp/erc/erc-desktop-notifications.el b/lisp/erc/erc-desktop-notifications.el
index 8ece765ef0d..1897f53dc16 100644
--- a/lisp/erc/erc-desktop-notifications.el
+++ b/lisp/erc/erc-desktop-notifications.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2012-2022 Free Software Foundation, Inc.
;; Author: Julien Danjou <julien@danjou.info>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm
;; This file is part of GNU Emacs.
diff --git a/lisp/erc/erc-ezbounce.el b/lisp/erc/erc-ezbounce.el
index 8f46a1c8dd1..958783f2394 100644
--- a/lisp/erc/erc-ezbounce.el
+++ b/lisp/erc/erc-ezbounce.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2002, 2004, 2006-2022 Free Software Foundation, Inc.
;; Author: Andreas Fuchs <asf@void.at>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm
;; This file is part of GNU Emacs.
diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el
index 492830c3e13..140e7fdfc61 100644
--- a/lisp/erc/erc-fill.el
+++ b/lisp/erc/erc-fill.el
@@ -4,7 +4,7 @@
;; Author: Andreas Fuchs <asf@void.at>
;; Mario Lang <mlang@delysid.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; URL: https://www.emacswiki.org/emacs/ErcFilling
;; This file is part of GNU Emacs.
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index 677f077c2ee..8fef23945d4 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2001-2022 Free Software Foundation, Inc.
;; Author: Jorgen Schaefer <forcer@forcix.cx>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Most code is taken verbatim from erc.el, see there for the original
;; authors.
@@ -137,7 +137,7 @@ Put this function on `erc-insert-post-hook' and/or `erc-send-post-hook'."
(goto-char (point-max))))
(defun erc-move-to-prompt-setup ()
- "Initialize the move-to-prompt module for XEmacs."
+ "Initialize the move-to-prompt module."
(add-hook 'pre-command-hook #'erc-move-to-prompt nil t))
;;; Keep place in unvisited channels
diff --git a/lisp/erc/erc-ibuffer.el b/lisp/erc/erc-ibuffer.el
index f1184ff5eb2..417c0b898a7 100644
--- a/lisp/erc/erc-ibuffer.el
+++ b/lisp/erc/erc-ibuffer.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2002, 2004, 2006-2022 Free Software Foundation, Inc.
;; Author: Mario Lang <mlang@delysid.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm
;; This file is part of GNU Emacs.
diff --git a/lisp/erc/erc-identd.el b/lisp/erc/erc-identd.el
index eab219f4c1e..5c0a2c1a481 100644
--- a/lisp/erc/erc-identd.el
+++ b/lisp/erc/erc-identd.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2003, 2006-2022 Free Software Foundation, Inc.
;; Author: John Wiegley <johnw@gnu.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm
;; This file is part of GNU Emacs.
diff --git a/lisp/erc/erc-imenu.el b/lisp/erc/erc-imenu.el
index f9713032e92..64a8f82b2a9 100644
--- a/lisp/erc/erc-imenu.el
+++ b/lisp/erc/erc-imenu.el
@@ -1,10 +1,9 @@
;;; erc-imenu.el --- Imenu support for ERC -*- lexical-binding: t; -*-
-;; Copyright (C) 2001-2002, 2004, 2006-2022 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 2001-2022 Free Software Foundation, Inc.
;; Author: Mario Lang <mlang@delysid.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm
;; URL: https://www.emacswiki.org/emacs/ErcImenu
diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el
index 175e83f3c90..b9788c192bc 100644
--- a/lisp/erc/erc-join.el
+++ b/lisp/erc/erc-join.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2002-2004, 2006-2022 Free Software Foundation, Inc.
;; Author: Alex Schroeder <alex@gnu.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm, irc
;; URL: https://www.emacswiki.org/emacs/ErcAutoJoin
diff --git a/lisp/erc/erc-lang.el b/lisp/erc/erc-lang.el
index 354203aa090..d059caf5a32 100644
--- a/lisp/erc/erc-lang.el
+++ b/lisp/erc/erc-lang.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2002, 2004, 2006-2022 Free Software Foundation, Inc.
;; Author: Alex Schroeder <alex@gnu.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Old-Version: 1.0.0
;; URL: https://www.emacswiki.org/emacs/ErcLang
;; Keywords: comm
@@ -32,10 +32,8 @@
(require 'erc)
-;; FIXME: It's ISO 639-1, not ISO 638. ISO 638 is for paper, board and pulps.
-;; The Lisp variable should be renamed.
-
-(defvar iso-638-languages
+(define-obsolete-variable-alias 'iso-638-languages 'iso-639-1-languages "29.1")
+(defvar iso-639-1-languages
'(("aa" . "Afar")
("ab" . "Abkhazian")
("af" . "Afrikaans")
@@ -197,12 +195,12 @@ Normungsinstitut (ON), Postfach 130, A-1021 Vienna, Austria.")
(defun language (code)
"Return the language name for the ISO CODE."
(interactive (list (completing-read "ISO language code: "
- iso-638-languages)))
- (message "%s" (cdr (assoc code iso-638-languages))))
+ iso-639-1-languages)))
+ (message "%s" (cdr (assoc code iso-639-1-languages))))
(defun erc-cmd-LANG (language)
"Display the language name for the language code given by LANGUAGE."
- (let ((lang (cdr (assoc language iso-638-languages))))
+ (let ((lang (cdr (assoc language iso-639-1-languages))))
(erc-display-message
nil 'notice 'active
(or lang (concat language ": No such domain"))))
diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el
index c7cd0ceba83..5266b680c38 100644
--- a/lisp/erc/erc-list.el
+++ b/lisp/erc/erc-list.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2008-2022 Free Software Foundation, Inc.
;; Author: Tom Tromey <tromey@redhat.com>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Old-Version: 0.1
;; URL: https://www.emacswiki.org/emacs/ErcList
;; Keywords: comm
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el
index 056701d6200..57093d3fc6c 100644
--- a/lisp/erc/erc-log.el
+++ b/lisp/erc/erc-log.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2003-2022 Free Software Foundation, Inc.
;; Author: Lawrence Mitchell <wence@gmx.li>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; URL: https://www.emacswiki.org/emacs/ErcLogging
;; Keywords: comm, IRC, chat, client, Internet, logging
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index aa78590539b..7c9174ff66a 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2002-2022 Free Software Foundation, Inc.
;; Author: Andreas Fuchs <asf@void.at>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm
;; URL: https://www.emacswiki.org/emacs/ErcMatch
diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el
index fd14d8b0ad8..455a7c3cd2f 100644
--- a/lisp/erc/erc-menu.el
+++ b/lisp/erc/erc-menu.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2001-2002, 2004-2022 Free Software Foundation, Inc.
;; Author: Mario Lang <mlang@delysid.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm, menu
;; This file is part of GNU Emacs.
diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el
index 30bb18344d7..17ed881b12b 100644
--- a/lisp/erc/erc-netsplit.el
+++ b/lisp/erc/erc-netsplit.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2002-2004, 2006-2022 Free Software Foundation, Inc.
;; Author: Mario Lang <mlang@delysid.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm
;; This file is part of GNU Emacs.
diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el
index 9377e701c39..553697ae847 100644
--- a/lisp/erc/erc-networks.el
+++ b/lisp/erc/erc-networks.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2002, 2004-2022 Free Software Foundation, Inc.
;; Author: Mario Lang <mlang@lexx.delysid.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm
;; This file is part of GNU Emacs.
diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el
index a3fe04d392c..911a574b17e 100644
--- a/lisp/erc/erc-notify.el
+++ b/lisp/erc/erc-notify.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2002-2004, 2006-2022 Free Software Foundation, Inc.
;; Author: Mario Lang <mlang@lexx.delysid.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; URL: https://www.emacswiki.org/emacs/ErcNotify
;; Keywords: comm
diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el
index e53178ce63a..087e5a67d07 100644
--- a/lisp/erc/erc-page.el
+++ b/lisp/erc/erc-page.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2002, 2004, 2006-2022 Free Software Foundation, Inc.
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; This file is part of GNU Emacs.
diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el
index 384be500ad7..af8528dbc38 100644
--- a/lisp/erc/erc-pcomplete.el
+++ b/lisp/erc/erc-pcomplete.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2002-2004, 2006-2022 Free Software Foundation, Inc.
;; Author: Sacha Chua <sacha@free.net.ph>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm
;; URL: https://www.emacswiki.org/emacs/ErcCompletion
diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el
index 03153c69988..e46862d6a64 100644
--- a/lisp/erc/erc-replace.el
+++ b/lisp/erc/erc-replace.el
@@ -1,10 +1,9 @@
;;; erc-replace.el --- wash and massage messages inserted into the buffer -*- lexical-binding: t; -*-
-;; Copyright (C) 2001-2002, 2004, 2006-2022 Free Software Foundation,
-;; Inc.
+;; Copyright (C) 2001-2022 Free Software Foundation, Inc.
;; Author: Andreas Fuchs <asf@void.at>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; URL: https://www.emacswiki.org/emacs/ErcReplace
;; Keywords: comm, IRC, client, Internet
diff --git a/lisp/erc/erc-ring.el b/lisp/erc/erc-ring.el
index 0f6851a98a3..9dd1fab6403 100644
--- a/lisp/erc/erc-ring.el
+++ b/lisp/erc/erc-ring.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2001-2004, 2006-2022 Free Software Foundation, Inc.
;; Author: Alex Schroeder <alex@gnu.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm
;; URL: https://www.emacswiki.org/emacs/ErcHistory
diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el
index dcd786411f2..cc5d5701e44 100644
--- a/lisp/erc/erc-services.el
+++ b/lisp/erc/erc-services.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2002-2004, 2006-2022 Free Software Foundation, Inc.
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; URL: https://www.emacswiki.org/emacs/ErcNickserv
;; This file is part of GNU Emacs.
@@ -444,15 +444,12 @@ it returns nil."
(cl-second (assoc network
erc-nickserv-passwords)))))
(when erc-use-auth-source-for-nickserv-password
- (let ((secret (cl-first (auth-source-search
- :max 1 :require '(:secret)
- :host server
- ;; Ensure a string for :port
- :port (format "%s" port)
- :user nick))))
- (when secret
- (let ((passwd (plist-get secret :secret)))
- (if (functionp passwd) (funcall passwd) passwd)))))
+ (auth-source-pick-first-password
+ :require '(:secret)
+ :host server
+ ;; Ensure a string for :port
+ :port (format "%s" port)
+ :user nick))
(when erc-prompt-for-nickserv-password
(read-passwd
(format "NickServ password for %s on %s (RET to cancel): "
diff --git a/lisp/erc/erc-sound.el b/lisp/erc/erc-sound.el
index 86978f9d794..5cae64572f0 100644
--- a/lisp/erc/erc-sound.el
+++ b/lisp/erc/erc-sound.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2002-2003, 2006-2022 Free Software Foundation, Inc.
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; URL: https://www.emacswiki.org/emacs/ErcSound
;; This file is part of GNU Emacs.
diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el
index ead0d374b18..5b06c21612f 100644
--- a/lisp/erc/erc-speedbar.el
+++ b/lisp/erc/erc-speedbar.el
@@ -4,7 +4,7 @@
;; Author: Mario Lang <mlang@delysid.org>
;; Contributor: Eric M. Ludlam <zappo@gnu.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; URL: https://www.emacswiki.org/emacs/ErcSpeedbar
;; This file is part of GNU Emacs.
diff --git a/lisp/erc/erc-spelling.el b/lisp/erc/erc-spelling.el
index d9cfc9bc985..91e6777b7c0 100644
--- a/lisp/erc/erc-spelling.el
+++ b/lisp/erc/erc-spelling.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2005-2022 Free Software Foundation, Inc.
;; Author: Jorgen Schaefer <forcer@forcix.cx>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm, irc
;; URL: https://www.emacswiki.org/emacs/ErcSpelling
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el
index d74a53bc71e..cdab3241c12 100644
--- a/lisp/erc/erc-stamp.el
+++ b/lisp/erc/erc-stamp.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2002-2004, 2006-2022 Free Software Foundation, Inc.
;; Author: Mario Lang <mlang@delysid.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm, timestamp
;; URL: https://www.emacswiki.org/emacs/ErcStamp
diff --git a/lisp/erc/erc-status-sidebar.el b/lisp/erc/erc-status-sidebar.el
index 39430ee6598..8997be00ae0 100644
--- a/lisp/erc/erc-status-sidebar.el
+++ b/lisp/erc/erc-status-sidebar.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2017, 2020-2022 Free Software Foundation, Inc.
;; Author: Andrew Barbarello
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; URL: https://github.com/drewbarbs/erc-status-sidebar
;; This file is part of GNU Emacs.
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index 2196c5411eb..9118d7b994f 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2002-2022 Free Software Foundation, Inc.
;; Author: Mario Lang <mlang@delysid.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm
;; URL: https://www.emacswiki.org/emacs/ErcChannelTracking
diff --git a/lisp/erc/erc-truncate.el b/lisp/erc/erc-truncate.el
index 8a8842bc484..d998718a8fc 100644
--- a/lisp/erc/erc-truncate.el
+++ b/lisp/erc/erc-truncate.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2003-2004, 2006-2022 Free Software Foundation, Inc.
;; Author: Andreas Fuchs <asf@void.at>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; URL: https://www.emacswiki.org/emacs/ErcTruncation
;; Keywords: IRC, chat, client, Internet, logging
diff --git a/lisp/erc/erc-xdcc.el b/lisp/erc/erc-xdcc.el
index ee2a8c936f7..ca8ff6c080b 100644
--- a/lisp/erc/erc-xdcc.el
+++ b/lisp/erc/erc-xdcc.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2003-2004, 2006-2022 Free Software Foundation, Inc.
;; Author: Mario Lang <mlang@delysid.org>
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Keywords: comm
;; This file is part of GNU Emacs.
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 635228e7f55..ff482d49338 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1997-2022 Free Software Foundation, Inc.
;; Author: Alexander L. Belikoff (alexander@belikoff.net)
-;; Maintainer: Amin Bandali <bandali@gnu.org>
+;; Maintainer: Amin Bandali <bandali@gnu.org>, F. Jason Park <jp@neverwas.me>
;; Contributors: Sergey Berezin (sergey.berezin@cs.cmu.edu),
;; Mario Lang (mlang@delysid.org),
;; Alex Schroeder (alex@gnu.org)
@@ -12,7 +12,7 @@
;; David Edmondson (dme@dme.org)
;; Michael Olson (mwolson@gnu.org)
;; Kelvin White (kwhite@gnu.org)
-;; Version: 5.4
+;; Version: 5.4.1
;; Package-Requires: ((emacs "27.1"))
;; Keywords: IRC, chat, client, Internet
;; URL: https://www.gnu.org/software/emacs/erc.html
@@ -69,7 +69,7 @@
(require 'iso8601)
(eval-when-compile (require 'subr-x))
-(defconst erc-version "5.4"
+(defconst erc-version "5.4.1"
"This version of ERC.")
(defvar erc-official-location
@@ -83,7 +83,8 @@
'customize-package-emacs-version-alist
'(ERC ("5.2" . "22.1")
("5.3" . "23.1")
- ("5.4" . "28.1")))
+ ("5.4" . "28.1")
+ ("5.4.1" . "29.1")))
(defgroup erc nil
"Emacs Internet Relay Chat client."
@@ -871,8 +872,8 @@ See `erc-server-flood-margin' for other flood-related parameters.")
;; Script parameters
(defcustom erc-startup-file-list
- (list (concat user-emacs-directory ".ercrc.el")
- (concat user-emacs-directory ".ercrc")
+ (list (locate-user-emacs-file ".ercrc.el")
+ (locate-user-emacs-file ".ercrc")
"~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
"List of files to try for a startup script.
The first existent and readable one will get executed.
@@ -1291,7 +1292,7 @@ Example:
#\\='erc-replace-insert))
((remove-hook \\='erc-insert-modify-hook
#\\='erc-replace-insert)))"
- (declare (doc-string 3))
+ (declare (doc-string 3) (indent defun))
(let* ((sn (symbol-name name))
(mode (intern (format "erc-%s-mode" (downcase sn))))
(group (intern (format "erc-%s" (downcase sn))))
@@ -1478,6 +1479,7 @@ Defaults to the server buffer."
(define-derived-mode erc-mode fundamental-mode "ERC"
"Major mode for Emacs IRC."
+ :interactive nil
(setq local-abbrev-table erc-mode-abbrev-table)
(setq-local next-line-add-newlines nil)
(setq line-move-ignore-invisible t)
@@ -1759,12 +1761,7 @@ nil."
(lambda (bufname)
(let ((buf (if (consp bufname)
(cdr bufname) (get-buffer bufname))))
- (when buf
- (erc--buffer-p buf (lambda () t) proc)
- (with-current-buffer buf
- (and (derived-mode-p 'erc-mode)
- (or (null proc)
- (eq proc erc-server-process))))))))))
+ (and buf (erc--buffer-p buf (lambda () t) proc)))))))
(defun erc-switch-to-buffer (&optional arg)
"Prompt for an ERC buffer to switch to.
When invoked with prefix argument, use all ERC buffers. Without
@@ -2060,19 +2057,12 @@ Returns the buffer for the given server or channel."
;; password stuff
(setq erc-session-password
(or passwd
- (let ((secret
- (plist-get
- (nth 0
- (auth-source-search :host server
- :max 1
- :user nick
- ;; secrets.el wouldn’t accept a number
- :port (if (numberp port) (number-to-string port) port)
- :require '(:secret)))
- :secret)))
- (if (functionp secret)
- (funcall secret)
- secret))))
+ (auth-source-pick-first-password
+ :host server
+ :user nick
+ ;; secrets.el wouldn’t accept a number
+ :port (if (numberp port) (number-to-string port) port)
+ :require '(:secret))))
;; client certificate (only useful if connecting over TLS)
(setq erc-session-client-certificate client-certificate)
;; debug output buffer
@@ -2279,7 +2269,7 @@ Example usage:
(erc-tls :server \"irc.libera.chat\" :port 6697
:client-certificate
- '(\"/home/bandali/my-cert.key\"
+ \\='(\"/home/bandali/my-cert.key\"
\"/home/bandali/my-cert.crt\"))"
(interactive (let ((erc-default-port erc-default-port-tls))
(erc-select-read-args)))
@@ -2403,7 +2393,8 @@ If ARG is non-nil, show the *erc-protocol* buffer."
(concat "This buffer displays all IRC protocol "
"traffic exchanged with servers."))
(erc-make-notice "Kill it to disable logging.")
- (erc-make-notice "Press `t' to toggle."))))
+ (erc-make-notice (substitute-command-keys
+ "Press \\`t' to toggle.")))))
(insert (string-join msg "\r\n")))
(use-local-map (make-sparse-keymap))
(local-set-key (kbd "t") 'erc-toggle-debug-irc-protocol))
@@ -2816,20 +2807,17 @@ present."
(let ((prop-val (erc-get-parsed-vector position)))
(and prop-val (member (erc-response.command prop-val) list))))
-(defvar-local erc-send-input-line-function 'erc-send-input-line)
+(defvar-local erc-send-input-line-function 'erc-send-input-line
+ "Function for sending lines lacking a leading user command.
+When a line typed into a buffer contains an explicit command, like /msg,
+a corresponding handler (here, erc-cmd-MSG) is called. But lines typed
+into a channel or query buffer already have an implicit target and
+command (PRIVMSG). This function is called on such occasions and also
+for special purposes (see erc-dcc.el).")
(defun erc-send-input-line (target line &optional force)
- "Send LINE to TARGET.
-
-See also `erc-server-send'."
- (setq line (format "PRIVMSG %s :%s"
- target
- ;; If the line is empty, we still want to
- ;; send it - i.e. an empty pasted line.
- (if (string= line "\n")
- " \n"
- line)))
- (erc-server-send line force target))
+ "Send LINE to TARGET."
+ (erc-message "PRIVMSG" (concat target " " line) force))
(defun erc-get-arglist (fun)
"Return the argument list of a function without the parens."
@@ -2967,7 +2955,7 @@ Commands for which no erc-cmd-xxx exists, are tunneled through
this function. LINE is sent to the server verbatim, and
therefore has to contain the command itself as well."
(erc-log (format "cmd: DEFAULT: %s" line))
- (erc-server-send (substring line 1))
+ (erc-server-send (string-trim-right (substring line 1) "[\r\n]"))
t)
(defvar erc--read-time-period-history nil)
@@ -3187,16 +3175,12 @@ For a list of user commands (/join /part, ...):
(put 'erc-cmd-HELP 'process-not-needed t)
(defun erc-server-join-channel (server channel &optional secret)
- (let* ((secret (or secret
- (plist-get (nth 0 (auth-source-search
- :max 1
- :host server
- :port "irc"
- :user channel))
- :secret)))
- (password (if (functionp secret)
- (funcall secret)
- secret)))
+ (let ((password
+ (or secret
+ (auth-source-pick-first-password
+ :host server
+ :port "irc"
+ :user channel))))
(erc-log (format "cmd: JOIN: %s" channel))
(erc-server-send (concat "JOIN " channel
(if password
@@ -3608,11 +3592,13 @@ other people should be displayed."
(defun erc-cmd-QUERY (&optional user)
"Open a query with USER.
-The type of query window/frame/etc will depend on the value of
-`erc-query-display'.
-
-If USER is omitted, close the current query buffer if one exists
-- except this is broken now ;-)"
+How the query is displayed (in a new window, frame, etc.) depends
+on the value of `erc-query-display'."
+ ;; FIXME: The doc string used to say at the end:
+ ;; "If USER is omitted, close the current query buffer if one exists
+ ;; - except this is broken now ;-)"
+ ;; Does it make sense to have that functionality? What's wrong with
+ ;; `kill-buffer'? If it makes sense, re-add it. -- SK @ 2021-11-11
(interactive
(list (read-string "Start a query with: ")))
(let ((session-buffer (erc-server-buffer))
@@ -3639,12 +3625,7 @@ If S is non-nil, it will be used as the quit reason."
"Zippy quit message.
If S is non-nil, it will be used as the quit reason."
- (or s
- (if (fboundp 'yow)
- (if (>= emacs-major-version 28)
- (string-replace "\n" "" (yow))
- (replace-regexp-in-string "\n" "" (yow)))
- (erc-quit/part-reason-default))))
+ (or s (erc-quit/part-reason-default)))
(make-obsolete 'erc-quit-reason-zippy "it will be removed." "24.4")
@@ -3668,12 +3649,7 @@ If S is non-nil, it will be used as the part reason."
"Zippy part message.
If S is non-nil, it will be used as the quit reason."
- (or s
- (if (fboundp 'yow)
- (if (>= emacs-major-version 28)
- (string-replace "\n" "" (yow))
- (replace-regexp-in-string "\n" "" (yow)))
- (erc-quit/part-reason-default))))
+ (or s (erc-quit/part-reason-default)))
(make-obsolete 'erc-part-reason-zippy "it will be removed." "24.4")
@@ -3754,13 +3730,17 @@ the message given by REASON."
(setq buffer (current-buffer)))
(with-current-buffer buffer
(setq erc-server-quitting nil)
- (setq erc-server-reconnecting t)
+ (with-suppressed-warnings ((obsolete erc-server-reconnecting))
+ (setq erc-server-reconnecting t))
+ (setq erc--server-reconnecting t)
(setq erc-server-reconnect-count 0)
(setq process (get-buffer-process (erc-server-buffer)))
(if process
(delete-process process)
(erc-server-reconnect))
- (setq erc-server-reconnecting nil)))
+ (with-suppressed-warnings ((obsolete erc-server-reconnecting))
+ (setq erc-server-reconnecting nil))
+ (setq erc--server-reconnecting nil)))
t)
(put 'erc-cmd-RECONNECT 'process-not-needed t)