From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: Test succeeding only from edebug Date: Tue, 06 Aug 2024 03:49:09 +0200 Message-ID: <87a5hqifoq.fsf@web.de> References: <72b4a744-e622-4859-8ffa-7b0b59bc8a44@easy-emacs.de> <87le1bhtop.fsf@web.de> <35e7f181-19e4-407b-acf6-7014b6ce98af@easy-emacs.de> Reply-To: Michael Heerdegen Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17526"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:3x6IHroIzImqb/Uh0PdvuF/cjPw= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 06 03:48:57 2024 Return-path: Envelope-to: geh-help-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 1sb9Jo-0004PS-La for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 06 Aug 2024 03:48:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sb9JS-0002L8-1V; Mon, 05 Aug 2024 21:48:34 -0400 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 1sb9JP-0002Kx-2V for help-gnu-emacs@gnu.org; Mon, 05 Aug 2024 21:48:31 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sb9JN-00027c-7b for help-gnu-emacs@gnu.org; Mon, 05 Aug 2024 21:48:30 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1sb9JJ-00042v-Vg for help-gnu-emacs@gnu.org; Tue, 06 Aug 2024 03:48:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io 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, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147523 Archived-At: Andreas Röhler writes: > Here ist the test, which should remove all braces in buffer: > > (ert-deftest ar-trim-braced-in-region-test () >   (ar-test-with-elisp-buffer-point-min >       "{asdf} {asdf} {asdf}" >       (goto-char (point-min)) >       (set-mark (point)) >     (end-of-line) >     (ar-trim-braced-in-region-atpt) >     (should (eq (char-before) ?f)))) > > > Or fails compiled and interpreted? > > Usually don't compile my stuff. Ah ok...so there is no error, just the test fails. In my experience it is so that when something works correctly when edebugged but not when run normally, very often the code assumes a state that is only reached after a (or multiple) redisplay operations have been performed. When edebugging Emacs gets idle in situations when it is normally not (each time edebug stops). I'm not sure which part of your code could rely on such an assumption, I'm too tired atm too study all details. Could be font-locking that has not yet been performed - if your test makes use of font-lock features. If adding an explicit (redisplay) call at the end of the buffer setup in the definition of `ar-test-with-elisp-buffer-point-min' or before the `should' call helps then this would be it. In case of font-lock you would then want to call (font-lock-ensure) to force font-locking explicitly before Emacs gets idle. Please tell me if that helps to make any progress - else I try to have an even closer look tomorrow. Grüße, Michael.