From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "J.P." Newsgroups: gmane.emacs.bugs Subject: bug#66073: 30.0.50; ERC 5.6: Improve handling of blank lines at ERC's prompt Date: Wed, 06 Dec 2023 23:24:43 -0800 Message-ID: <87wmtq5vb8.fsf__14724.3762201228$1701933971$gmane$org@neverwas.me> References: <87fs3bh835.fsf@neverwas.me> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26077"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-erc@gnu.org To: 66073@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 07 08:26:03 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rB8ln-0006cl-7b for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Dec 2023 08:26:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rB8ld-0001ed-Hw; Thu, 07 Dec 2023 02:25:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rB8lb-0001eH-Fn for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2023 02:25:51 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rB8lb-0001lG-7R for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2023 02:25:51 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rB8lm-0006Zv-1L for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2023 02:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "J.P." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Dec 2023 07:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66073-submit@debbugs.gnu.org id=B66073.170193390925204 (code B ref 66073); Thu, 07 Dec 2023 07:26:02 +0000 Original-Received: (at 66073) by debbugs.gnu.org; 7 Dec 2023 07:25:09 +0000 Original-Received: from localhost ([127.0.0.1]:40930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rB8kv-0006YR-2D for submit@debbugs.gnu.org; Thu, 07 Dec 2023 02:25:09 -0500 Original-Received: from mail-108-mta246.mxroute.com ([136.175.108.246]:38321) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rB8ks-0006YF-Ut for 66073@debbugs.gnu.org; Thu, 07 Dec 2023 02:25:08 -0500 Original-Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta246.mxroute.com (ZoneMTA) with ESMTPSA id 18c432a4375000190b.001 for <66073@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 07 Dec 2023 07:24:52 +0000 X-Zone-Loop: 1ee815f8bce18353dcf669cfa56624589148415bbeeb X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Lo5XTD4Owx9cOJkJzV+Uzt0VvcUerSf4h5n62cYdjKE=; b=dXrzgZed1MiN5MU4aDDf+MrJn4 TvBoqsoK3g2jp75mMom2UQNpRapgGbAcZV/LKIJsCRLlI+7gbKV+7Sm6PqnxOjHAdmHKcX9dhTJk6 6QSkHf+7ds1pAxdlrniUagNzWDmamXFHiv/L624BCxCqYkDPoBMEdDo7Z8qAhP+zKgaJLnlSadIoH 7gcA+dTsr1aOc0rQZtcmiVMfuN4TPxnoiQ45F95DPvz54VlHAcNdXED6sKKJ0xs/VbZNOsGcnNq+7 oSmBwjDv1/nXvzLa+DrNSzpM87XofOjWipC/90HkY0d6aJdOthHrgtiKLBUMqNuJ/nqtW3zCdNiBs xGbJucKg==; In-Reply-To: <87fs3bh835.fsf@neverwas.me> (J. P.'s message of "Mon, 18 Sep 2023 07:25:18 -0700") X-Authenticated-Id: masked@neverwas.me X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275651 Archived-At: --=-=-= Content-Type: text/plain Changes from this bug attempted to fix a number of historical behavioral quirks related to intercepting and validating prompt input preflight. One thing they glossed over was not dealing with the confusing "No process running" warning issued when a user submits input in an orphaned target buffer. This unfortunate behavior has been with ERC for ages and might well be cemented into the wider user "ecosystem" such that fixing it interferes with things like a `condition-case' handler matching against the exact wording, etc. However, given the annoying nature of this style of input feedback, I think it makes sense to bite the bullet here and just chance a minimally churn-inducing change. See attached. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0008-5.6-Clarify-warning-for-process-dependent-input-in-E.patch >From 62797d2b97fd8aa00dd45f778555f3c78ea1a6c1 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Mon, 27 Nov 2023 19:41:09 -0800 Subject: [PATCH 08/11] [5.6] 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) --- 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 3e45949688d..98621302abd 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -7318,11 +7318,20 @@ erc--check-prompt-input-for-point-in-bounds (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 /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 ac6eb6b5e3c..eb954112ce8 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -1414,9 +1414,9 @@ erc--check-prompt-input-functions (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"))))) -- 2.42.0 --=-=-=--