From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74090: 31.0.50; Problems with dabbrev-expand Date: Mon, 02 Dec 2024 13:15:23 +0100 Message-ID: <87ttbmxov8.fsf@gmx.net> References: <878qu6j0tx.fsf@gmx.net> <86zfml4uay.fsf@gnu.org> <87cyjgwq1a.fsf@gmx.net> <87ttbq7eie.fsf@mail.linkov.net> <87h67q4gv6.fsf@mail.linkov.net> <87wmgm6oe4.fsf@gmx.net> <877c8kboet.fsf@mail.linkov.net> <865xo47af4.fsf@gnu.org> <87jzcke4n6.fsf@gmx.net> <87ttbmim48.fsf@mail.linkov.net> Reply-To: Stephen Berman Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11023"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 74090@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 02 13:16:20 2024 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 1tI5Lf-0002dF-4g for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Dec 2024 13:16:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tI5LQ-0003v4-VP; Mon, 02 Dec 2024 07:16:04 -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 1tI5LO-0003uk-Tc for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 07:16:03 -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 1tI5LO-0000jT-GL for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 07:16:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=5Wc1zajKXrEZDgQSQR/QJRXUStMfQKtI9itCCCTba6I=; b=Oyncd9Shp9yJS/zdqWEFHZeGbmWnTwjTwRpExMUUAdhoNTuJjfhtcQS9WiQiQM0bF23xVJ/+oIOLi6dc8067vTbY3CLJFAt8b64kfdzne/NDWsPPA9u7iJTrpvsYna46zD/1cV300fKtloILkwNgH3u1eXsg1cVBaPnHlHqKWDjuD8hU+fa8dHSXdVt9/ym57R5/eup7+CmAz+YN7AXxcPw1AUGhD/hmprL8WluT/TZhApz2jyzSE14x6lVcCQ70cIVID5MiVoQi3rAuubYSmN1GnpUmgH0kn4BeOCGbkKJP5tPvMv6/n21lK+CqqDTPA8JAzq0iiWmdR0/YdXRPlg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tI5LO-0004Ya-B4 for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 07:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Dec 2024 12:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74090 X-GNU-PR-Package: emacs Original-Received: via spool by 74090-submit@debbugs.gnu.org id=B74090.173314173417466 (code B ref 74090); Mon, 02 Dec 2024 12:16:02 +0000 Original-Received: (at 74090) by debbugs.gnu.org; 2 Dec 2024 12:15:34 +0000 Original-Received: from localhost ([127.0.0.1]:54531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tI5Kv-0004Xd-Kl for submit@debbugs.gnu.org; Mon, 02 Dec 2024 07:15:34 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:39111) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tI5Kt-0004XP-Ov for 74090@debbugs.gnu.org; Mon, 02 Dec 2024 07:15:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1733141725; x=1733746525; i=stephen.berman@gmx.net; bh=5Wc1zajKXrEZDgQSQR/QJRXUStMfQKtI9itCCCTba6I=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=o7d8NPpAmHsabtAGhQpqTZAi9scmhV+2y7etvieuJLmxTz6kCmpNawFbpZa1R8eP gF6b57pJ76Qz+fxpV97B4Ftn2QbMSXVVjYkEosDbqE/vCKfNgTe2XDlxaIvApw59f TF9btZcNZWDgjLeIUF9kfiUOO1JxCn8TuW3QHgYf2UnkN0Nr7vc9CYB9cjizYuomK 8my+dQg0SYW8viNpPBgqVECxA+AMhs/sfj7KtZoyqCwk6gfbOjPjCYzWjAGYN1qzg AEH4BUYLuq6CQnKxvH87WFyqKpVgHAzEcER/gZDcG5SwZc4dIMS4W0ac/WstzaPTC cqRD+qjhm7oUoRGf7g== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfssd ([94.134.94.179]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MMXQ5-1szjEg19br-00WEUT; Mon, 02 Dec 2024 13:15:25 +0100 In-Reply-To: <87ttbmim48.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 02 Dec 2024 09:33:51 +0200") X-Provags-ID: V03:K1:HK26npl9/WD3EqoHdVvR8GVvpR2k8lfODqpZ5lYFlYVC6qobv7+ sFi6Xz4jvRNAxOpuH8XZlDqbpzzV+6hnegKOMrl31HTqsnZK9CGDnjiXn4rAibgCXzic68u e+asOx/3Vrt+/WEBY/Xx8hD5TueB8+/zynTdFr9/deRLFlLzOrLXq2BPkhr88Slkod/0lfE R8w+iDxIBwSG4yyj6qqGw== UI-OutboundReport: notjunk:1;M01:P0:0erHtUGX9oQ=;hu9Q5l8dymheottsFlWbrBZ/oWA uN+LrUr5dKysdIn3loIzb9QGalA4sXvM81XFM10SXsDE1bzHngA68d1tlIrMbKTWJkL+37m5I Jn4dNRDA68CDYL+3Oy4tiUoCiWCqeSWopUUyMv7tWPbtoAeLYuGUpWN+j2qjrpOt1E7OKHJJP +MS+21KKMJSOe3+NomK6kw3mvFIJXqxLVtVqsXbcXVolX7H4GsyD7I5wFMkpMi0dlqXoAfWlj P2JVp42w31lMaG4SETr96Kqs0cr+ihLkI3gn97RuL2w2GrMnh96QPRaM4GR9xJ8sunH7OzHeD RYz5xv911Y7wFxQMkjHHnse6ZrJ/tUVyjq2jtMpS9FFI5CfzW/afsmj+0enJ+OhyKBI6NA8uA 3n+ElN9ddJfzUUgZ1F2gPT8vut+3aHgJjt/C7RcqPCkLk2RBwvRNIZkm36bWxaeGFC2B17ICN Gr7fH0+GCMUwUxIqxQIGI1fUa1mY7pzHXxu1gf1+Sih/FyLilgo6+AR1cdfaB/bXdqjCtIo59 WoR8kzf6FLTu7VKQUSPkLt2Dj8HkIerzIKohbytHehbyFVIL8MgnYghghxrJbIsRT3RBE6LTb rjMazolsFNDYf+3jNr/JxNA4bkL+d5zYRBUsBa6RIH48IyYnIri+f59v7lBH4Dx9NTvkXo2g/ 7/g3+xuMvUZP/vyu3t1mpqu/OX+eYAfLOsk4SmO3+Uqmw4NqXXXUe1ZyFTzZgSDBz3TVr2OJR R1+5IydrAROUSngBuBemTySQgupx+Dtsw7yTvLH57dfAmB5KJD9oU20DxaFP+6jsOhZ+qzsQ 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:296312 Archived-At: On Mon, 02 Dec 2024 09:33:51 +0200 Juri Linkov wrote: >> I've added a test but I'm somewhat dissatisfied with it. I wanted to >> essentially reproduce the behavior I see with the patch, described >> above. However, after killing buffer "foo", the message about no >> further expansion is from a user-error in dabbrev-expand, and on hitting >> this in the test run, the test immediately finishes. So I used >> should-error with :type 'user-error and the test succeeds, but I cannot >> test for the final buffer content nor the message displayed by >> user-error. If anyone has an idea how to do that or otherwise improve >> the test, please chime in. > > Probably 'condition-case' could help to catch a user-error. > Or maybe better to set a buffer-local or let-bind 'command-error-function' > like e.g. in 'minibuffer-error-initialize'. > > Then you can let-bind 'set-message-function' to catch a message > to check it (but I don't remember if the error calls the message function). > > OTOH, I don't understand why the test immediately finishes after 'should-error'? > There are many tests that call 'should-error' sequentially like: > > (ert-deftest abbrev-table-empty-p-test () > (should-error (abbrev-table-empty-p 42)) > (should-error (abbrev-table-empty-p "aoeu")) > (should-error (abbrev-table-empty-p '())) > (should-error (abbrev-table-empty-p [])) > > And indeed implementation of 'should-error' already has 'condition-case'. Thanks very much for the feedback. I was wrong about the test immediately finishing after `should-error'; I guess I misread or misunderstood the output of the batch run. Additionally, there was a typo in the test of the final buffer content, which caused it to fail, and that probably confused me further. As for testing the error message, I overlooked that `should-error' returns an error description containing the message, so that seems the simplest way to do it. With these changes the test succeeds in batch runs and I think now better reflects the user experience with manual input, so I went ahead and pushed the fix (commit 6bca138d60e to emacs-30). If you agree, feel free to close the bug again (assuming it needs to be reclosed, since you unarchived it); otherwise, if you see other problems with the test, please let me know. Steve Berman