diff options
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2019-04-27 18:33:39 +0900 |
---|---|---|
committer | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2019-04-27 18:33:39 +0900 |
commit | 886bedb36c7b959b7e6fc8ce8e0c04e144b0ae28 (patch) | |
tree | b5770d9fc10a704ad8aeb3474c6940121252c770 /lisp/erc | |
parent | 015a6e1df2772bd43680df5cbeaffccf98a881da (diff) | |
parent | 8dc00b2f1e6523c634df3e24379afbe712a32b27 (diff) | |
download | emacs-886bedb36c7b959b7e6fc8ce8e0c04e144b0ae28.tar.gz |
Merge branch 'master' into harfbuzz
Diffstat (limited to 'lisp/erc')
37 files changed, 104 insertions, 111 deletions
diff --git a/lisp/erc/ChangeLog.1 b/lisp/erc/ChangeLog.1 index 7e12f633509..97b5d3f97be 100644 --- a/lisp/erc/ChangeLog.1 +++ b/lisp/erc/ChangeLog.1 @@ -11443,7 +11443,7 @@ * erc.el: * Added command-names to completion (erc-command-table) * New variable erc-auto-query. When set, every arriving message to you will open a query buffer for that sender if not already open. - * Compatibility function fo non-existing line-beginning|end-position functions in XEmacs. + * Compatibility function for non-existing line-beginning|end-position functions in XEmacs. 2001-10-03 Mario Lang <mlang@delysid.org> @@ -11702,7 +11702,7 @@ * erc-speak.el, erc.el: New file. - Copyright (C) 2001-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2019 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/lisp/erc/ChangeLog.2 b/lisp/erc/ChangeLog.2 index 5fc4135c439..e8b10463af9 100644 --- a/lisp/erc/ChangeLog.2 +++ b/lisp/erc/ChangeLog.2 @@ -757,7 +757,7 @@ See ChangeLog.1 for earlier changes. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el index 80cb6abe59d..9e224e0b828 100644 --- a/lisp/erc/erc-autoaway.el +++ b/lisp/erc/erc-autoaway.el @@ -1,6 +1,6 @@ ;;; erc-autoaway.el --- Provides autoaway for ERC -;; Copyright (C) 2002-2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002-2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Jorgen Schaefer <forcer@forcix.cx> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 814ecfae85a..210830a2b49 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -1,6 +1,6 @@ ;;; erc-backend.el --- Backend network communication for ERC -*- lexical-binding:t -*- -;; Copyright (C) 2004-2018 Free Software Foundation, Inc. +;; Copyright (C) 2004-2019 Free Software Foundation, Inc. ;; Filename: erc-backend.el ;; Author: Lawrence Mitchell <wence@gmx.li> @@ -844,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) @@ -865,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) @@ -1070,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. @@ -1287,7 +1285,7 @@ add things to `%s' instead." (pcase-let ((`(,nick ,login ,host) (erc-parse-user (erc-response.sender parsed)))) ;; strip the stupid combined JOIN facility (IRC 2.9) - (if (string-match "^\\(.*\\)?\^g.*$" chnl) + (if (string-match "^\\(.*\\)\^g.*$" chnl) (setq chnl (match-string 1 chnl))) (save-excursion (let* ((str (cond @@ -1447,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 @@ -1730,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 @@ -1802,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) @@ -1844,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 7599053e9d3..c8aa887a652 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -1,6 +1,6 @@ ;; erc-button.el --- A way of buttonizing certain things in ERC buffers -*- lexical-binding:t -*- -;; Copyright (C) 1996-2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 1996-2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-capab.el b/lisp/erc/erc-capab.el index 85f18fd5e88..210a7736cc0 100644 --- a/lisp/erc/erc-capab.el +++ b/lisp/erc/erc-capab.el @@ -1,6 +1,6 @@ ;;; erc-capab.el --- support for dancer-ircd and hyperion's CAPAB -;; Copyright (C) 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2006-2019 Free Software Foundation, Inc. ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el index ce66ff9007f..e724e367ab1 100644 --- a/lisp/erc/erc-compat.el +++ b/lisp/erc/erc-compat.el @@ -1,6 +1,6 @@ ;;; erc-compat.el --- ERC compatibility code for XEmacs -;; Copyright (C) 2002-2003, 2005-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002-2003, 2005-2019 Free Software Foundation, Inc. ;; Author: Alex Schroeder <alex@gnu.org> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index 0ad73785a8a..a6b7532e1f3 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -1,6 +1,6 @@ ;;; erc-dcc.el --- CTCP DCC module for ERC -;; Copyright (C) 1993-1995, 1998, 2002-2004, 2006-2018 Free Software +;; Copyright (C) 1993-1995, 1998, 2002-2004, 2006-2019 Free Software ;; Foundation, Inc. ;; Author: Ben A. Mesander <ben@gnu.ai.mit.edu> @@ -979,17 +979,20 @@ rather than every 1024 byte block, but nobody seems to care." (let ((inhibit-read-only t) received-bytes) (goto-char (point-max)) - (insert (string-make-unibyte str)) + (if str + (insert (string-make-unibyte str))) (when (> (point-max) erc-dcc-receive-cache) (erc-dcc-append-contents (current-buffer) erc-dcc-file-name)) - (setq received-bytes (+ (buffer-size) erc-dcc-byte-count)) + (setq received-bytes (buffer-size)) + (if erc-dcc-byte-count + (setq received-bytes (+ received-bytes erc-dcc-byte-count))) (and erc-dcc-verbose (erc-display-message nil 'notice erc-server-process 'dcc-get-bytes-received - ?f (file-name-nondirectory buffer-file-name) + ?f (file-name-nondirectory (buffer-name)) ?b (number-to-string received-bytes))) (cond ((and (> (plist-get erc-dcc-entry-data :size) 0) @@ -997,7 +1000,7 @@ rather than every 1024 byte block, but nobody seems to care." (erc-display-message nil '(notice error) 'active 'dcc-get-file-too-long - ?f (file-name-nondirectory buffer-file-name)) + ?f (file-name-nondirectory (buffer-name))) (delete-process proc)) (t (process-send-string @@ -1021,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)) diff --git a/lisp/erc/erc-desktop-notifications.el b/lisp/erc/erc-desktop-notifications.el index 84db0f58e46..41b7420320c 100644 --- a/lisp/erc/erc-desktop-notifications.el +++ b/lisp/erc/erc-desktop-notifications.el @@ -1,6 +1,6 @@ -;; 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-2018 Free Software Foundation, Inc. +;; Copyright (C) 2012-2019 Free Software Foundation, Inc. ;; Author: Julien Danjou <julien@danjou.info> ;; Keywords: comm @@ -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))) diff --git a/lisp/erc/erc-ezbounce.el b/lisp/erc/erc-ezbounce.el index 58697506185..a2c9336826a 100644 --- a/lisp/erc/erc-ezbounce.el +++ b/lisp/erc/erc-ezbounce.el @@ -1,6 +1,6 @@ ;;; erc-ezbounce.el --- Handle EZBounce bouncer commands -;; Copyright (C) 2002, 2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Andreas Fuchs <asf@void.at> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index 5efb8540b61..934b52a938c 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -1,6 +1,6 @@ ;;; erc-fill.el --- Filling IRC messages in various ways -;; Copyright (C) 2001-2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2001-2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Andreas Fuchs <asf@void.at> ;; Mario Lang <mlang@delysid.org> diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index 2d5aede6c82..884c594b9ed 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -1,6 +1,6 @@ ;; erc-goodies.el --- Collection of ERC modules -;; Copyright (C) 2001-2018 Free Software Foundation, Inc. +;; Copyright (C) 2001-2019 Free Software Foundation, Inc. ;; Author: Jorgen Schaefer <forcer@forcix.cx> ;; Maintainer: emacs-devel@gnu.org @@ -548,7 +548,7 @@ channel that has weird people talking in morse to each other. See also `unmorse-region'." (goto-char (point-min)) - (when (re-search-forward "[.-]+\\([.-]*/? *\\)+[.-]+/?" nil t) + (when (re-search-forward "[.-]+[./ -]*[.-]/?" nil t) (save-restriction (narrow-to-region (match-beginning 0) (match-end 0)) ;; Turn " / " into " " diff --git a/lisp/erc/erc-ibuffer.el b/lisp/erc/erc-ibuffer.el index 93a9573cbed..149c858d2e8 100644 --- a/lisp/erc/erc-ibuffer.el +++ b/lisp/erc/erc-ibuffer.el @@ -1,6 +1,6 @@ ;;; erc-ibuffer.el --- ibuffer integration with ERC -;; Copyright (C) 2002, 2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-identd.el b/lisp/erc/erc-identd.el index d710d95cde8..d95e0eac0c7 100644 --- a/lisp/erc/erc-identd.el +++ b/lisp/erc/erc-identd.el @@ -1,6 +1,6 @@ ;;; erc-identd.el --- RFC1413 (identd authentication protocol) server -;; Copyright (C) 2003, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2006-2019 Free Software Foundation, Inc. ;; Author: John Wiegley <johnw@gnu.org> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-imenu.el b/lisp/erc/erc-imenu.el index f038216cea6..08f52f13647 100644 --- a/lisp/erc/erc-imenu.el +++ b/lisp/erc/erc-imenu.el @@ -1,6 +1,6 @@ ;;; erc-imenu.el -- Imenu support for ERC -;; Copyright (C) 2001-2002, 2004, 2006-2018 Free Software Foundation, +;; Copyright (C) 2001-2002, 2004, 2006-2019 Free Software Foundation, ;; Inc. ;; Author: Mario Lang <mlang@delysid.org> diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index d7ae93316cd..896521eaf0a 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -1,6 +1,6 @@ ;;; erc-join.el --- autojoin channels on connect and reconnects -;; Copyright (C) 2002-2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002-2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Alex Schroeder <alex@gnu.org> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-lang.el b/lisp/erc/erc-lang.el index 02823e7d77a..f0dbe69f791 100644 --- a/lisp/erc/erc-lang.el +++ b/lisp/erc/erc-lang.el @@ -1,6 +1,6 @@ ;;; erc-lang.el --- provide the LANG command to ERC -;; Copyright (C) 2002, 2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Alex Schroeder <alex@gnu.org> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-list.el b/lisp/erc/erc-list.el index 0bb962dece5..d8d9e17c95a 100644 --- a/lisp/erc/erc-list.el +++ b/lisp/erc/erc-list.el @@ -1,6 +1,6 @@ ;;; erc-list.el --- /list support for ERC -*- lexical-binding:t -*- -;; Copyright (C) 2008-2018 Free Software Foundation, Inc. +;; Copyright (C) 2008-2019 Free Software Foundation, Inc. ;; Author: Tom Tromey <tromey@redhat.com> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index 584f566f049..4153f5c57bd 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -1,6 +1,6 @@ ;;; erc-log.el --- Logging facilities for ERC. -;; Copyright (C) 2003-2018 Free Software Foundation, Inc. +;; Copyright (C) 2003-2019 Free Software Foundation, Inc. ;; Author: Lawrence Mitchell <wence@gmx.li> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index 534a5b74205..cc4b4a88f11 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -1,6 +1,6 @@ ;;; erc-match.el --- Highlight messages matching certain regexps -;; Copyright (C) 2002-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002-2019 Free Software Foundation, Inc. ;; Author: Andreas Fuchs <asf@void.at> ;; Maintainer: emacs-devel@gnu.org @@ -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\"." diff --git a/lisp/erc/erc-menu.el b/lisp/erc/erc-menu.el index 4270ec6d993..8173829797b 100644 --- a/lisp/erc/erc-menu.el +++ b/lisp/erc/erc-menu.el @@ -1,6 +1,6 @@ ;; erc-menu.el -- Menu-bar definitions for ERC -;; Copyright (C) 2001-2002, 2004-2018 Free Software Foundation, Inc. +;; Copyright (C) 2001-2002, 2004-2019 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el index 885fc49bce5..87c3a61b663 100644 --- a/lisp/erc/erc-netsplit.el +++ b/lisp/erc/erc-netsplit.el @@ -1,6 +1,6 @@ ;;; erc-netsplit.el --- Reduce JOIN/QUIT messages on netsplits -;; Copyright (C) 2002-2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002-2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el index 824c482acde..eca8ad6a899 100644 --- a/lisp/erc/erc-networks.el +++ b/lisp/erc/erc-networks.el @@ -1,6 +1,6 @@ ;;; erc-networks.el --- IRC networks -;; Copyright (C) 2002, 2004-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004-2019 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@lexx.delysid.org> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el index 2666598436a..45dae899900 100644 --- a/lisp/erc/erc-notify.el +++ b/lisp/erc/erc-notify.el @@ -1,6 +1,6 @@ ;;; erc-notify.el --- Online status change notification -*- lexical-binding:t -*- -;; Copyright (C) 2002-2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002-2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@lexx.delysid.org> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el index 4d78a8c7214..cb57883ae6f 100644 --- a/lisp/erc/erc-page.el +++ b/lisp/erc/erc-page.el @@ -1,6 +1,6 @@ ;; erc-page.el - CTCP PAGE support for ERC -;; Copyright (C) 2002, 2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004, 2006-2019 Free Software Foundation, Inc. ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el index db0359c9afc..dd2da85d0e8 100644 --- a/lisp/erc/erc-pcomplete.el +++ b/lisp/erc/erc-pcomplete.el @@ -1,6 +1,6 @@ ;;; erc-pcomplete.el --- Provides programmable completion for ERC -;; Copyright (C) 2002-2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002-2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Sacha Chua <sacha@free.net.ph> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el index f321ae0228d..2e0e54a030f 100644 --- a/lisp/erc/erc-replace.el +++ b/lisp/erc/erc-replace.el @@ -1,6 +1,6 @@ ;; erc-replace.el -- wash and massage messages inserted into the buffer -;; Copyright (C) 2001-2002, 2004, 2006-2018 Free Software Foundation, +;; Copyright (C) 2001-2002, 2004, 2006-2019 Free Software Foundation, ;; Inc. ;; Author: Andreas Fuchs <asf@void.at> diff --git a/lisp/erc/erc-ring.el b/lisp/erc/erc-ring.el index 7e315d3b6ed..5459d8b01e5 100644 --- a/lisp/erc/erc-ring.el +++ b/lisp/erc/erc-ring.el @@ -1,6 +1,6 @@ ;; erc-ring.el -- Command history handling for erc using ring.el -;; Copyright (C) 2001-2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2001-2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Alex Schroeder <alex@gnu.org> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el index ac49a3e12ef..886ba60eb47 100644 --- a/lisp/erc/erc-services.el +++ b/lisp/erc/erc-services.el @@ -1,6 +1,6 @@ ;;; erc-services.el --- Identify to NickServ -*- lexical-binding:t -*- -;; Copyright (C) 2002-2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002-2004, 2006-2019 Free Software Foundation, Inc. ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-sound.el b/lisp/erc/erc-sound.el index 8df8ded44f3..34f7ce62c74 100644 --- a/lisp/erc/erc-sound.el +++ b/lisp/erc/erc-sound.el @@ -1,6 +1,6 @@ ;;; erc-sound.el --- CTCP SOUND support for ERC -;; Copyright (C) 2002-2003, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002-2003, 2006-2019 Free Software Foundation, Inc. ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el index 58eefd83cfb..0a1e38fe248 100644 --- a/lisp/erc/erc-speedbar.el +++ b/lisp/erc/erc-speedbar.el @@ -1,6 +1,6 @@ ;;; erc-speedbar.el --- Speedbar support for ERC -;; Copyright (C) 2001-2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2001-2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Contributor: Eric M. Ludlam <eric@siege-engine.com> @@ -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 diff --git a/lisp/erc/erc-spelling.el b/lisp/erc/erc-spelling.el index 3a34ea37397..69a83fa032b 100644 --- a/lisp/erc/erc-spelling.el +++ b/lisp/erc/erc-spelling.el @@ -1,6 +1,6 @@ ;;; erc-spelling.el --- use flyspell in ERC -;; Copyright (C) 2005-2018 Free Software Foundation, Inc. +;; Copyright (C) 2005-2019 Free Software Foundation, Inc. ;; Author: Jorgen Schaefer <forcer@forcix.cx> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index 6a648e74358..860fdbb77ce 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -1,6 +1,6 @@ ;;; erc-stamp.el --- Timestamping for ERC messages -;; Copyright (C) 2002-2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002-2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index d1f4d4acaee..e51e6056fb9 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -1,6 +1,6 @@ ;;; erc-track.el --- Track modified channel buffers -*- lexical-binding:t -*- -;; Copyright (C) 2002-2018 Free Software Foundation, Inc. +;; Copyright (C) 2002-2019 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Maintainer: emacs-devel@gnu.org @@ -630,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 @@ -640,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 @@ -669,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 diff --git a/lisp/erc/erc-truncate.el b/lisp/erc/erc-truncate.el index d4359c5c6b3..04174295520 100644 --- a/lisp/erc/erc-truncate.el +++ b/lisp/erc/erc-truncate.el @@ -1,6 +1,6 @@ ;;; erc-truncate.el --- Functions for truncating ERC buffers -;; Copyright (C) 2003-2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2003-2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Andreas Fuchs <asf@void.at> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc-xdcc.el b/lisp/erc/erc-xdcc.el index 0d66fe51069..162b22e15c6 100644 --- a/lisp/erc/erc-xdcc.el +++ b/lisp/erc/erc-xdcc.el @@ -1,6 +1,6 @@ ;;; erc-xdcc.el --- XDCC file-server support for ERC -;; Copyright (C) 2003-2004, 2006-2018 Free Software Foundation, Inc. +;; Copyright (C) 2003-2004, 2006-2019 Free Software Foundation, Inc. ;; Author: Mario Lang <mlang@delysid.org> ;; Maintainer: emacs-devel@gnu.org diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 60f877fe37e..d1fa5c7f120 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -1,6 +1,6 @@ ;; erc.el --- An Emacs Internet Relay Chat client -*- lexical-binding:t -*- -;; Copyright (C) 1997-2018 Free Software Foundation, Inc. +;; Copyright (C) 1997-2019 Free Software Foundation, Inc. ;; Author: Alexander L. Belikoff (alexander@belikoff.net) ;; Contributors: Sergey Berezin (sergey.berezin@cs.cmu.edu), @@ -62,9 +62,6 @@ ;;; 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) @@ -2525,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)) @@ -2568,8 +2562,8 @@ consumption for long-lived IRC or Emacs sessions." (maphash (lambda (nick last-PRIVMSG-time) (when - (> (float-time (time-subtract nil 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)) @@ -2634,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 nil 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") @@ -3415,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))) @@ -4289,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." @@ -4495,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) @@ -4643,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))) @@ -4732,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 @@ -4791,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))) @@ -5386,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)) @@ -6039,22 +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 timestamp." - (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." |