From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#74090: 31.0.50; Problems with dabbrev-expand Date: Mon, 02 Dec 2024 09:33:51 +0200 Organization: LINKOV.NET Message-ID: <87ttbmim48.fsf@mail.linkov.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9299"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: Eli Zaretskii , 74090@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 02 08:45:37 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 1tI17g-0002Dz-Ua for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Dec 2024 08:45:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tI17D-0002jG-Fa; Mon, 02 Dec 2024 02:45:07 -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 1tI178-0002iL-SF for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 02:45:02 -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 1tI178-0004ff-C0 for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 02:45: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=E6RmxZ1H9F2hwLZxpZ2n3rm6kP0QWfGWww/BK7UDPzI=; b=FEUZu/3fPBZi94Ni2X1t1WrISxBmCPMuDSQkQu1L25P5cKSEsXL+AuAru13hO7KMN3joOyWec/wr41ZjXLyxUBO7A+G7DlX+JP7jUsKavP6n358VCgq4NhyNZLJguFimw9oYPzZNeSMXJS+jkyl8B5zTfdy/N2guaKMYaGdrwWYEcICt9dwW1SFcb1Cn5fQs8O5EWAsafPomxw5ICDX5qxDcGWPvrXtt+01Xu85YL0/t66FdwZAc+ydNxpQclUmejdRuhQT4BIAjYEzLV/D8+r7STaOA8l+a31jwkmDdSHetLCAfo/OkZStx129U92Z2zQv1oHwQZJ6/GHBCKfebsw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tI178-0007WA-4d for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 02:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Dec 2024 07:45: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.173312545028788 (code B ref 74090); Mon, 02 Dec 2024 07:45:02 +0000 Original-Received: (at 74090) by debbugs.gnu.org; 2 Dec 2024 07:44:10 +0000 Original-Received: from localhost ([127.0.0.1]:54117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tI16I-0007UG-6E for submit@debbugs.gnu.org; Mon, 02 Dec 2024 02:44:10 -0500 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:49029) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tI16G-0007Tw-14 for 74090@debbugs.gnu.org; Mon, 02 Dec 2024 02:44:08 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 44C391C0008; Mon, 2 Dec 2024 07:44:00 +0000 (UTC) In-Reply-To: <87jzcke4n6.fsf@gmx.net> (Stephen Berman's message of "Sat, 30 Nov 2024 23:30:21 +0100") X-GND-Sasl: juri@linkov.net 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:296302 Archived-At: > 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'.