[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 11bae96d23b 08/19: Clarify warning for process-dependent input in
From: |
F. Jason Park |
Subject: |
master 11bae96d23b 08/19: Clarify warning for process-dependent input in ERC |
Date: |
Sun, 17 Dec 2023 23:21:38 -0500 (EST) |
branch: master
commit 11bae96d23b0e3c726be55c34a0493d49d57d2e8
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>
Clarify warning for process-dependent input in ERC
* lisp/erc/erc.el (erc--check-prompt-input-for-running-process):
Resolve dissonance between content of ancient `user-error' message and
condition that triggered it by favoring the former because it's
supported by the underlying mechanism, which revolves around the
`process-not-needed' symbol property.
* test/lisp/erc/erc-tests.el (erc--check-prompt-input-functions):
Revise expected output for error assertion. (Bug#66073, originally
from bug#54536, and included for discussion in bug#67677)
---
lisp/erc/erc.el | 17 +++++++++++++----
test/lisp/erc/erc-tests.el | 4 ++--
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 7fbc6859584..333b762a113 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -7299,11 +7299,20 @@ a separate message."
(when (< (point) (erc-beg-of-input-line))
"Point is not in the input area"))
+;; Originally, `erc-send-current-line' inhibited sends whenever a
+;; server buffer was missing. In 2007, this was narrowed to
+;; occurrences involving process-dependent commands. However, the
+;; accompanying error message, which was identical to that emitted by
+;; `erc-server-send', "ERC: No process running", was always inaccurate
+;; because a server buffer can be alive and its process dead.
(defun erc--check-prompt-input-for-running-process (string _)
- "Return non-nil unless in an active ERC server buffer."
- (unless (or (erc-server-buffer-live-p)
- (erc-command-no-process-p string))
- "ERC: No process running"))
+ "Return non-nil if STRING is a slash command missing a process.
+Also do so when the server buffer has been killed."
+ ;; Even if the server buffer has been killed, the user should still
+ ;; be able to /reconnect and recall previous commands.
+ (and (not (erc-command-no-process-p string))
+ (or (and (not (erc-server-buffer-live-p)) "Server buffer missing")
+ (and (not (erc-server-process-alive)) "Process not running"))))
(defun erc--check-prompt-input-for-multiline-command (line lines)
"Return non-nil when non-blank lines follow a command line."
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index fb4aef00c1e..ca5582885f4 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -1414,9 +1414,9 @@
(ert-info ("Input remains untouched")
(should (save-excursion (erc-bol) (looking-at "/msg #chan hi")))))
- (ert-info ("Errors when no process running")
+ (ert-info ("Errors when server buffer absent")
(let ((e (should-error (erc-send-current-line))))
- (should (equal "ERC: No process running" (cadr e))))
+ (should (equal "Server buffer missing" (cadr e))))
(ert-info ("Input remains untouched")
(should (save-excursion (erc-bol) (looking-at "/msg #chan hi")))))
- master updated (64a4904353f -> 8e06f224a9e), F. Jason Park, 2023/12/17
- master 61b22ae9f37 03/19: Sequester some special-variable declarations in ERC, F. Jason Park, 2023/12/17
- master 0f058244ab7 18/19: Cache shortened channel names in erc-track, F. Jason Park, 2023/12/17
- master 49bfea4386f 12/19: Use templates for formatting chat messages in ERC, F. Jason Park, 2023/12/17
- master 1e2b156f040 04/19: Double hyphenate internal ERC 5.6 text props, F. Jason Park, 2023/12/17
- master b5da8ba8070 02/19: Define ERC message-formatting templates with defvar, F. Jason Park, 2023/12/17
- master 69ca2cc1138 05/19: Add utility for iterating over arrays in ERC, F. Jason Park, 2023/12/17
- master 4ee4865ce20 07/19: Add erc-server-396 response handler, F. Jason Park, 2023/12/17
- master 741bce84890 16/19: Forgo excess nick buttonizing on JOINs and QUITs, F. Jason Park, 2023/12/17
- master 7c2e02e6d79 01/19: Remove module from suggested lineup in ERC's manual, F. Jason Park, 2023/12/17
- master 11bae96d23b 08/19: Clarify warning for process-dependent input in ERC,
F. Jason Park <=
- master 6e4417eaa7e 14/19: Consolidate status-prefix slots of erc-channel-user, F. Jason Park, 2023/12/17
- master 7db500b50be 09/19: Make erc-get-user-mode-prefix more flexible, F. Jason Park, 2023/12/17
- master 9d961b31070 13/19: Demote erc-fill-line-spacing to a normal variable, F. Jason Park, 2023/12/17
- master c1befaf0a8b 10/19: Skip erc-ignored-user-p when erc-ignore-list is empty, F. Jason Park, 2023/12/17
- master 236a416be76 11/19: Add erc--spkr text property to chat messages, F. Jason Park, 2023/12/17
- master 951b115c2ac 06/19: Make erc-input's refoldp slot conditionally available, F. Jason Park, 2023/12/17
- master 08ec3e89793 15/19: Rename erc-channel-users to erc-channel-members, F. Jason Park, 2023/12/17
- master 8e06f224a9e 19/19: Add erc-track integration to erc-nicks, F. Jason Park, 2023/12/17
- master 9d889af0d68 17/19: Promote "normal" faces in erc-track, F. Jason Park, 2023/12/17