From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= Newsgroups: gmane.emacs.devel Subject: Re: Insight into the mystery hangs Date: Wed, 14 Feb 2024 00:05:04 +0100 Message-ID: <8734twartr.fsf@gmail.com> References: <20240211213737.3A38C18A1647@snark.thyrsus.com> <868r3psv2s.fsf@gnu.org> <871q9gg5sp.fsf@gmail.com> <8634twr08q.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22909"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: esr@thyrsus.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 14 00:06:03 2024 Return-path: Envelope-to: ged-emacs-devel@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 1ra1ql-0005l6-7G for ged-emacs-devel@m.gmane-mx.org; Wed, 14 Feb 2024 00:06:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ra1pw-0003sd-Bz; Tue, 13 Feb 2024 18:05:12 -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 1ra1pu-0003sF-F9 for emacs-devel@gnu.org; Tue, 13 Feb 2024 18:05:10 -0500 Original-Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ra1ps-0000Z3-Je; Tue, 13 Feb 2024 18:05:10 -0500 Original-Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3394ca0c874so3315445f8f.2; Tue, 13 Feb 2024 15:05:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707865506; x=1708470306; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dI/OfpeeVaTEeo1FFfrK8lC/TCFEHV5iBamtyNaIk+Y=; b=J7GGoFMHlEI5WofMQ+pPOflULEw6ZBKYaUZ8qFSAw3kjMbvMbF7ZuTcMKHLEbwHHMb 4JwGj2vQ4vFaLKKPiipYu2CMhzhxBG8Vd6h8+alSffq6Vysfuy0wPPucXtAl9kmpC/fc Zmf9Q12RRlIJT7Mf2OnqGZwNT39jsF0RB7kEreuHcIEkj0VeZMDiOIP+a8jP8GcI4kX6 GP1I8nYZjDTqRFGCD4bhDonEJajO1wipi7RLmyafvErTWN5h/Dlm9mHssHzj40kR5vgt kcU70997DWnJVBEIpVt+DmOnP7XdEcwwZB0uuJoA5JcHEKbFTu+pJz2jjW5n/2Hns3N8 Lt9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707865506; x=1708470306; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=dI/OfpeeVaTEeo1FFfrK8lC/TCFEHV5iBamtyNaIk+Y=; b=Pm8+ygiJHvRk2mN7cjckYittzrJKVikBUlfE4ed/AvD8RrS8p885miGEx8oHKArri7 BnhTDxOGTNVrgeKU0s+XexudebsjfLNOg1RBpG7dCP7KhSrrVD/5jukpmmglFhOcYzgs gKzIH3xveOKc8BeymZwkJ2+mfh+DPYk1egD8lfeUwlwFcB6gTD9+1nLxlKzB9sBLr+Ca ZnR8w3/hqgPMLL9pJOwCnoQC1iaYfrjJ1hgaWSL2p73GhqgK9aVfVS34H8VgRt9Mpibu EElSNQJOUuFeSu0Q1Qc647JUMJcGhezzHrusj306vIzunm3jsdPESex81Mslvk/z68ox 0iuA== X-Forwarded-Encrypted: i=1; AJvYcCWRSuelq7I5uDNMmVPU2uV/pv2TD0pW7bVPoEbqZhh45jyK6e2RYG1H02YYO9HFIyNcK3cZf6FlPW6t1I1E0MX9qmpn X-Gm-Message-State: AOJu0YwEEq90NUdmlDMq87PHJR8I8d4EieDGqjAL4QKsUBGF9aYJpuUX fkaoMCbq8Xzku3edw1olR9OVszpyziWSsywvnBLGDij2xNNXlgl2Mcs1f/zu X-Google-Smtp-Source: AGHT+IFvIjMnWxLlKEXXaJRYwpq2lxrqgyvUhfrg/xcjnmdPuwCDimJrfdJTMse8xR/cBx72tXF86Q== X-Received: by 2002:adf:f08d:0:b0:33b:139e:9110 with SMTP id n13-20020adff08d000000b0033b139e9110mr520237wro.36.1707865505501; Tue, 13 Feb 2024 15:05:05 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXn6uEEfc38Nr85p7lpLBbDK3GEmHIHKfnUdOztm4pimaKKPm1JvTHj5MjrjbCFmv8aI8i2oEhq4UPbQAVvyVibpBIS Original-Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id fm7-20020a05600c0c0700b00411062c123esm128752wmb.26.2024.02.13.15.05.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 15:05:04 -0800 (PST) In-Reply-To: <8634twr08q.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 13 Feb 2024 14:56:37 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=kevin.legouguec@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316191 Archived-At: Eli Zaretskii writes: >> From: K=C3=A9vin Le Gouguec >> Cc: "Eric S. Raymond" , emacs-devel@gnu.org >> Date: Tue, 13 Feb 2024 08:52:06 +0100 >>=20 >> Eli Zaretskii writes: >>=20 >> > Isn't that call issued from the mode-line display? If so, that is >> > done from redisplay, and redisplay cannot enter debugger, so it >> > catches all errors. If you want to produce Lisp backtraces from Lisp >> > code called by redisplay, you need to use the facilities documented in >> > the node "Debugging Redisplay" in the ELisp Reference manual. >>=20 >> Tangential, not so much about debugging errors during redisplay, than >> merely noticing them: I do periodically forget that these errors are >> caught, so every couple of months I find myself frowning at code >> (font-locking, usually) that misbehaves yet fails to throw an error for >> about five minutes, before remembering to check *Messages* for any >> "Error during redisplay". > > Yes, something to keep in mind. > >> 1. "For Science", I just did=E2=80=A6 >>=20 >> (setq mode-line-format '(:eval (error "argh"))) >>=20 >> =E2=80=A6 and I am surprised that this *Messages* diagnostic=E2=80=A6 >>=20 >> > Error during redisplay: (eval (error "argh") t) signaled (error "a= rgh") >>=20 >> =E2=80=A6 never seems to make its way to the echo area? It's a small= thing >> (I'll probably have *Messages* open when debugging so I'll notice >> eventually) but it is somewhat surprising that these warnings can >> pile up in *Messages* yet the echo area remains blank. > > Question: what happens when a message is shown in the echo-area? > Answer: Emacs triggers redisplay. Ah, yes; it would, wouldn't it =F0=9F=A5=B2 > Question: what happens in redisplay which was triggered by error > message shown in the echo-area because of error during redisplay? > Answer: the same error during redisplay will happen again, as part of > the new redisplay cycle. > Question: what will this do to Emacs? > Answer: a never-ending sequence of error, displaying an error message, > which causes another error, which displays the same error message, > which causes the same error, etc. etc., ad nauseam. > Question: what will the user see? > Answer: a never-ending sequence of rapidly blinking windows, and an > Emacs session that is unusable. >> 2. It's neat that=E2=80=A6 >>=20 >> (setq mode-line-format '("foo " (:eval (error "argh")) " bar")) >>=20 >> =E2=80=A6 will be "robust" enough to display "foo bar" in the mode-li= ne; >> combined with the lack of echo-area reporting it does make it hard to >> ever know something went wrong though. > > Where ignoring the problematic result can help us recover (at a price > of botching the trouble-making Lisp), we do that. > >> Might it make sense to (have an option to) substitute a signaling >> :eval form with some "[redisplay error]" placeholder? > > You mean, display the error on the mode line or something? We > actually do that in some simple cases, but the problem is that the > mode line has too little real-estate to show enough information > without catastrophically wiping everything else. But if you want to > work on a feature whereby a redisplay error adds some button on the > mode line which, if pressed, will show the *Messages* buffer with the > details, feel free. Right, I think this is where my mind was going with this (taking observations 1 and 2 into account). > Just be aware of the following gotcha: changing > how the mode line looks will also trigger a kind of redisplay. Thanks for taking the time to spell all of this out. I guess at the moment I can't think of anything smarter than e.g. * a boolean set by redisplay when it catches an error, * a mode-line construct that shows a button when the boolean is set, * the button offering a mouse binding to clear the boolean, and another to visit *Messages*. Of course (a) the construct might be "late" by one redisplay cycle, if it is processed before the error is raised in the same cycle (b) redisplay might reset the boolean immediately after the user clears it, if the cause of the original error persists (c) the boolean would remain set indefinitely after the cause has been fixed, until the user manually clears it. FWIW I wouldn't see this as much worse than the current situation, but then again, as my tangent's introduction implies, I don't experience redisplay errors that often (=E2=80=A6 or at least I don't notice them =F0= =9F=98=89). Again, thanks for your reply; appreciate the food for thought.