From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gabriel Newsgroups: gmane.emacs.bugs Subject: bug#50176: [PATCH] 28.0.50; repeat-mode does not clear echo-area after timeout Date: Tue, 24 Aug 2021 11:31:30 -0300 Message-ID: References: <87o89nxrxf.fsf@mail.linkov.net> 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="18437"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) To: 50176@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 24 16:50:27 2021 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 1mIXkw-0004Xe-62 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Aug 2021 16:50:26 +0200 Original-Received: from localhost ([::1]:40890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIXku-0005nl-On for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Aug 2021 10:50:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIXU6-0005uy-4y for bug-gnu-emacs@gnu.org; Tue, 24 Aug 2021 10:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33415) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mIXU5-0002iZ-Tz for bug-gnu-emacs@gnu.org; Tue, 24 Aug 2021 10:33:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mIXU5-0002tE-RJ for bug-gnu-emacs@gnu.org; Tue, 24 Aug 2021 10:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gabriel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Aug 2021 14:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50176 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162981552611043 (code B ref -1); Tue, 24 Aug 2021 14:33:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Aug 2021 14:32:06 +0000 Original-Received: from localhost ([127.0.0.1]:44961 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIXT7-0002rk-Cp for submit@debbugs.gnu.org; Tue, 24 Aug 2021 10:32:06 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:50800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIXT5-0002rZ-7r for submit@debbugs.gnu.org; Tue, 24 Aug 2021 10:31:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIXT4-00056m-Uf for bug-gnu-emacs@gnu.org; Tue, 24 Aug 2021 10:31:59 -0400 Original-Received: from mail-mw2nam10olkn2082.outbound.protection.outlook.com ([40.92.42.82]:38239 helo=NAM10-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIXT2-00022D-2F for bug-gnu-emacs@gnu.org; Tue, 24 Aug 2021 10:31:58 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jJFbhKq8yaJpQKmMpIH8r9bPio7mK4+ol/JyyJikRPbUEOrIwjDq6PyLTxeOZ3H7SeR/L9qcz1xXjtEX28XA4xKU/J5qm0r7EVn1oPPdwBdjLX7Oxs5Jb+Z/j4SCr072yIUV+3IEPbuU93wb6spQWRQfZ/K2TxKeK9xIa1iXZTx5eS8dfswRcJJF2lNjK39TlC7YwdN7vl5WDqVacZdX5wo8WfDnT7byu68emfKys3jl5dCsgS6l8X3VTrmdFEMb2X/SPEj1oDUH8qumDlFuNpe3CuZnw4XN8XrhoNKOQ7plK94KR6SII1mJ40BSkdpiaaZlFAi+rzhSId3/cXs9vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t+QHnpFkV9YXWV4pcjikrOeit1A4PxOBN9ez3ffoM8M=; b=SQ01VwXaEK+zUqWhiEcepsW7dt4pOtQXVTPbHlVrWk5nY6WZiyN+dT7tuu/fhe7oHiRuNV4qjKiWS2jr32F4tLaMWYmbO/Y6uODtmat/KDowQ0vGIvJwTdjGAZSqSNjvHUss1lNXaR8+nfRtmYSI58r7sbYf5sQq/C2oZnc5jrejA3rA5wTghuzyqEhk0gtMxh8L8jByioqnY5ZjP+Urprsf6uniPMQOtEVbuqgyIUtwyAkz2ik4uhrvu/0ZZND1s63WL4OctElsZj5Gt8lCFGdJLeK5izOK9/c3XWcVq9HfgEhYF9/XqSJMbxBovzthbKz+/nPX0IdXkzn2JhKfIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t+QHnpFkV9YXWV4pcjikrOeit1A4PxOBN9ez3ffoM8M=; b=ZE9XHjF0ysy0YtmAjJiB7NtxfSWJvskYkdcUeZ3ktpqcTUm2IVroIjhSXG244wLgWjdiN1jUc5rBH1eDbgjljM20I8aLI5UhtQRXuHbTmd+4NO4Gi4+Z1WMMYlVXNYpXL/WXK3u/GXULdPU551mFD5qeDujlRFW9/sANs1eno5Oo9RdTTE071H+C7A+4CLhOLc3AopcVfo5rN2iJV5gQDcbOpNzgboEPX/2NqTFevXvE658MplgPXHv0oELVjSkydKKHJRwEu3h2oiRQslwOTYA7ApgMf1LWkmKQzeLOT1pWuLqeWLKMfAtbSxnv/wNTr3+nFbx7g70YZBrZDYK/cQ== Original-Received: from CH2PR01MB5879.prod.exchangelabs.com (2603:10b6:610:3c::12) by CH0PR01MB7020.prod.exchangelabs.com (2603:10b6:610:109::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Tue, 24 Aug 2021 14:31:53 +0000 Original-Received: from CH2PR01MB5879.prod.exchangelabs.com ([fe80::5c64:1750:c3c7:c182]) by CH2PR01MB5879.prod.exchangelabs.com ([fe80::5c64:1750:c3c7:c182%2]) with mapi id 15.20.4436.024; Tue, 24 Aug 2021 14:31:53 +0000 In-Reply-To: <87o89nxrxf.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 24 Aug 2021 09:44:44 +0300") X-TMN: [TPYRnw5tre2YDFEoE5m0PAHQjsCw1Trv] X-ClientProxiedBy: CP4P284CA0043.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:127::13) To CH2PR01MB5879.prod.exchangelabs.com (2603:10b6:610:3c::12) X-Microsoft-Original-Message-ID: X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from 8c85906fe631.ant.amazon.com (177.215.64.63) by CP4P284CA0043.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:127::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.22 via Frontend Transport; Tue, 24 Aug 2021 14:31:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 558d8879-1c93-43fc-1509-08d9670bea97 X-MS-TrafficTypeDiagnostic: CH0PR01MB7020: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kPrx43bokzWaA/DNK/3gVmBImuAGRlYIQkxToP3AQ2OltnZn8FGPtfxe7fNXbK5jpFGc1ANavGGbXzhVjKgH49Bk2Ldh6aEEEy/f7rQdkld1eIlBoWJX/1molCxK5uH49a69N91C/UVibZ7CpT9YI9aZxNplfJ7s3/gc3YwNMd9ux0jrLBxsLio/428zTZKMKFJ3jYv1f4iVXyzOKZu34f9SW2oS5CwFidsQ6K5YN9qrrmYZL6A8pMud4oT17XOzhfcZlNYFMB1MFdGCpktI7LbX0w+mMbrZmO4IOf7JVV8Ncp8mImz+6Ex07QqH3vywE37tNlR3tX6fONh9+hKzKp8WPaEMZUayH0mmR84Nr4zN1xxJFNvMJKTWzoiUri9wz//XM4Lt0QvoU07yaSgVIraHHmUcmQYAevqTAHTjezERuuWn/JISjxTrMbdwoTFx X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e7Noj6Ffx4CDQ8zKwDBohhtV4q5Wm7xD54pTIAldNxSAuxic+Md6xiyCL63PcMNnnox4KHzDNxahkAz2COeeL2NMbR4nKg6YeZ5L8kjgO7LaT7UVEzzYMsZSl1t/NiajSY792+gy4YFIxJFjpTyUcQ== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-48c30.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 558d8879-1c93-43fc-1509-08d9670bea97 X-MS-Exchange-CrossTenant-AuthSource: CH2PR01MB5879.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 14:31:53.4912 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR01MB7020 Received-SPF: pass client-ip=40.92.42.82; envelope-from=gabriel376@hotmail.com; helo=NAM10-MW2-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.bugs:212548 Archived-At: --=-=-= Content-Type: text/plain Juri Linkov writes: > > Thanks for the patch. This is a known problem without a good solution. > But your patch handles the case much better than before, so pushed now. Thank you, Juri Perhaps we could store in a defvar the last message echoed by repeat-mode to make easier this check? Today I caught a small problem with the patch I sent. The 'string-prefix-p' and 'string-match-p' handle nil inputs differently: (string-prefix-p "Repeat with " nil) ;; returns nil (string-match-p "Repeat with " nil) ;; throws an error The problem can be reproduced by writing some elisp code in *scratch* buffer, putting the cursor in the function definition and invoking the 'other-window' with 'repeat-mode' using my original steps. The 'eldoc-mode' will echo the function name and '(current-message)' will return nil. A simple patch: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Handle-nil-messages-in-repeat-echo-message.patch >From 4e67546e2a9a878418d9dd766d234699fd58da34 Mon Sep 17 00:00:00 2001 From: Gabriel do Nascimento Ribeiro Date: Tue, 24 Aug 2021 11:23:49 -0300 Subject: [PATCH] Handle nil messages in repeat-echo-message. * lisp/repeat.el (repeat-echo-message): Handle cases where 'current-message' is nil (bug#50176). --- lisp/repeat.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/repeat.el b/lisp/repeat.el index e3e7a7568e..3b30ba2a60 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -474,8 +474,9 @@ repeat-echo-message (if (current-message) (message "%s [%s]" (current-message) mess) (message mess))) - (when (string-match-p "Repeat with " (or (current-message) "")) - (message nil)))) + (and (current-message) + (string-match-p "Repeat with " (current-message)) + (message nil)))) (defvar repeat-echo-mode-line-string (propertize "[Repeating...] " 'face 'mode-line-emphasis) -- 2.32.0 --=-=-= Content-Type: text/plain (The call to '(current-message)' does not seem to be expensive; otherwise, we could store it into a variable to avoid duplicated calls) --=-=-=--