summaryrefslogtreecommitdiff
path: root/lisp/erc
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2022-12-28 21:40:59 +0100
committerStefan Kangas <stefankangas@gmail.com>2022-12-28 21:40:59 +0100
commitdce6791e9934d029ffae45793a5d05096346be0c (patch)
tree387d999b6d6af1d72dfc3416e49d445329139ed9 /lisp/erc
parent7e98b8a0fa67f51784024fac3199d774dfa77192 (diff)
parentdb96b1282f90ee40560f81e8b715fe785badbb6e (diff)
downloademacs-dce6791e9934d029ffae45793a5d05096346be0c.tar.gz
emacs-dce6791e9934d029ffae45793a5d05096346be0c.tar.bz2
emacs-dce6791e9934d029ffae45793a5d05096346be0c.zip
Merge from origin/emacs-29
db96b1282f9 * lisp/help.el: Use 'C-h C-q' to toggle 'help-quick' wind... 489865c21e4 ; Improve markup of long key sequences d42c2668cf3 ; * etc/NEWS: Fix wording of a recently edited entry. 7a0eaee1980 * lisp/isearch.el: Small fixes. b69bffeec05 * lisp/vc/diff-mode.el (diff-minor-mode-prefix): Replace ... 9263847ab76 ; * etc/NEWS: Move the paragraph with 'C-u RET' closer to... 62fb2dc37da * doc/emacs/display.texi (Text Scale): Improve section ab... 70480d3b6b7 * lisp/repeat.el (repeat-echo-function): Suggest 'add-fun... fd48201ffe7 * lisp/tab-line.el (tab-line-cache-key-default): More cac... b1646602602 * etc/package-keyring.gpg: Update with new key c0be51389eb ; Yet another declare-function to avoid treesit-related w... 8676bec51de ; * lisp/treesit.el (treesit--simple-imenu-1): Doc fix; w... 2ddc480f441 Warn of absent networks module in ERC 19d00fab9aa Avoid "already compiled" warning in erc-compat 2d8f7b66bcc ; Fix one more treesit byte-compilation warning. 2d0a9214863 ; Avoid treesit-related byte-compiler warnings 8503b370be1 (python--treesit-settings): Remove duplicate matcher b464e6c490b Make last change of w32 GUI dialogs conditional and rever... eedc9d79aed Fix tree-sitter typos 248c13dcfe1 Update tree-sitter major modes to use the new Imenu facility b39dc7ab27a Add tree-sitter helper functions for Imenu ba1ddea9dab Fix treesit--things-around (bug#60355) 7512b9025a1 ; * lisp/treesit.el (treesit-traverse-parent): Remove alias. 5326b041982 Improve treesit-node-top-level and treesit-parent-until 637f5b164f2 ; Add "src" to the heuristic sub-directory heuristic 8ab6df0c9fd ; * lisp/epa-ks.el (epa-ks-do-key-to-fetch): Fix 'when' u... 2b55a48d3e3 * src/w32menu.c (simple_dialog_show): Use MB_YESNOCANCEL ... 8b8b7915679 ; Improve documentation of TAB/SPC indentation 624e3822110 ; Improve doc strings of some new faces 41f12e1019b ; * lisp/elide-head.el (elide-head): Doc fix to silence c... e3b4cd0ac1d ; * lisp/htmlfontify.el (hfy-text-p): Fix whitespace. 1b4dc4691c1 Fix htmlfontify.el command injection vulnerability. 1fe4b98b4d5 Improve support for Scheme R6RS and R7RS libraries (bug#5... 2347f37f677 ; * test/src/treesit-tests.el: remove dead store (bytecom... a6d961ae2fd Add a new tree-sitter query predicate 'pred' 835a80dcc48 ; Fix tree-sitter defun tests a14821d6151 Improve gnutls-min-prime-bits docstring b14bbd108e4 Improve handling of tab-bar height. 669160d47b2 ; * nt/INSTALL.W64: More fixes and updates. 26b2ec7cb8c Simplify last change (bug#60311) 082fc6e3088 Fix 'json-available-p' on MS-Windows 6c86faec29e loaddefs-gen: Group results by absolute file name d90d7d15f2f ; Fix vindexes in parsing.texi eb268728376 Fix imenu for c-ts-mode (bug#60296) 8f68b6497ee Clean up python-ts-mode font-lock features 28f26b11a1e Add comment indent and filling to other tree-sitter major... c6b02826450 ; Remove unused function in c-ts-mode 6e52a9fcadc ; * doc/lispref/modes.texi (Parser-based Font Lock): Mino... 2bcd1e9a99d ; * doc/lispref/parsing.texi (Retrieving Nodes): Add notice. 7c7950fe006 Add maintainer stub for tree-sitter files cf327766226 ; * doc/lispref/parsing.texi (Using Parser): Remove delet... # Conflicts: # etc/NEWS # lisp/progmodes/c-ts-mode.el # lisp/progmodes/typescript-ts-mode.el # lisp/treesit.el
Diffstat (limited to 'lisp/erc')
-rw-r--r--lisp/erc/erc-backend.el10
-rw-r--r--lisp/erc/erc-compat.el2
-rw-r--r--lisp/erc/erc-networks.el26
-rw-r--r--lisp/erc/erc-sasl.el2
-rw-r--r--lisp/erc/erc.el6
5 files changed, 36 insertions, 10 deletions
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 43c5faad638..6820bf0d1a3 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -320,6 +320,15 @@ session when reconnecting. Once `erc-reuse-buffers' is retired
and fully removed, modules can switch to leveraging the
`permanent-local' property instead.")
+(defvar erc--server-post-connect-hook '(erc-networks--warn-on-connect)
+ "Functions to run when a network connection is successfully opened.
+Though internal, this complements `erc-connect-pre-hook' in that
+it bookends the process rather than the logical connection, which
+is the domain of `erc-before-connect' and `erc-after-connect'.
+Note that unlike `erc-connect-pre-hook', this only runs in server
+buffers, and it does so immediately before the first protocol
+exchange.")
+
(defvar-local erc-server-timed-out nil
"Non-nil if the IRC server failed to respond to a ping.")
@@ -646,6 +655,7 @@ The current buffer is given by BUFFER."
(cl-defmethod erc--register-connection ()
"Perform opening IRC protocol exchange with server."
+ (run-hooks 'erc--server-post-connect-hook)
(erc-login))
(defvar erc--server-connect-dumb-ipv6-regexp
diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el
index fdcb146d42a..864c5882cf2 100644
--- a/lisp/erc/erc-compat.el
+++ b/lisp/erc/erc-compat.el
@@ -261,7 +261,7 @@ If START or END is negative, it counts from the end."
(when-let* ((s (plist-get e :secret))
(v (auth-source--obfuscate s)))
(setf (plist-get e :secret)
- (byte-compile (lambda () (auth-source--deobfuscate v)))))
+ (apply-partially #'auth-source--deobfuscate v)))
(push e out)))
rv)))
diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el
index 2e2d0930118..f05a98be16d 100644
--- a/lisp/erc/erc-networks.el
+++ b/lisp/erc/erc-networks.el
@@ -1472,14 +1472,16 @@ to be a false alarm. If `erc-reuse-buffers' is nil, let
(t (rename-buffer (generate-new-buffer-name name)))))
nil)
-;; Soju v0.4.0 only sends ISUPPORT on upstream reconnect, so this
-;; doesn't apply. ZNC 1.8.2, however, still sends the entire burst.
-(defconst erc-networks--bouncer-targets '(*status bouncerserv)
- "Case-mapped symbols matching known bouncer service-bot targets.")
+;; Soju v0.4.0 sends ISUPPORT and nothing else on upstream reconnect,
+;; so this actually doesn't apply. ZNC 1.8.2, however, still sends
+;; the entire burst.
+(defvar erc-networks--bouncer-targets '(*status bouncerserv)
+ "Symbols matching proxy-bot targets.")
(defun erc-networks-on-MOTD-end (proc parsed)
- "Call on-connect functions with server PROC and PARSED message.
-This must run before `erc-server-connected' is set."
+ "Call on-connect functions with server PROC and PARSED message."
+ ;; This should normally run before `erc-server-connected' is set.
+ ;; However, bouncers and other proxies may interfere with that.
(when erc-server-connected
(unless (erc-buffer-filter (lambda ()
(and erc--target
@@ -1502,6 +1504,18 @@ This must run before `erc-server-connected' is set."
((remove-hook 'erc-server-376-functions #'erc-networks-on-MOTD-end)
(remove-hook 'erc-server-422-functions #'erc-networks-on-MOTD-end)))
+(defun erc-networks--warn-on-connect ()
+ "Emit warning when the `networks' module hasn't been loaded.
+Ideally, do so upon opening the network process."
+ (unless (or erc--target erc-networks-mode)
+ (require 'info nil t)
+ (let ((m (concat "Required module `networks' not loaded. If this "
+ " was unexpected, please add it to `erc-modules'.")))
+ ;; Assume the server buffer has been marked as active.
+ (erc-display-error-notice
+ nil (concat m " See Info:\"(erc) Required Modules\" for more."))
+ (lwarn 'erc :warning m))))
+
(defun erc-ports-list (ports)
"Return a list of PORTS.
diff --git a/lisp/erc/erc-sasl.el b/lisp/erc/erc-sasl.el
index 78d02a46381..23110d74b5e 100644
--- a/lisp/erc/erc-sasl.el
+++ b/lisp/erc/erc-sasl.el
@@ -435,7 +435,7 @@ Otherwise, expect it to disappear in subsequent versions.")
(if (eq :user (alist-get 'user erc-sasl--options))
(erc-current-nick)
erc-session-username)))
- (erc-login))
+ (cl-call-next-method))
(when erc-sasl--send-cap-ls
(erc-server-send "CAP REQ :sasl"))
(erc-server-send (format "AUTHENTICATE %s" m)))
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 6a5e0018964..16a0aba77b1 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1607,7 +1607,8 @@ same manner."
(when target ; compat
(setq tgt-info (erc--target-from-string target)))
(if tgt-info
- (let* ((esid (erc-networks--id-symbol erc-networks--id))
+ (let* ((esid (and erc-networks--id
+ (erc-networks--id-symbol erc-networks--id)))
(name (if esid
(erc-networks--reconcile-buffer-names tgt-info
erc-networks--id)
@@ -6760,7 +6761,8 @@ This should be a string with substitution variables recognized by
If the name of the network is not available, then use the
shortened server name instead."
(if-let ((erc--target)
- (name (if-let ((esid (erc-networks--id-symbol erc-networks--id)))
+ (name (if-let ((erc-networks--id)
+ (esid (erc-networks--id-symbol erc-networks--id)))
(symbol-name esid)
(erc-shorten-server-name (or erc-server-announced-name
erc-session-server)))))