From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Sausner Newsgroups: gmane.emacs.bugs Subject: bug#52003: Unexpected advising behavior due to recursive implementation Date: Sun, 21 Nov 2021 17:29:36 +0000 Message-ID: <18a2668d-746e-24e7-06fd-f87904a3e7ca@posteo.de> References: <43094E20-7F74-4CE0-ABE7-4348ADFFFCE0@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26331"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52003@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 21 18:30:17 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 1moqfR-0006ck-GJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Nov 2021 18:30:17 +0100 Original-Received: from localhost ([::1]:50850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1moqfQ-0003Br-G3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Nov 2021 12:30:16 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moqfC-000380-Ly for bug-gnu-emacs@gnu.org; Sun, 21 Nov 2021 12:30:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34368) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moqfC-0002Pf-C5 for bug-gnu-emacs@gnu.org; Sun, 21 Nov 2021 12:30:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1moqfC-0001Vs-7f for bug-gnu-emacs@gnu.org; Sun, 21 Nov 2021 12:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Sausner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Nov 2021 17:30: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.16375157885765 (code B ref 52003); Sun, 21 Nov 2021 17:30:02 +0000 Original-Received: (at 52003) by debbugs.gnu.org; 21 Nov 2021 17:29:48 +0000 Original-Received: from localhost ([127.0.0.1]:45914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moqex-0001Uv-Lc for submit@debbugs.gnu.org; Sun, 21 Nov 2021 12:29:47 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:45255) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moqeu-0001Uf-TN for 52003@debbugs.gnu.org; Sun, 21 Nov 2021 12:29:46 -0500 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 5AD51240104 for <52003@debbugs.gnu.org>; Sun, 21 Nov 2021 18:29:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1637515778; bh=zPhQaY6QulJo2Rq9rz2irX66H8VdIHYogeRgfzLQ1BE=; h=Subject:To:Cc:From:Date:From; b=OiBaPsACViStcjcBPVb0xRnX9nniv+xWvV2DsJ+EB/kA35r9pqC5URGnLNuTN5Kbx +69Oaqe4fxaEZ8JyglWOiQIuoRw7Nf+Da3kWaJQo/6z1oNdGmf39QTXLpymK2pNl5e DrufVYUzdqwkdhAB7GES6T4/t80k8T1AIdEnJrDwsKPU74NUrJAbFSxAEQO2N3yWOI zh7IYiWEgDbdWIG1hP0yjNVFYxODiH06av+xor05MoV3vVRPuHxa8BBRB2esUP5dIi 02WArybJStdQng307fSxe3MBJ4mGn+oaRdzwlLWc+PwkZGG0s52K0DMUkihxMd0W0v P/9bvTig1PxRA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Hxy812Z21z9rxG; Sun, 21 Nov 2021 18:29:37 +0100 (CET) In-Reply-To: Content-Language: de-DE 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:220572 Archived-At: > Yes but what would that mean? The best we can do is to promise that a function F, when called in a manner consistent with the documentation, behaves accordingly. We cannot guarantee the absence of calls to F, can we? > > But unless I'm mistaken, that's what you are unhappy about: `forward-sexp` may call itself when you call it. A lot of other code calls that function as part of their implementation. Don't they cause trouble, or is it just the recursive call? Well, my initial concern was the (new) recursive call, which adds another layer of complexity for advising. I now see too that an advice on such a deep rooted function is kind of madness anyway. In fact I would need to make a distinction between the interactive modes both ways. > What are you trying to do? Can't you define a mode-specific forward-sexp-function? The problem I'm trying to solve is, that the cursor in evil normal state is not between chars but _on_ a char. Moving to the end of a sexp in lisp I would expect the cursor to be on the closing paren instead of behind it. There was already an advice planted on `elisp--precedent-sexp` to achieve this effect for `eval-last-sexp`. It basically only moves the point one char forward if in normal mode before eval-last-sexp, hence the sexp including the paren on which the cursor rests will be evaluated instead of the thing before the cursor/paren. I wanted to transport this behaviour to the motion-sexp commands and initially I was naive enough to think that this is a low hanging fruit, because I could take the same advice function and add it to backward/forward-sexp. In essence I would like to move the visible cursor by a single char in one or the other direction before and after one or more `forward-sexp`-based commands are executed. But I'm not sure anymore if this is really worth the effort :-)