From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#52003: Unexpected advising behavior due to recursive implementation Date: Sat, 20 Nov 2021 20:16:43 +0100 Message-ID: <43094E20-7F74-4CE0-ABE7-4348ADFFFCE0@acm.org> References: <9f9a3c25-c473-ce45-9293-9754b8bcc113@posteo.de> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33256"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52003@debbugs.gnu.org To: Daniel Sausner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 20 20:17:25 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 1moVrX-0008Mp-Hu for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Nov 2021 20:17:23 +0100 Original-Received: from localhost ([::1]:44902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1moVrU-0006fm-CE for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Nov 2021 14:17:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moVrC-0006X5-PJ for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 14:17:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moVrC-0004z9-Gq for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 14:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1moVrC-0003kN-Cn for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 14:17:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <9f9a3c25-c473-ce45-9293-9754b8bcc113@posteo.de> Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Nov 2021 19:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52003 X-GNU-PR-Package: emacs Original-Received: via spool by 52003-submit@debbugs.gnu.org id=B52003.163743581614376 (code B ref 52003); Sat, 20 Nov 2021 19:17:02 +0000 Original-Received: (at 52003) by debbugs.gnu.org; 20 Nov 2021 19:16:56 +0000 Original-Received: from localhost ([127.0.0.1]:43684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moVr6-0003jn-LJ for submit@debbugs.gnu.org; Sat, 20 Nov 2021 14:16:56 -0500 Original-Received: from mail1447c50.megamailservers.eu ([91.136.14.47]:47798 helo=mail265c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moVr2-0003jQ-Rl for 52003@debbugs.gnu.org; Sat, 20 Nov 2021 14:16:55 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1637435805; bh=0mOrNWsI9hu2AeF4E2HLc+YkoeYQ2AHrMVtTsXGoIJg=; h=From:Subject:Date:Cc:To:From; b=g4jmpe7ckHjykcdpLqY7jXS55sghYZ9bknY8ogsYYN/N+IPj7JoPLoK3y769lWVkl MhWuhKZqGlf/cX6FswUZzsXfwII2JrfhQITl+XZLNBOdgGJEUOVnLPx+ARLpPSGQXD MUPlSnnQyW2Suom9fP39wzwznRldrugunZK5/Xlg= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.tele2.se [188.150.171.71]) (authenticated bits=0) by mail265c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 1AKJGh3v004702; Sat, 20 Nov 2021 19:16:45 +0000 X-Mailer: Apple Mail (2.3445.104.21) X-CTCH-RefID: str=0001.0A742F15.6199499D.006F, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.4 cv=MIcDJOVl c=1 sm=1 tr=0 ts=6199499d a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=y9_8w6m7_nBXPDs2BXMA:9 a=CjuIK1q_8ugA:10 X-Origin-Country: SE 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:220517 Archived-At: Thanks for the report, and yes, it's true that the way interactive use = is managed makes advice hacks more interesting. Do remember that you are = always on your own when using advice; Emacs cannot reasonably promise = any compatibility on that level. That said, it would be straightforward to straighten out the control = flow by extracting the bulk of the code to a new (internal) function = which is called with or without `condition-case`. It would be slightly = slower since it entails an extra function call in the non-interactive = case, and forward-sexp and its ilk are workhorses in many language = modes. It may not matter much, of course. > I'm far from a lisp expert but my feeling is that the condition-case=20= > should only wrap the calls where things can actually go wrong. Oh, but in this case they can. Noninteractive calls expect the = scan-errors; interactive use does not. It is also possible for a a = forward-sexp-function to raise scan-error.