aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/erc
diff options
context:
space:
mode:
authorF. Jason Park2023-11-08 19:14:55 -0800
committerF. Jason Park2023-11-12 20:37:48 -0800
commitbeb60a9027ce61b4fa5b003804a46fefc4916c6f (patch)
treef204c0f59b184cd8b3da23ba39f166a6b470eb63 /lisp/erc
parent5baa0f61f8dc65ec45e3fe49c8179e4ae6830a84 (diff)
downloademacs-beb60a9027ce61b4fa5b003804a46fefc4916c6f.tar.gz
emacs-beb60a9027ce61b4fa5b003804a46fefc4916c6f.zip
Make ERC's error-notice formatting more consistent
* lisp/erc/erc-backend.el (erc--server-propagate-failed-connection): Include leading three-asterisk notice prefix when reporting process exit status, and set the `erc-msg' text property to `notice-error'. (erc-schedule-reconnect): Include leading notice prefix when inserting `reconnecting' message. * lisp/erc/erc.el (erc-process-input-line, erc-cmd-PART, erc-cmd-TOPIC): Display `no-target' messages as "error notices". (erc-message-english-disconnected, erc-message-english-disconnected-noreconnect): Hard-code standard value of `erc-notice-prefix' into message text for consistency during formatting and insertion. * test/lisp/erc/erc-tests.el (erc--refresh-prompt): Expect notice prefix before `no-target' message. (Bug#67031)
Diffstat (limited to 'lisp/erc')
-rw-r--r--lisp/erc/erc-backend.el4
-rw-r--r--lisp/erc/erc.el11
2 files changed, 8 insertions, 7 deletions
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 4b5edaa77d2..32d891cd1c6 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -728,7 +728,7 @@ error data is something ERC recognizes. Print an explanation to
728the server buffer in any case." 728the server buffer in any case."
729 (when (eq (process-status process) 'failed) 729 (when (eq (process-status process) 'failed)
730 (erc-display-message 730 (erc-display-message
731 nil 'error (process-buffer process) 731 nil '(notice error) (process-buffer process)
732 (format "Process exit status: %S" (process-exit-status process))) 732 (format "Process exit status: %S" (process-exit-status process)))
733 (pcase (process-exit-status process) 733 (pcase (process-exit-status process)
734 (111 734 (111
@@ -995,7 +995,7 @@ When `erc-server-reconnect-attempts' is a number, increment
995 (- erc-server-reconnect-attempts 995 (- erc-server-reconnect-attempts
996 (cl-incf erc-server-reconnect-count (or incr 1))))) 996 (cl-incf erc-server-reconnect-count (or incr 1)))))
997 (proc (buffer-local-value 'erc-server-process buffer))) 997 (proc (buffer-local-value 'erc-server-process buffer)))
998 (erc-display-message nil 'error buffer 'reconnecting 998 (erc-display-message nil '(notice error) buffer 'reconnecting
999 ?m erc-server-reconnect-timeout 999 ?m erc-server-reconnect-timeout
1000 ?i (if count erc-server-reconnect-count "N") 1000 ?i (if count erc-server-reconnect-count "N")
1001 ?n (if count erc-server-reconnect-attempts "A")) 1001 ?n (if count erc-server-reconnect-attempts "A"))
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index fd57cb9d6a0..2d8f388328d 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -3729,7 +3729,7 @@ this function from interpreting the line as a command."
3729 (let ((r (erc-default-target))) 3729 (let ((r (erc-default-target)))
3730 (if r 3730 (if r
3731 (funcall erc-send-input-line-function r line force) 3731 (funcall erc-send-input-line-function r line force)
3732 (erc-display-message nil 'error (current-buffer) 'no-target) 3732 (erc-display-message nil '(notice error) (current-buffer) 'no-target)
3733 nil))))) 3733 nil)))))
3734 3734
3735(defconst erc--shell-parse-regexp 3735(defconst erc--shell-parse-regexp
@@ -4581,7 +4581,7 @@ Otherwise leave the channel indicated by LINE."
4581 (format "PART %s" ch) 4581 (format "PART %s" ch)
4582 (format "PART %s :%s" ch reason)) 4582 (format "PART %s :%s" ch reason))
4583 nil ch)) 4583 nil ch))
4584 (erc-display-message nil 'error (current-buffer) 'no-target))) 4584 (erc-display-message nil '(notice error) (current-buffer) 'no-target)))
4585 t) 4585 t)
4586 (t nil))) 4586 (t nil)))
4587(put 'erc-cmd-PART 'do-not-parse-args t) 4587(put 'erc-cmd-PART 'do-not-parse-args t)
@@ -4921,7 +4921,7 @@ be displayed."
4921 (progn 4921 (progn
4922 (erc-log (format "cmd: TOPIC [%s]: %s" ch topic)) 4922 (erc-log (format "cmd: TOPIC [%s]: %s" ch topic))
4923 (erc-server-send (format "TOPIC %s :%s" ch topic) nil ch)) 4923 (erc-server-send (format "TOPIC %s :%s" ch topic) nil ch))
4924 (erc-display-message nil 'error (current-buffer) 'no-target))) 4924 (erc-display-message nil '(notice error) (current-buffer) 'no-target)))
4925 t) 4925 t)
4926 (t nil))) 4926 (t nil)))
4927(defalias 'erc-cmd-T #'erc-cmd-TOPIC) 4927(defalias 'erc-cmd-T #'erc-cmd-TOPIC)
@@ -8194,9 +8194,10 @@ All windows are opened in the current frame."
8194 (flood-ctcp-off . "FLOOD PROTECTION: Automatic CTCP responses turned off.") 8194 (flood-ctcp-off . "FLOOD PROTECTION: Automatic CTCP responses turned off.")
8195 (flood-strict-mode 8195 (flood-strict-mode
8196 . "FLOOD PROTECTION: Switched to Strict Flood Control mode.") 8196 . "FLOOD PROTECTION: Switched to Strict Flood Control mode.")
8197 (disconnected . "\n\nConnection failed! Re-establishing connection...\n") 8197 (disconnected
8198 . "\n\n*** Connection failed! Re-establishing connection...\n")
8198 (disconnected-noreconnect 8199 (disconnected-noreconnect
8199 . "\n\nConnection failed! Not re-establishing connection.\n") 8200 . "\n\n*** Connection failed! Not re-establishing connection.\n")
8200 (reconnecting . "Reconnecting in %ms: attempt %i/%n ...") 8201 (reconnecting . "Reconnecting in %ms: attempt %i/%n ...")
8201 (reconnect-canceled . "Canceled %u reconnect timer with %cs to go...") 8202 (reconnect-canceled . "Canceled %u reconnect timer with %cs to go...")
8202 (finished . "\n\n*** ERC finished ***\n") 8203 (finished . "\n\n*** ERC finished ***\n")