summaryrefslogtreecommitdiff
path: root/lisp/erc
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/erc')
-rw-r--r--lisp/erc/erc-autoaway.el3
-rw-r--r--lisp/erc/erc-backend.el70
-rw-r--r--lisp/erc/erc-button.el13
-rw-r--r--lisp/erc/erc-capab.el6
-rw-r--r--lisp/erc/erc-compat.el3
-rw-r--r--lisp/erc/erc-dcc.el55
-rw-r--r--lisp/erc/erc-desktop-notifications.el26
-rw-r--r--lisp/erc/erc-ezbounce.el4
-rw-r--r--lisp/erc/erc-fill.el3
-rw-r--r--lisp/erc/erc-identd.el3
-rw-r--r--lisp/erc/erc-imenu.el1
-rw-r--r--lisp/erc/erc-join.el3
-rw-r--r--lisp/erc/erc-list.el3
-rw-r--r--lisp/erc/erc-log.el30
-rw-r--r--lisp/erc/erc-match.el5
-rw-r--r--lisp/erc/erc-menu.el3
-rw-r--r--lisp/erc/erc-netsplit.el3
-rw-r--r--lisp/erc/erc-notify.el3
-rw-r--r--lisp/erc/erc-page.el3
-rw-r--r--lisp/erc/erc-pcomplete.el3
-rw-r--r--lisp/erc/erc-replace.el3
-rw-r--r--lisp/erc/erc-ring.el3
-rw-r--r--lisp/erc/erc-services.el66
-rw-r--r--lisp/erc/erc-sound.el3
-rw-r--r--lisp/erc/erc-speedbar.el7
-rw-r--r--lisp/erc/erc-spelling.el6
-rw-r--r--lisp/erc/erc-stamp.el3
-rw-r--r--lisp/erc/erc-track.el27
-rw-r--r--lisp/erc/erc-truncate.el3
-rw-r--r--lisp/erc/erc-xdcc.el3
-rw-r--r--lisp/erc/erc.el181
31 files changed, 302 insertions, 246 deletions
diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el
index d4fda5c7589..9e224e0b828 100644
--- a/lisp/erc/erc-autoaway.el
+++ b/lisp/erc/erc-autoaway.el
@@ -82,7 +82,7 @@ This is used when `erc-autoaway-idle-method' is 'user."
(unless (erc-autoaway-some-server-buffer)
(remove-hook 'post-command-hook 'erc-autoaway-reset-idle-user)))
-;;;###autoload (autoload 'erc-autoaway-mode "erc-autoaway")
+;;;###autoload(autoload 'erc-autoaway-mode "erc-autoaway")
(define-erc-module autoaway nil
"In ERC autoaway mode, you can be set away automatically.
If `erc-auto-set-away' is set, then you will be set away after
@@ -282,6 +282,7 @@ active server buffer available."
;;; erc-autoaway.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 3e2a9bc4e56..2854cde19cc 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -466,14 +466,18 @@ If this is set to nil, never try to reconnect."
The length is specified in `erc-split-line-length'.
Currently this is called by `erc-send-input'."
- (if (< (length longline)
- erc-split-line-length)
- (list longline)
+ (let ((charset (car (erc-coding-system-for-target nil))))
(with-temp-buffer
(insert longline)
+ ;; The line lengths are in octets, not characters (because these
+ ;; are server protocol limits), so we have to first make the
+ ;; text into bytes, then fold the bytes on "word" boundaries,
+ ;; and then make the bytes into text again.
+ (encode-coding-region (point-min) (point-max) charset)
(let ((fill-column erc-split-line-length))
(fill-region (point-min) (point-max)
nil t))
+ (decode-coding-region (point-min) (point-max) charset)
(split-string (buffer-string) "\n"))))
(defun erc-forward-word ()
@@ -644,22 +648,24 @@ Make sure you are in an ERC buffer when running this."
(erc-log-irc-protocol line nil)
(erc-parse-server-response process line)))))))
-(defsubst erc-server-reconnect-p (event)
+(define-inline 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."
- (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))))
+ (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))))))
(defun erc-process-sentinel-2 (event buffer)
"Called when `erc-process-sentinel-1' has detected an unexpected disconnect."
@@ -838,10 +844,9 @@ Additionally, detect whether the IRC process has hung."
erc-server-last-received-time))
(with-current-buffer buf
(if (and erc-server-send-ping-timeout
- (>
- (erc-time-diff (erc-current-time)
- erc-server-last-received-time)
- erc-server-send-ping-timeout))
+ (time-less-p
+ erc-server-send-ping-timeout
+ (time-since erc-server-last-received-time)))
(progn
;; if the process is hung, kill it
(setq erc-server-timed-out t)
@@ -859,16 +864,15 @@ Additionally, detect whether the IRC process has hung."
See `erc-server-flood-margin' for an explanation of the flood
protection algorithm."
(with-current-buffer buffer
- (let ((now (erc-current-time)))
+ (let ((now (current-time)))
(when erc-server-flood-timer
(erc-cancel-timer erc-server-flood-timer)
(setq erc-server-flood-timer nil))
- (when (< erc-server-flood-last-message
- now)
- (setq erc-server-flood-last-message now))
+ (when (time-less-p erc-server-flood-last-message now)
+ (setq erc-server-flood-last-message (erc-emacs-time-to-erc-time now)))
(while (and erc-server-flood-queue
- (< erc-server-flood-last-message
- (+ now erc-server-flood-margin)))
+ (time-less-p erc-server-flood-last-message
+ (time-add now erc-server-flood-margin)))
(let ((msg (caar erc-server-flood-queue))
(encoding (cdar erc-server-flood-queue)))
(setq erc-server-flood-queue (cdr erc-server-flood-queue)
@@ -1064,8 +1068,8 @@ Hands off to helper functions via `erc-call-hooks'."
erc-server-prevent-duplicates)
(let ((m (erc-response.unparsed parsed-response)))
;; duplicate suppression
- (if (< (or (gethash m erc-server-duplicates) 0)
- (- (erc-current-time) erc-server-duplicate-timeout))
+ (if (time-less-p (or (gethash m erc-server-duplicates) 0)
+ (time-since erc-server-duplicate-timeout))
(erc-call-hooks process parsed-response))
(puthash m (erc-current-time) erc-server-duplicates))
;; Hand off to the relevant handler.
@@ -1441,7 +1445,7 @@ add things to `%s' instead."
"Handle pong messages." nil
(let ((time (string-to-number (erc-response.contents parsed))))
(when (> time 0)
- (setq erc-server-lag (erc-time-diff time (erc-current-time)))
+ (setq erc-server-lag (erc-time-diff time nil))
(when erc-verbose-server-ping
(erc-display-message
parsed 'notice proc 'PONG
@@ -1724,7 +1728,7 @@ See `erc-display-server-message'." nil
(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))))
+ (string-to-number on-since))))
(erc-update-user-nick nick nick nil nil nil
(and time (format "on since %s" time)))
(if time
@@ -1796,7 +1800,7 @@ See `erc-display-server-message'." nil
(define-erc-response-handler (329)
"Channel creation date." nil
(let ((channel (cadr (erc-response.command-args parsed)))
- (time (erc-string-to-emacs-time
+ (time (string-to-number
(nth 2 (erc-response.command-args parsed)))))
(erc-display-message
parsed 'notice (erc-get-buffer channel proc)
@@ -1838,7 +1842,7 @@ See `erc-display-server-message'." nil
(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)))
+ (string-to-number time)))
(erc-update-channel-topic channel
(format "\C-o (%s, %s)" nick time)
'append)
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index a381464b8cd..c8aa887a652 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -49,7 +49,7 @@
"Define how text can be turned into clickable buttons."
:group 'erc)
-;;;###autoload (autoload 'erc-button-mode "erc-button" nil t)
+;;;###autoload(autoload 'erc-button-mode "erc-button" nil t)
(define-erc-module button nil
"This mode buttonizes all messages according to `erc-button-alist'."
((add-hook 'erc-insert-modify-hook 'erc-button-add-buttons 'append)
@@ -121,9 +121,13 @@ longer than `erc-fill-column'."
:group 'erc-button
:type 'string)
-(defcustom erc-button-google-url "http://www.google.com/search?q=%s"
- "URL used to browse Google search references.
+(define-obsolete-variable-alias 'erc-button-google-url
+ 'erc-button-search-url "27.1")
+
+(defcustom erc-button-search-url "http://duckduckgo.com/?q=%s"
+ "URL used to search for a term.
%s is replaced by the search string."
+ :version "27.1"
:group 'erc-button
:type 'string)
@@ -148,7 +152,7 @@ longer than `erc-fill-column'."
("Lisp:\\([a-zA-Z.+-]+\\)" 0 t erc-browse-emacswiki-lisp 1)
("\\bGoogle:\\([^ \t\n\r\f]+\\)"
0 t (lambda (keywords)
- (browse-url (format erc-button-google-url keywords)))
+ (browse-url (format erc-button-search-url keywords)))
1)
("\\brfc[#: ]?\\([0-9]+\\)"
0 t (lambda (num)
@@ -545,5 +549,6 @@ and `apropos' for other symbols."
;;; erc-button.el ends here
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: nil
;; End:
diff --git a/lisp/erc/erc-capab.el b/lisp/erc/erc-capab.el
index fa7c83a194c..210a7736cc0 100644
--- a/lisp/erc/erc-capab.el
+++ b/lisp/erc/erc-capab.el
@@ -90,7 +90,7 @@ character not found in IRC nicknames to avoid confusion."
;;; Define module:
-;;;###autoload (autoload 'erc-capab-identify-mode "erc-capab" nil t)
+;;;###autoload(autoload 'erc-capab-identify-mode "erc-capab" nil t)
(define-erc-module capab-identify nil
"Handle dancer-ircd's CAPAB IDENTIFY-MSG and IDENTIFY-CTCP."
;; append so that `erc-server-parameters' is already set by `erc-server-005'
@@ -207,3 +207,7 @@ PARSED is an `erc-parsed' response struct."
(provide 'erc-capab)
;;; erc-capab.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
+;; End:
diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el
index 243816d4c4d..e724e367ab1 100644
--- a/lisp/erc/erc-compat.el
+++ b/lisp/erc/erc-compat.el
@@ -29,7 +29,7 @@
(require 'format-spec)
-;;;###autoload (autoload 'erc-define-minor-mode "erc-compat")
+;;;###autoload(autoload 'erc-define-minor-mode "erc-compat")
(defalias 'erc-define-minor-mode 'define-minor-mode)
(put 'erc-define-minor-mode 'edebug-form-spec 'define-minor-mode)
@@ -161,6 +161,7 @@ If START or END is negative, it counts from the end."
;;; erc-compat.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index 2b41c8c705b..a6b7532e1f3 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -54,9 +54,11 @@
;;; Code:
(require 'erc)
-(eval-when-compile (require 'pcomplete))
+;; Strictly speaking, should only be needed at compile time.
+;; Require at run-time too to silence compiler.
+(require 'pcomplete)
-;;;###autoload (autoload 'erc-dcc-mode "erc-dcc")
+;;;###autoload(autoload 'erc-dcc-mode "erc-dcc")
(define-erc-module dcc nil
"Provide Direct Client-to-Client support for ERC."
((add-hook 'erc-server-401-functions 'erc-dcc-no-such-nick))
@@ -222,14 +224,6 @@ which is big-endian."
(setq i (1- i)))
str))
-(defconst erc-most-positive-int-bytes
- (ceiling (/ (ceiling (/ (log most-positive-fixnum) (log 2))) 8.0))
- "Maximum number of bytes for a fixnum.")
-
-(defconst erc-most-positive-int-msb
- (lsh most-positive-fixnum (- 0 (* 8 (1- erc-most-positive-int-bytes))))
- "Content of the most significant byte of most-positive-fixnum.")
-
(defun erc-unpack-int (str)
"Unpack a packed string into an integer."
(let ((len (length str)))
@@ -240,16 +234,11 @@ which is big-endian."
(when (> start 0)
(setq str (substring str start))
(setq len (- len start))))
- ;; make sure size is not larger than Emacs can handle
- (when (or (> len (min 4 erc-most-positive-int-bytes))
- (and (eq len erc-most-positive-int-bytes)
- (> (aref str 0) erc-most-positive-int-msb)))
- (error "ERC-DCC (erc-unpack-int): packet to send is too large"))
;; unpack
(let ((num 0)
(count 0))
(while (< count len)
- (setq num (+ num (lsh (aref str (- len count 1)) (* 8 count))))
+ (setq num (+ num (ash (aref str (- len count 1)) (* 8 count))))
(setq count (1+ count)))
num)))
@@ -433,23 +422,23 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc."
(when (fboundp 'make-network-process) '("send"))))
(pcomplete-here
(pcase (intern (downcase (pcomplete-arg 1)))
- (`chat (mapcar (lambda (elt) (plist-get elt :nick))
+ ('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
+ ('close (erc-delete-dups
(mapcar (lambda (elt) (symbol-name (plist-get elt :type)))
erc-dcc-list)))
- (`get (mapcar #'erc-dcc-nick
+ ('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
(pcase (intern (downcase (pcomplete-arg 2)))
- (`get (mapcar (lambda (elt) (plist-get elt :file))
+ ('get (mapcar (lambda (elt) (plist-get elt :file))
(erc-remove-if-not
#'(lambda (elt)
(and (eq (plist-get elt :type) 'GET)
@@ -457,13 +446,13 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc."
(plist-get elt :nick))
(pcomplete-arg 1))))
erc-dcc-list)))
- (`close (mapcar #'erc-dcc-nick
+ ('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)))))
+ ('send (pcomplete-entries)))))
(defun erc-dcc-do-CHAT-command (proc &optional nick)
(when nick
@@ -649,9 +638,10 @@ that subcommand."
"\"\\(\\(.*?\\(\\\\\"\\)?\\)+?\\)\"\\|\\([^ ]+\\)"
"\\) \\([0-9]+\\) \\([0-9]+\\) *\\([0-9]*\\)"))
-(defsubst erc-dcc-unquote-filename (filename)
- (erc-replace-regexp-in-string "\\\\\\\\" "\\"
- (erc-replace-regexp-in-string "\\\\\"" "\"" filename t t) t t))
+(define-inline erc-dcc-unquote-filename (filename)
+ (inline-quote
+ (erc-replace-regexp-in-string "\\\\\\\\" "\\"
+ (erc-replace-regexp-in-string "\\\\\"" "\"" ,filename t t) t t)))
(defun erc-dcc-handle-ctcp-send (proc query nick login host to)
"This is called if a CTCP DCC SEND subcommand is sent to the client.
@@ -780,8 +770,8 @@ unconfirmed."
:group 'erc-dcc
:type '(choice (const nil) integer))
-(defsubst erc-dcc-get-parent (proc)
- (plist-get (erc-dcc-member :peer proc) :parent))
+(define-inline erc-dcc-get-parent (proc)
+ (inline-quote (plist-get (erc-dcc-member :peer ,proc) :parent)))
(defun erc-dcc-send-block (proc)
"Send one block of data.
@@ -1034,7 +1024,7 @@ transfer is complete."
?s (number-to-string erc-dcc-byte-count)
?t (format "%.0f"
(erc-time-diff (plist-get erc-dcc-entry-data :start-time)
- (erc-current-time)))))
+ nil))))
(kill-buffer (process-buffer proc))
(delete-process proc))
@@ -1094,14 +1084,14 @@ Possible values are: ask, auto, ignore."
(pcomplete-here '("auto" "ask" "ignore")))
(defalias 'pcomplete/erc-mode/SREQ 'pcomplete/erc-mode/CREQ)
+(define-obsolete-variable-alias 'erc-dcc-chat-filter-hook
+ 'erc-dcc-chat-filter-functions "24.3")
+
(defvar erc-dcc-chat-filter-functions '(erc-dcc-chat-parse-output)
"Abnormal hook run after parsing (and maybe inserting) a DCC message.
Each function is called with two arguments: the ERC process and
the unprocessed output.")
-(define-obsolete-variable-alias 'erc-dcc-chat-filter-hook
- 'erc-dcc-chat-filter-functions "24.3")
-
(defvar erc-dcc-chat-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "RET") 'erc-send-current-line)
@@ -1260,5 +1250,6 @@ other client."
;;; erc-dcc.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: nil
;; End:
diff --git a/lisp/erc/erc-desktop-notifications.el b/lisp/erc/erc-desktop-notifications.el
index 66f27d92ebb..41b7420320c 100644
--- a/lisp/erc/erc-desktop-notifications.el
+++ b/lisp/erc/erc-desktop-notifications.el
@@ -1,4 +1,4 @@
-;; erc-desktop-notifications.el -- Send notification on PRIVMSG or mentions
+;; erc-desktop-notifications.el -- Send notification on PRIVMSG or mentions -*- lexical-binding:t -*-
;; Copyright (C) 2012-2019 Free Software Foundation, Inc.
@@ -59,13 +59,19 @@
This will replace the last notification sent with this function."
(dbus-ignore-errors
(setq erc-notifications-last-notification
- (notifications-notify :bus erc-notifications-bus
- :title (xml-escape-string nick)
- :body (xml-escape-string msg)
- :replaces-id erc-notifications-last-notification
- :app-icon erc-notifications-icon))))
-
-(defun erc-notifications-PRIVMSG (proc parsed)
+ (let ((channel (current-buffer)))
+ (notifications-notify :bus erc-notifications-bus
+ :title (format "%s in %s"
+ (xml-escape-string nick)
+ channel)
+ :body (xml-escape-string msg)
+ :replaces-id erc-notifications-last-notification
+ :app-icon erc-notifications-icon
+ :actions '("default" "Switch to buffer")
+ :on-action (lambda (&rest _)
+ (pop-to-buffer channel)))))))
+
+(defun erc-notifications-PRIVMSG (_proc parsed)
(let ((nick (car (erc-parse-user (erc-response.sender parsed))))
(target (car (erc-response.command-args parsed)))
(msg (erc-response.contents parsed)))
@@ -98,3 +104,7 @@ This will replace the last notification sent with this function."
(provide 'erc-desktop-notifications)
;;; erc-desktop-notifications.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
+;; End:
diff --git a/lisp/erc/erc-ezbounce.el b/lisp/erc/erc-ezbounce.el
index 520ee2ddf17..a2c9336826a 100644
--- a/lisp/erc/erc-ezbounce.el
+++ b/lisp/erc/erc-ezbounce.el
@@ -175,3 +175,7 @@ in the alist is nil, prompt for the appropriate values."
(provide 'erc-ezbounce)
;;; erc-ezbounce.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
+;; End:
diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el
index 36187256dc7..934b52a938c 100644
--- a/lisp/erc/erc-fill.el
+++ b/lisp/erc/erc-fill.el
@@ -37,7 +37,7 @@
"Filling means to reformat long lines in different ways."
:group 'erc)
-;;;###autoload (autoload 'erc-fill-mode "erc-fill" nil t)
+;;;###autoload(autoload 'erc-fill-mode "erc-fill" nil t)
(erc-define-minor-mode erc-fill-mode
"Toggle ERC fill mode.
With a prefix argument ARG, enable ERC fill mode if ARG is
@@ -193,5 +193,6 @@ You can put this on `erc-insert-modify-hook' and/or `erc-send-modify-hook'."
;;; erc-fill.el ends here
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: nil
;; End:
diff --git a/lisp/erc/erc-identd.el b/lisp/erc/erc-identd.el
index 385410496a5..d95e0eac0c7 100644
--- a/lisp/erc/erc-identd.el
+++ b/lisp/erc/erc-identd.el
@@ -55,7 +55,7 @@ This can be either a string or a number."
(integer :tag "Port number")
(string :tag "Port string")))
-;;;###autoload (autoload 'erc-identd-mode "erc-identd")
+;;;###autoload(autoload 'erc-identd-mode "erc-identd")
(define-erc-module identd nil
"This mode launches an identd server on port 8113."
((add-hook 'erc-connect-pre-hook 'erc-identd-quickstart)
@@ -115,6 +115,7 @@ The default port is specified by `erc-identd-port'."
;;; erc-identd.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-imenu.el b/lisp/erc/erc-imenu.el
index be8e0b07235..08f52f13647 100644
--- a/lisp/erc/erc-imenu.el
+++ b/lisp/erc/erc-imenu.el
@@ -131,6 +131,7 @@ Don't rely on this function, read it first!"
;;; erc-imenu.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el
index 83f7a045575..896521eaf0a 100644
--- a/lisp/erc/erc-join.el
+++ b/lisp/erc/erc-join.el
@@ -39,7 +39,7 @@
"Enable autojoining."
:group 'erc)
-;;;###autoload (autoload 'erc-autojoin-mode "erc-join" nil t)
+;;;###autoload(autoload 'erc-autojoin-mode "erc-join" nil t)
(define-erc-module autojoin nil
"Makes ERC autojoin on connects and reconnects."
((add-hook 'erc-after-connect 'erc-autojoin-channels)
@@ -215,6 +215,7 @@ This function is run from `erc-nickserv-identified-hook'."
;;; erc-join.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el
index f354ff5ae09..d8d9e17c95a 100644
--- a/lisp/erc/erc-list.el
+++ b/lisp/erc/erc-list.el
@@ -55,7 +55,7 @@
(defvar erc-list-server-buffer nil)
;; Define module:
-;;;###autoload (autoload 'erc-list-mode "erc-list")
+;;;###autoload(autoload 'erc-list-mode "erc-list")
(define-erc-module list nil
"List channels nicely in a separate buffer."
((remove-hook 'erc-server-321-functions 'erc-server-321-message)
@@ -225,6 +225,7 @@ to RFC and send the LIST header (#321) at start of list transmission."
;;; erc-list.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el
index 59d157576dc..4153f5c57bd 100644
--- a/lisp/erc/erc-log.el
+++ b/lisp/erc/erc-log.el
@@ -122,7 +122,7 @@ custom function which returns the directory part and set
(function :tag "Other function")))
(defcustom erc-truncate-buffer-on-save nil
- "Truncate any ERC (channel, query, server) buffer when it is saved."
+ "Erase the contents of any ERC (channel, query, server) buffer when it is saved."
:group 'erc-log
:type 'boolean)
@@ -215,7 +215,7 @@ The function should take one argument, which is the text to filter."
(const :tag "No filtering" nil)))
-;;;###autoload (autoload 'erc-log-mode "erc-log" nil t)
+;;;###autoload(autoload 'erc-log-mode "erc-log" nil t)
(define-erc-module log nil
"Automatically logs things you receive on IRC into files.
Files are stored in `erc-log-channels-directory'; file name
@@ -344,18 +344,19 @@ If BUFFER is nil, the value of `current-buffer' is used.
This is determined by `erc-generate-log-file-name-function'.
The result is converted to lowercase, as IRC is case-insensitive"
(unless buffer (setq buffer (current-buffer)))
- (let ((target (or (buffer-name buffer) (erc-default-target)))
- (nick (erc-current-nick))
- (server erc-session-server)
- (port erc-session-port))
- (expand-file-name
- (erc-log-standardize-name
- (funcall erc-generate-log-file-name-function
- buffer target nick server port))
- (if (functionp erc-log-channels-directory)
- (funcall erc-log-channels-directory
- buffer target nick server port)
- erc-log-channels-directory))))
+ (with-current-buffer buffer
+ (let ((target (or (buffer-name buffer) (erc-default-target)))
+ (nick (erc-current-nick))
+ (server erc-session-server)
+ (port erc-session-port))
+ (expand-file-name
+ (erc-log-standardize-name
+ (funcall erc-generate-log-file-name-function
+ buffer target nick server port))
+ (if (functionp erc-log-channels-directory)
+ (funcall erc-log-channels-directory
+ buffer target nick server port)
+ erc-log-channels-directory)))))
(defun erc-generate-log-file-name-with-date (buffer &rest ignore)
"This function computes a short log file name.
@@ -456,6 +457,7 @@ You can save every individual message by putting this function on
;;; erc-log.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index 250266c82e6..cc4b4a88f11 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -44,7 +44,7 @@ Group containing all things concerning pattern matching in ERC
messages."
:group 'erc)
-;;;###autoload (autoload 'erc-match-mode "erc-match")
+;;;###autoload(autoload 'erc-match-mode "erc-match")
(define-erc-module match nil
"This mode checks whether messages match certain patterns. If so,
they are hidden or highlighted. This is controlled via the variables
@@ -601,7 +601,7 @@ See `erc-log-match-format'."
'timestamp))))
(away-time (erc-emacs-time-to-erc-time (erc-away-time))))
(when (and away-time last-msg-time
- (erc-time-gt last-msg-time away-time))
+ (time-less-p away-time last-msg-time))
(erc-display-message
nil 'notice 'active
(format "You have logged messages waiting in \"%s\"."
@@ -648,6 +648,7 @@ This function is meant to be called from `erc-text-matched-hook'."
;;; erc-match.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el
index 5696306342c..8173829797b 100644
--- a/lisp/erc/erc-menu.el
+++ b/lisp/erc/erc-menu.el
@@ -107,7 +107,7 @@
"Internal variable used to keep track of whether we've defined the
ERC menu yet.")
-;;;###autoload (autoload 'erc-menu-mode "erc-menu" nil t)
+;;;###autoload(autoload 'erc-menu-mode "erc-menu" nil t)
(define-erc-module menu nil
"Enable a menu in ERC buffers."
((unless erc-menu-defined
@@ -148,6 +148,7 @@ ERC menu yet.")
;;; erc-menu.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el
index a2f271f2f4b..87c3a61b663 100644
--- a/lisp/erc/erc-netsplit.el
+++ b/lisp/erc/erc-netsplit.el
@@ -38,7 +38,7 @@ netsplit happens, and filters the QUIT messages. It also keeps
track of netsplits, so that it can filter the JOIN messages on a netjoin too."
:group 'erc)
-;;;###autoload (autoload 'erc-netsplit-mode "erc-netsplit")
+;;;###autoload(autoload 'erc-netsplit-mode "erc-netsplit")
(define-erc-module netsplit nil
"This mode hides quit/join messages if a netsplit occurs."
((erc-netsplit-install-message-catalogs)
@@ -205,6 +205,7 @@ join from that split has been detected or not.")
;;; erc-netsplit.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el
index 19045a6d1bf..45dae899900 100644
--- a/lisp/erc/erc-notify.el
+++ b/lisp/erc/erc-notify.el
@@ -92,7 +92,7 @@ strings."
(notify_on . "Detected %n on IRC network %m")
(notify_off . "%n has left IRC network %m"))))
-;;;###autoload (autoload 'erc-notify-mode "erc-notify" nil t)
+;;;###autoload(autoload 'erc-notify-mode "erc-notify" nil t)
(define-erc-module notify nil
"Periodically check for the online status of certain users and report
changes."
@@ -253,6 +253,7 @@ with args, toggle notify status of people."
;;; erc-notify.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el
index 7f1378c7243..cb57883ae6f 100644
--- a/lisp/erc/erc-page.el
+++ b/lisp/erc/erc-page.el
@@ -30,7 +30,7 @@
(require 'erc)
-;;;###autoload (autoload 'erc-page-mode "erc-page")
+;;;###autoload(autoload 'erc-page-mode "erc-page")
(define-erc-module page ctcp-page
"Process CTCP PAGE requests from IRC."
nil nil)
@@ -107,6 +107,7 @@ receive pages if `erc-page-mode' is on."
;;; erc-page.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el
index a67787fb6f9..dd2da85d0e8 100644
--- a/lisp/erc/erc-pcomplete.el
+++ b/lisp/erc/erc-pcomplete.el
@@ -60,7 +60,7 @@ the most recent speakers are listed first."
:group 'erc-pcomplete
:type 'boolean)
-;;;###autoload (autoload 'erc-completion-mode "erc-pcomplete" nil t)
+;;;###autoload(autoload 'erc-completion-mode "erc-pcomplete" nil t)
(define-erc-module pcomplete Completion
"In ERC Completion mode, the TAB key does completion whenever possible."
((add-hook 'erc-mode-hook 'pcomplete-erc-setup)
@@ -284,5 +284,6 @@ up to where point is right now."
;;; erc-pcomplete.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: nil
;; End:
diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el
index 80ff99cc975..2e0e54a030f 100644
--- a/lisp/erc/erc-replace.el
+++ b/lisp/erc/erc-replace.el
@@ -77,7 +77,7 @@ It replaces text according to `erc-replace-alist'."
(eval to))))))
erc-replace-alist))
-;;;###autoload (autoload 'erc-replace-mode "erc-replace")
+;;;###autoload(autoload 'erc-replace-mode "erc-replace")
(define-erc-module replace nil
"This mode replaces incoming text according to `erc-replace-alist'."
((add-hook 'erc-insert-modify-hook
@@ -90,6 +90,7 @@ It replaces text according to `erc-replace-alist'."
;;; erc-replace.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-ring.el b/lisp/erc/erc-ring.el
index 8ec9f8ffa25..5459d8b01e5 100644
--- a/lisp/erc/erc-ring.el
+++ b/lisp/erc/erc-ring.el
@@ -42,7 +42,7 @@
"An input ring for ERC."
:group 'erc)
-;;;###autoload (autoload 'erc-ring-mode "erc-ring" nil t)
+;;;###autoload(autoload 'erc-ring-mode "erc-ring" nil t)
(define-erc-module ring nil
"Stores input in a ring so that previous commands and messages can
be recalled using M-p and M-n."
@@ -146,5 +146,6 @@ containing a password."
;;; erc-ring.el ends here
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: nil
;; End:
diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el
index b6bceff205c..886ba60eb47 100644
--- a/lisp/erc/erc-services.el
+++ b/lisp/erc/erc-services.el
@@ -1,4 +1,4 @@
-;;; erc-services.el --- Identify to NickServ
+;;; erc-services.el --- Identify to NickServ -*- lexical-binding:t -*-
;; Copyright (C) 2002-2004, 2006-2019 Free Software Foundation, Inc.
@@ -89,7 +89,7 @@ Possible settings are:.
latter.
nil - Disables automatic Nickserv identification.
-You can also use M-x erc-nickserv-identify-mode to change modes."
+You can also use \\[erc-nickserv-identify-mode] to change modes."
:group 'erc-services
:type '(choice (const autodetect)
(const nick-change)
@@ -101,7 +101,7 @@ You can also use M-x erc-nickserv-identify-mode to change modes."
(when (featurep 'erc-services)
(erc-nickserv-identify-mode val))))
-;;;###autoload (autoload 'erc-services-mode "erc-services" nil t)
+;;;###autoload(autoload 'erc-services-mode "erc-services" nil t)
(define-erc-module services nickserv
"This mode automates communication with services."
((erc-nickserv-identify-mode erc-nickserv-identify-mode))
@@ -214,7 +214,7 @@ Example of use:
"identify" nil nil nil)
(Azzurra
"NickServ!service@azzurra.org"
- "/ns\\s-IDENTIFY\\s-password"
+ "\^B/ns\\s-IDENTIFY\\s-password\^B"
"NickServ"
"IDENTIFY" nil nil nil)
(BitlBee
@@ -223,7 +223,7 @@ Example of use:
"identify" nil nil nil)
(BRASnet
"NickServ!services@brasnet.org"
- "/NickServ\\s-IDENTIFY\\s-senha"
+ "\^B/NickServ\\s-IDENTIFY\\s-\^_senha\^_\^B"
"NickServ"
"IDENTIFY" nil "" nil)
(DALnet
@@ -262,7 +262,7 @@ Example of use:
nil
"NickServ"
"IDENTIFY" nil nil
- "You\\s-are\\s-successfully\\s-identified\\s-as\\s-")
+ "You\\s-are\\s-successfully\\s-identified\\s-as\\s-\^B")
(Rizon
"NickServ!service@rizon.net"
"This\\s-nickname\\s-is\\s-registered\\s-and\\s-protected."
@@ -275,7 +275,7 @@ Example of use:
"auth" t nil nil)
(SlashNET
"NickServ!services@services.slashnet.org"
- "/msg\\s-NickServ\\s-IDENTIFY\\s-password"
+ "/msg\\s-NickServ\\s-IDENTIFY\\s-\^_password"
"NickServ@services.slashnet.org"
"IDENTIFY" nil nil nil))
"Alist of NickServer details, sorted by network.
@@ -312,26 +312,33 @@ The last two elements are optional."
(const :tag "Do not try to detect success" nil)))))
-(defsubst erc-nickserv-alist-sender (network &optional entry)
- (nth 1 (or entry (assoc network erc-nickserv-alist))))
+(define-inline erc-nickserv-alist-sender (network &optional entry)
+ (inline-letevals (network entry)
+ (inline-quote (nth 1 (or ,entry (assoc ,network erc-nickserv-alist))))))
-(defsubst erc-nickserv-alist-regexp (network &optional entry)
- (nth 2 (or entry (assoc network erc-nickserv-alist))))
+(define-inline erc-nickserv-alist-regexp (network &optional entry)
+ (inline-letevals (network entry)
+ (inline-quote (nth 2 (or ,entry (assoc ,network erc-nickserv-alist))))))
-(defsubst erc-nickserv-alist-nickserv (network &optional entry)
- (nth 3 (or entry (assoc network erc-nickserv-alist))))
+(define-inline erc-nickserv-alist-nickserv (network &optional entry)
+ (inline-letevals (network entry)
+ (inline-quote (nth 3 (or ,entry (assoc ,network erc-nickserv-alist))))))
-(defsubst erc-nickserv-alist-ident-keyword (network &optional entry)
- (nth 4 (or entry (assoc network erc-nickserv-alist))))
+(define-inline erc-nickserv-alist-ident-keyword (network &optional entry)
+ (inline-letevals (network entry)
+ (inline-quote (nth 4 (or ,entry (assoc ,network erc-nickserv-alist))))))
-(defsubst erc-nickserv-alist-use-nick-p (network &optional entry)
- (nth 5 (or entry (assoc network erc-nickserv-alist))))
+(define-inline erc-nickserv-alist-use-nick-p (network &optional entry)
+ (inline-letevals (network entry)
+ (inline-quote (nth 5 (or ,entry (assoc ,network erc-nickserv-alist))))))
-(defsubst erc-nickserv-alist-ident-command (network &optional entry)
- (nth 6 (or entry (assoc network erc-nickserv-alist))))
+(define-inline erc-nickserv-alist-ident-command (network &optional entry)
+ (inline-letevals (network entry)
+ (inline-quote (nth 6 (or ,entry (assoc ,network erc-nickserv-alist))))))
-(defsubst erc-nickserv-alist-identified-regexp (network &optional entry)
- (nth 7 (or entry (assoc network erc-nickserv-alist))))
+(define-inline erc-nickserv-alist-identified-regexp (network &optional entry)
+ (inline-letevals (network entry)
+ (inline-quote (nth 7 (or ,entry (assoc ,network erc-nickserv-alist))))))
;; Functions:
@@ -341,7 +348,7 @@ Hooks are called with arguments (NETWORK NICK)."
:group 'erc-services
:type 'hook)
-(defun erc-nickserv-identification-autodetect (proc parsed)
+(defun erc-nickserv-identification-autodetect (_proc parsed)
"Check for NickServ's successful identification notice.
Make sure it is the real NickServ for this network and that it has
specifically confirmed a successful identification attempt.
@@ -361,7 +368,7 @@ If this is the case, run `erc-nickserv-identified-hook'."
(run-hook-with-args 'erc-nickserv-identified-hook network nick)
nil)))
-(defun erc-nickserv-identify-autodetect (proc parsed)
+(defun erc-nickserv-identify-autodetect (_proc parsed)
"Identify to NickServ when an identify request is received.
Make sure it is the real NickServ for this network.
If `erc-prompt-for-nickserv-password' is non-nil, prompt the user for the
@@ -383,7 +390,7 @@ password for this nickname, otherwise try to send it automatically."
(erc-nickserv-call-identify-function nick)
nil))))
-(defun erc-nickserv-identify-on-connect (server nick)
+(defun erc-nickserv-identify-on-connect (_server nick)
"Identify to Nickserv after the connection to the server is established."
(unless (or (and (null erc-nickserv-passwords)
(null erc-prompt-for-nickserv-password))
@@ -391,7 +398,7 @@ password for this nickname, otherwise try to send it automatically."
(erc-nickserv-alist-regexp (erc-network))))
(erc-nickserv-call-identify-function nick)))
-(defun erc-nickserv-identify-on-nick-change (nick old-nick)
+(defun erc-nickserv-identify-on-nick-change (nick _old-nick)
"Identify to Nickserv whenever your nick changes."
(unless (or (and (null erc-nickserv-passwords)
(null erc-prompt-for-nickserv-password))
@@ -400,9 +407,9 @@ password for this nickname, otherwise try to send it automatically."
(erc-nickserv-call-identify-function nick)))
(defun erc-nickserv-call-identify-function (nickname)
- "Call `erc-nickserv-identify' interactively or run it with NICKNAME's
-password.
-The action is determined by the value of `erc-prompt-for-nickserv-password'."
+ "Call `erc-nickserv-identify'.
+Either call it interactively or run it with NICKNAME's password,
+depending on the value of `erc-prompt-for-nickserv-password'."
(if erc-prompt-for-nickserv-password
(call-interactively 'erc-nickserv-identify)
(when erc-nickserv-passwords
@@ -411,6 +418,8 @@ The action is determined by the value of `erc-prompt-for-nickserv-password'."
(nth 1 (assoc (erc-network)
erc-nickserv-passwords))))))))
+(defvar erc-auto-discard-away)
+
;;;###autoload
(defun erc-nickserv-identify (password)
"Send an \"identify <PASSWORD>\" message to NickServ.
@@ -444,6 +453,7 @@ When called interactively, read the password using `read-passwd'."
;;; erc-services.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-sound.el b/lisp/erc/erc-sound.el
index 984ff49d43f..34f7ce62c74 100644
--- a/lisp/erc/erc-sound.el
+++ b/lisp/erc/erc-sound.el
@@ -46,7 +46,7 @@
(require 'erc)
-;;;###autoload (autoload 'erc-sound-mode "erc-sound")
+;;;###autoload(autoload 'erc-sound-mode "erc-sound")
(define-erc-module sound ctcp-sound
"In ERC sound mode, the client will respond to CTCP SOUND requests
and play sound files as requested."
@@ -145,6 +145,7 @@ See also `play-sound-file'."
;;; erc-sound.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el
index 0324383300b..0a1e38fe248 100644
--- a/lisp/erc/erc-speedbar.el
+++ b/lisp/erc/erc-speedbar.el
@@ -140,7 +140,7 @@ This will add a speedbar major display mode."
t))))
(defun erc-speedbar-expand-server (text server indent)
- (cond ((string-match "+" text)
+ (cond ((string-match "\\+" text)
(speedbar-change-expand-button-char ?-)
(if (speedbar-with-writable
(save-excursion
@@ -185,7 +185,7 @@ This will add a speedbar major display mode."
"For the line matching TEXT, in CHANNEL, expand or contract a line.
INDENT is the current indentation level."
(cond
- ((string-match "+" text)
+ ((string-match "\\+" text)
(speedbar-change-expand-button-char ?-)
(speedbar-with-writable
(save-excursion
@@ -285,7 +285,7 @@ is only done when the channel is actually expanded already."
(erc-speedbar-expand-channel "+" buffer 1)))))
(defun erc-speedbar-expand-user (text token indent)
- (cond ((string-match "+" text)
+ (cond ((string-match "\\+" text)
(speedbar-change-expand-button-char ?-)
(speedbar-with-writable
(save-excursion
@@ -361,6 +361,7 @@ The INDENT level is ignored."
;;; erc-speedbar.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-spelling.el b/lisp/erc/erc-spelling.el
index cc519b28da5..69a83fa032b 100644
--- a/lisp/erc/erc-spelling.el
+++ b/lisp/erc/erc-spelling.el
@@ -33,7 +33,7 @@
(require 'erc)
(require 'flyspell)
-;;;###autoload (autoload 'erc-spelling-mode "erc-spelling" nil t)
+;;;###autoload(autoload 'erc-spelling-mode "erc-spelling" nil t)
(define-erc-module spelling nil
"Enable flyspell mode in ERC buffers."
;; Use erc-connect-pre-hook instead of erc-mode-hook as pre-hook is
@@ -109,3 +109,7 @@ The cadr is the beginning and the caddr is the end."
(provide 'erc-spelling)
;;; erc-spelling.el ends here
+
+;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
+;; End:
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el
index 4495883734f..860fdbb77ce 100644
--- a/lisp/erc/erc-stamp.el
+++ b/lisp/erc/erc-stamp.el
@@ -158,7 +158,7 @@ from entering them and instead jump over them."
"ERC timestamp face."
:group 'erc-faces)
-;;;###autoload (autoload 'erc-timestamp-mode "erc-stamp" nil t)
+;;;###autoload(autoload 'erc-timestamp-mode "erc-stamp" nil t)
(define-erc-module stamp timestamp
"This mode timestamps messages in the channel buffers."
((add-hook 'erc-mode-hook #'erc-munge-invisibility-spec)
@@ -417,6 +417,7 @@ enabled when the message was inserted."
;;; erc-stamp.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index d53668e2666..e51e6056fb9 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -495,9 +495,6 @@ START is the minimum length of the name used."
;;;###autoload
(define-minor-mode erc-track-minor-mode
"Toggle mode line display of ERC activity (ERC Track minor mode).
-With a prefix argument ARG, enable ERC Track minor mode if ARG is
-positive, and disable it otherwise. If called from Lisp, enable
-the mode if ARG is omitted or nil.
ERC Track minor mode is a global minor mode. It exists for the
sole purpose of providing the C-c C-SPC and C-c C-@ keybindings.
@@ -542,7 +539,7 @@ keybindings will not do anything useful."
;;; Module
-;;;###autoload (autoload 'erc-track-mode "erc-track" nil t)
+;;;###autoload(autoload 'erc-track-mode "erc-track" nil t)
(define-erc-module track nil
"This mode tracks ERC channel buffers with activity."
;; Enable:
@@ -633,8 +630,8 @@ only consider active buffers visible.")
(if erc-track-when-inactive
(when erc-buffer-activity; could be nil
(and (erc-track-get-buffer-window buffer erc-track-visibility)
- (<= (erc-time-diff erc-buffer-activity (erc-current-time))
- erc-buffer-activity-timeout)))
+ (not (time-less-p erc-buffer-activity-timeout
+ (erc-time-diff erc-buffer-activity nil)))))
(erc-track-get-buffer-window buffer erc-track-visibility)))
;;; Tracking the channel modifications
@@ -643,7 +640,7 @@ only consider active buffers visible.")
(unless (minibuffer-window-active-p (minibuffer-window))
;; delay this until command has finished to make sure window is
;; actually visible before clearing activity
- (add-hook 'post-command-hook 'erc-modified-channels-update)))
+ (erc-modified-channels-update)))
(defvar erc-modified-channels-update-inside nil
"Variable to prevent running `erc-modified-channels-update' multiple
@@ -672,8 +669,7 @@ ARGS are ignored."
(erc-modified-channels-remove-buffer buffer))))
erc-modified-channels-alist)
(when removed-channel
- (erc-modified-channels-display)))
- (remove-hook 'post-command-hook 'erc-modified-channels-update)))
+ (erc-modified-channels-display)))))
(defvar erc-track-mouse-face (if (featurep 'xemacs)
'modeline-mousable
@@ -932,14 +928,14 @@ relative to `erc-track-switch-direction'"
offset)
(when (< arg 0)
(setq dir (pcase dir
- (`oldest 'newest)
- (`newest 'oldest)
- (`mostactive 'leastactive)
- (`leastactive 'mostactive)
- (`importance 'oldest)))
+ ('oldest 'newest)
+ ('newest 'oldest)
+ ('mostactive 'leastactive)
+ ('leastactive 'mostactive)
+ ('importance 'oldest)))
(setq arg (- arg)))
(setq offset (pcase dir
- ((or `oldest `leastactive)
+ ((or 'oldest 'leastactive)
(- (length erc-modified-channels-alist) arg))
(_ (1- arg))))
;; normalize out of range user input
@@ -974,6 +970,7 @@ switch back to the last non-ERC buffer visited. Next is defined by
;;; erc-track.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-truncate.el b/lisp/erc/erc-truncate.el
index 7ff99c8dc4f..04174295520 100644
--- a/lisp/erc/erc-truncate.el
+++ b/lisp/erc/erc-truncate.el
@@ -43,7 +43,7 @@ Used only when auto-truncation is enabled.
:group 'erc-truncate
:type 'integer)
-;;;###autoload (autoload 'erc-truncate-mode "erc-truncate" nil t)
+;;;###autoload(autoload 'erc-truncate-mode "erc-truncate" nil t)
(define-erc-module truncate nil
"Truncate a query buffer if it gets too large.
This prevents the query buffer from getting too large, which can
@@ -112,6 +112,7 @@ Meant to be used in hooks, like `erc-insert-post-hook'."
;;; erc-truncate.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc-xdcc.el b/lisp/erc/erc-xdcc.el
index 07e7ac1be16..162b22e15c6 100644
--- a/lisp/erc/erc-xdcc.el
+++ b/lisp/erc/erc-xdcc.el
@@ -61,7 +61,7 @@ being evaluated and should return strings."
:group 'erc-dcc
:type '(repeat (repeat :tag "Message" (choice string sexp))))
-;;;###autoload (autoload 'erc-xdcc-mode "erc-xdcc")
+;;;###autoload(autoload 'erc-xdcc-mode "erc-xdcc")
(define-erc-module xdcc nil
"Act as an XDCC file-server."
nil nil)
@@ -133,6 +133,7 @@ being evaluated and should return strings."
;;; erc-xdcc.el ends here
;;
;; Local Variables:
+;; generated-autoload-file: "erc-loaddefs.el"
;; indent-tabs-mode: t
;; tab-width: 8
;; End:
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index feee89d7fea..d1fa5c7f120 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -62,17 +62,17 @@
;;; History:
;;
-(defconst erc-version-string (format "\C-bERC\C-b (IRC client for Emacs %s)" emacs-version)
- "ERC version. This is used by function `erc-version'.")
-
;;; Code:
+(load "erc-loaddefs" nil t)
+
(eval-when-compile (require 'cl-lib))
(require 'font-lock)
(require 'pp)
(require 'thingatpt)
(require 'auth-source)
(require 'erc-compat)
+(eval-when-compile (require 'subr-x))
(defvar erc-official-location
"https://www.emacswiki.org/emacs/ERC (mailing list: erc-discuss@gnu.org)"
@@ -399,25 +399,28 @@ If no server buffer exists, return nil."
;; This is useful for ordered name completion.
(last-message-time nil))
-(defsubst erc-get-channel-user (nick)
+(define-inline erc-get-channel-user (nick)
"Find the (USER . CHANNEL-DATA) element corresponding to NICK
in the current buffer's `erc-channel-users' hash table."
- (gethash (erc-downcase nick) erc-channel-users))
+ (inline-quote (gethash (erc-downcase ,nick) erc-channel-users)))
-(defsubst erc-get-server-user (nick)
+(define-inline erc-get-server-user (nick)
"Find the USER corresponding to NICK in the current server's
`erc-server-users' hash table."
- (erc-with-server-buffer
- (gethash (erc-downcase nick) erc-server-users)))
+ (inline-letevals (nick)
+ (inline-quote (erc-with-server-buffer
+ (gethash (erc-downcase ,nick) erc-server-users)))))
-(defsubst erc-add-server-user (nick user)
+(define-inline erc-add-server-user (nick user)
"This function is for internal use only.
Adds USER with nickname NICK to the `erc-server-users' hash table."
- (erc-with-server-buffer
- (puthash (erc-downcase nick) user erc-server-users)))
+ (inline-letevals (nick user)
+ (inline-quote
+ (erc-with-server-buffer
+ (puthash (erc-downcase ,nick) ,user erc-server-users)))))
-(defsubst erc-remove-server-user (nick)
+(define-inline erc-remove-server-user (nick)
"This function is for internal use only.
Removes the user with nickname NICK from the `erc-server-users'
@@ -425,8 +428,10 @@ hash table. This user is not removed from the
`erc-channel-users' lists of other buffers.
See also: `erc-remove-user'."
- (erc-with-server-buffer
- (remhash (erc-downcase nick) erc-server-users)))
+ (inline-letevals (nick)
+ (inline-quote
+ (erc-with-server-buffer
+ (remhash (erc-downcase ,nick) erc-server-users)))))
(defun erc-change-user-nickname (user new-nick)
"This function is for internal use only.
@@ -497,45 +502,55 @@ Removes all users in the current channel. This is called by
erc-channel-users)
(clrhash erc-channel-users)))
-(defsubst erc-channel-user-owner-p (nick)
+(define-inline erc-channel-user-owner-p (nick)
"Return non-nil if NICK is an owner of the current channel."
- (and nick
- (hash-table-p erc-channel-users)
- (let ((cdata (erc-get-channel-user nick)))
- (and cdata (cdr cdata)
- (erc-channel-user-owner (cdr cdata))))))
-
-(defsubst erc-channel-user-admin-p (nick)
+ (inline-letevals (nick)
+ (inline-quote
+ (and ,nick
+ (hash-table-p erc-channel-users)
+ (let ((cdata (erc-get-channel-user ,nick)))
+ (and cdata (cdr cdata)
+ (erc-channel-user-owner (cdr cdata))))))))
+
+(define-inline erc-channel-user-admin-p (nick)
"Return non-nil if NICK is an admin in the current channel."
- (and nick
+ (inline-letevals (nick)
+ (inline-quote
+ (and ,nick
(hash-table-p erc-channel-users)
- (let ((cdata (erc-get-channel-user nick)))
+ (let ((cdata (erc-get-channel-user ,nick)))
(and cdata (cdr cdata)
- (erc-channel-user-admin (cdr cdata))))))
+ (erc-channel-user-admin (cdr cdata))))))))
-(defsubst erc-channel-user-op-p (nick)
+(define-inline erc-channel-user-op-p (nick)
"Return non-nil if NICK is an operator in the current channel."
- (and nick
+ (inline-letevals (nick)
+ (inline-quote
+ (and ,nick
(hash-table-p erc-channel-users)
- (let ((cdata (erc-get-channel-user nick)))
+ (let ((cdata (erc-get-channel-user ,nick)))
(and cdata (cdr cdata)
- (erc-channel-user-op (cdr cdata))))))
+ (erc-channel-user-op (cdr cdata))))))))
-(defsubst erc-channel-user-halfop-p (nick)
+(define-inline erc-channel-user-halfop-p (nick)
"Return non-nil if NICK is a half-operator in the current channel."
- (and nick
+ (inline-letevals (nick)
+ (inline-quote
+ (and ,nick
(hash-table-p erc-channel-users)
- (let ((cdata (erc-get-channel-user nick)))
+ (let ((cdata (erc-get-channel-user ,nick)))
(and cdata (cdr cdata)
- (erc-channel-user-halfop (cdr cdata))))))
+ (erc-channel-user-halfop (cdr cdata))))))))
-(defsubst erc-channel-user-voice-p (nick)
+(define-inline erc-channel-user-voice-p (nick)
"Return non-nil if NICK has voice in the current channel."
- (and nick
+ (inline-letevals (nick)
+ (inline-quote
+ (and ,nick
(hash-table-p erc-channel-users)
- (let ((cdata (erc-get-channel-user nick)))
+ (let ((cdata (erc-get-channel-user ,nick)))
(and cdata (cdr cdata)
- (erc-channel-user-voice (cdr cdata))))))
+ (erc-channel-user-voice (cdr cdata))))))))
(defun erc-get-channel-user-list ()
"Return a list of users in the current channel. Each element
@@ -1260,7 +1275,7 @@ erc-NAME-enable, and erc-NAME-disable.
Example:
- ;;;###autoload (autoload \\='erc-replace-mode \"erc-replace\")
+ ;;;###autoload(autoload \\='erc-replace-mode \"erc-replace\")
(define-erc-module replace nil
\"This mode replaces incoming text according to `erc-replace-alist'.\"
((add-hook \\='erc-insert-modify-hook
@@ -1343,10 +1358,11 @@ capabilities."
(add-hook hook fun nil t)
fun))
-(defsubst erc-log (string)
+(define-inline erc-log (string)
"Logs STRING if logging is on (see `erc-log-p')."
- (when erc-log-p
- (erc-log-aux string)))
+ (inline-quote
+ (when erc-log-p
+ (erc-log-aux ,string))))
(defun erc-server-buffer ()
"Return the server buffer for the current buffer's process.
@@ -1590,18 +1606,18 @@ symbol, it may have these values:
(dolist (candidate (list buf-name (concat buf-name "/" server)))
(if (and (not buffer-name)
erc-reuse-buffers
- (get-buffer candidate)
- (or target
+ (or (not (get-buffer candidate))
+ (or target
+ (with-current-buffer (get-buffer candidate)
+ (and (erc-server-buffer-p)
+ (not (erc-server-process-alive)))))
(with-current-buffer (get-buffer candidate)
- (and (erc-server-buffer-p)
- (not (erc-server-process-alive)))))
- (with-current-buffer (get-buffer candidate)
- (and (string= erc-session-server server)
- (erc-port-equal erc-session-port port))))
+ (and (string= erc-session-server server)
+ (erc-port-equal erc-session-port port)))))
(setq buffer-name candidate)))
;; if buffer-name is unset, neither candidate worked out for us,
;; fallback to the old <N> uniquification method:
- (or buffer-name (generate-new-buffer-name buf-name)) ))
+ (or buffer-name (generate-new-buffer-name (concat buf-name "/" server)))))
(defun erc-get-buffer-create (server port target)
"Create a new buffer based on the arguments."
@@ -1924,15 +1940,15 @@ removed from the list will be disabled."
(defun erc-setup-buffer (buffer)
"Consults `erc-join-buffer' to find out how to display `BUFFER'."
(pcase erc-join-buffer
- (`window
+ ('window
(if (active-minibuffer-window)
(display-buffer buffer)
(switch-to-buffer-other-window buffer)))
- (`window-noselect
+ ('window-noselect
(display-buffer buffer))
- (`bury
+ ('bury
nil)
- (`frame
+ ('frame
(when (or (not erc-reuse-frames)
(not (get-buffer-window buffer t)))
(let ((frame (make-frame (or erc-frame-alist
@@ -2506,10 +2522,7 @@ Returns NICK unmodified unless `erc-lurker-trim-nicks' is
non-nil."
(if erc-lurker-trim-nicks
(replace-regexp-in-string
- (format "[%s]"
- (mapconcat (lambda (char)
- (regexp-quote (char-to-string char)))
- erc-lurker-ignore-chars ""))
+ (regexp-opt-charset (string-to-list erc-lurker-ignore-chars))
"" nick)
nick))
@@ -2549,10 +2562,8 @@ consumption for long-lived IRC or Emacs sessions."
(maphash
(lambda (nick last-PRIVMSG-time)
(when
- (> (float-time (time-subtract
- (current-time)
- last-PRIVMSG-time))
- erc-lurker-threshold-time)
+ (time-less-p erc-lurker-threshold-time
+ (time-since last-PRIVMSG-time))
(remhash nick hash)))
hash)
(if (zerop (hash-table-count hash))
@@ -2617,9 +2628,8 @@ 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)
- (> (float-time
- (time-subtract (current-time) last-PRIVMSG-time))
- erc-lurker-threshold-time))))
+ (time-less-p erc-lurker-threshold-time
+ (time-since last-PRIVMSG-time)))))
(defcustom erc-common-server-suffixes
'(("openprojects.net\\'" . "OPN")
@@ -3398,7 +3408,7 @@ Otherwise leave the channel indicated by LINE."
(defun erc-cmd-PING (recipient)
"Ping RECIPIENT."
- (let ((time (format "%f" (erc-current-time))))
+ (let ((time (format-time-string "%s.%6N")))
(erc-log (format "cmd: PING: %s" time))
(erc-cmd-CTCP recipient "PING" time)))
@@ -3677,8 +3687,10 @@ be displayed."
((string-match "^\\s-*\\([&#+!]\\S-+\\)\\s-\\(.*\\)$" topic)
(let ((ch (match-string 1 topic))
(topic (match-string 2 topic)))
- (erc-log (format "cmd: TOPIC [%s]: %s" ch topic))
- (erc-server-send (format "TOPIC %s :%s" ch topic) nil ch))
+ ;; Ignore all-whitespace topics.
+ (unless (equal (string-trim topic) "")
+ (erc-log (format "cmd: TOPIC [%s]: %s" ch topic))
+ (erc-server-send (format "TOPIC %s :%s" ch topic) nil ch)))
t)
;; /topic #channel
((string-match "^\\s-*\\([&#+!]\\S-+\\)" topic)
@@ -4270,7 +4282,7 @@ and as second argument the event parsed as a vector."
(defun erc-is-message-ctcp-and-not-action-p (message)
"Check if MESSAGE is a CTCP message or not."
(and (erc-is-message-ctcp-p message)
- (not (string-match "^\C-a\\ACTION.*\C-a$" message))))
+ (not (string-match "^\C-aACTION.*\C-a$" message))))
(defun erc-format-privmessage (nick msg privp msgp)
"Format a PRIVMSG in an insertable fashion."
@@ -4476,7 +4488,7 @@ See also: `erc-echo-notice-in-user-buffers',
(mapcar #'upcase
(cdr (split-string mode)))))
erc-channel-banlist)))
- ((string-match "^+" mode)
+ ((string-match "^\\+" mode)
;; Add the banned mask(s) to the ban list
(mapc
(lambda (mask)
@@ -4624,7 +4636,7 @@ See also `erc-display-message'."
(user-full-name)
(user-login-name)
(system-name))))
- (ns (erc-time-diff erc-server-last-sent-time (erc-current-time))))
+ (ns (erc-time-diff erc-server-last-sent-time nil)))
(when (> ns 0)
(setq s (concat s " Idle for " (erc-sec-to-time ns))))
(erc-send-ctcp-notice nick s)))
@@ -4713,8 +4725,7 @@ See also `erc-display-message'."
nil
(let ((time (match-string 1 msg)))
(condition-case nil
- (let ((delta (erc-time-diff (string-to-number time)
- (erc-current-time))))
+ (let ((delta (erc-time-diff (string-to-number time) nil)))
(erc-display-message
nil 'notice 'active
'CTCP-PING ?n nick
@@ -4772,10 +4783,7 @@ If non-nil, return from being away."
(erc-default-target)
(if away-time
(format "is back (gone for %s)"
- (erc-sec-to-time
- (erc-time-diff
- (erc-emacs-time-to-erc-time away-time)
- (erc-current-time))))
+ (erc-sec-to-time (erc-time-diff away-time nil)))
"is back")))))))))
(erc-update-mode-line)))
@@ -5367,10 +5375,10 @@ submitted line to be intentional."
(defun erc-send-current-line ()
"Parse current line and send it to IRC."
(interactive)
- (let ((now (float-time)))
+ (let ((now (current-time)))
(if (or (not erc-accidental-paste-threshold-seconds)
- (< erc-accidental-paste-threshold-seconds
- (- now erc-last-input-time)))
+ (time-less-p erc-accidental-paste-threshold-seconds
+ (time-subtract now erc-last-input-time)))
(save-restriction
(widen)
(if (< (point) (erc-beg-of-input-line))
@@ -6020,23 +6028,20 @@ non-nil value is found.
;; time routines
-(defun erc-string-to-emacs-time (string)
- "Convert the long number represented by STRING into an Emacs format.
-Returns a list of the form (HIGH LOW), compatible with Emacs time format."
- (let* ((n (string-to-number (concat string ".0"))))
- (list (truncate (/ n 65536))
- (truncate (mod n 65536)))))
+(define-obsolete-function-alias 'erc-string-to-emacs-time 'string-to-number
+ "27.1")
(defalias 'erc-emacs-time-to-erc-time 'float-time)
(defalias 'erc-current-time 'float-time)
(defun erc-time-diff (t1 t2)
- "Return the time difference in seconds between T1 and T2."
- (abs (- t2 t1)))
+ "Return the absolute value of the difference in seconds between T1 and T2."
+ (abs (float-time (time-subtract t1 t2))))
(defun erc-time-gt (t1 t2)
"Check whether T1 > T2."
- (> t1 t2))
+ (declare (obsolete time-less-p "27.1"))
+ (time-less-p t2 t1))
(defun erc-sec-to-time (ns)
"Convert NS to a time string HH:MM.SS."