From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: bug in generator function with nested dash anaphoric macros Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Mar 2017 13:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 26073@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.148932511812049 (code B ref -1); Sun, 12 Mar 2017 13:26:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Mar 2017 13:25:18 +0000 Received: from localhost ([127.0.0.1]:52062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cn3Ur-00038G-O5 for submit@debbugs.gnu.org; Sun, 12 Mar 2017 09:25:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cn3Up-000383-Gl for submit@debbugs.gnu.org; Sun, 12 Mar 2017 09:25:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cn3Uj-0004kD-KQ for submit@debbugs.gnu.org; Sun, 12 Mar 2017 09:25:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56920) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cn3Uj-0004jy-Go for submit@debbugs.gnu.org; Sun, 12 Mar 2017 09:25:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cn3Ui-00017T-I2 for bug-gnu-emacs@gnu.org; Sun, 12 Mar 2017 09:25:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cn3Uh-0004iK-QN for bug-gnu-emacs@gnu.org; Sun, 12 Mar 2017 09:25:08 -0400 Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]:33109) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cn3Uh-0004h1-KK for bug-gnu-emacs@gnu.org; Sun, 12 Mar 2017 09:25:07 -0400 Received: by mail-pf0-x230.google.com with SMTP id w189so59157677pfb.0 for ; Sun, 12 Mar 2017 06:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=K0TQ4UcVnrPb5xXQKyQSvyDPrbrlqNJrDmLkj6v6pQY=; b=t0CoYf6k7rSIZRmGPtzUTM6huoQxFMqqfHkZEjTd87VQ2/EzH8mSJZVn2V5XyMaF6C SVW2Ye6QEINQ3PBrN8vXFsZYuDhslALlezur7hE+OzgiIr8gC0bqAFTIK5r2QuJ8ABfQ 12AL9Tb7XwK7ES3Um0Y5+ONMe5tp9wlKRoH751UUjsR5o/MwFwJ67p7TOAgQ0/4ZNLpW 3chvPTuiBxnCrO4IERAu8Yp7NsrmUZg0W3k/73Qn34uDrpMvBQ5Q05q3UbGFD1NPbjZM l26hc4oltAyHRQ14/e6BoJqCzbNr7FS+Lg7oOqf3YaFap5bQgdRW2uOu08Tewnkw7pnW vyoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=K0TQ4UcVnrPb5xXQKyQSvyDPrbrlqNJrDmLkj6v6pQY=; b=bZOvzj2L4q06YZYtTTqCz4MLXxdoqIKa+HihjvZAkMqq+MkmH1+YRmrZse0tpFEReA BIA49wppd+WGlHeJ8N6PZS+BjZHDcvrrvFQZ02mIcsAIa1mQLsAhhG4zs7KAIu+n8jhN NFXeQdYILHiaqQIWLXxR+TTgF76Ss83ZwGrsKqHpA/WAZJ1MmT8zv4hjjbA1GALrOni0 HyoZ31b28xwYvt0r7zgbRHWeSxyMMj649zKYKXC7L3FDh1xr8HgaU4klfK0ffzyEGvfv /LTgnuUSQ0rfDWEflynjBX1M7pioaPNXkv5ZeT18fFBo6OVPAfl0ziXfdwxHRZ0rcnD2 /G7w== X-Gm-Message-State: AMke39llqQh2fF2bj65pC6Z85hQcyA/UGY2q7Nj1Bti+LazcWO4+Y90xMVld7uORXxnIIEydZAmxnpSYu5NZEA== X-Received: by 10.84.232.131 with SMTP id i3mr40953894plk.172.1489325106380; Sun, 12 Mar 2017 06:25:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.176.176 with HTTP; Sun, 12 Mar 2017 06:25:06 -0700 (PDT) From: Paul Pogonyshev Date: Sun, 12 Mar 2017 14:25:06 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) To reproduce: (iter-do (y (funcall (iter-lambda (x) (--each x (let ((y (--map (- it) it))) (iter-yield y)))) '((1 2) ( 3 4)))) (print y)) This should print (-1 -2) and (-3 -4), but instead results in an error. If you comment out the `iter-yield' form, the example evaluates--- producing different output, of course, but at least without errors. This looks related to bug #26068, but is not fixed by the patch in that bug. It is likely related to that both nested dash forms use `it' variable, and it looks like the wrong (outer) `it' is passed to (- it). Paul From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: Simplified testcase References: In-Reply-To: Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Mar 2017 14:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 26073@debbugs.gnu.org Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.148932755416387 (code B ref 26073); Sun, 12 Mar 2017 14:06:02 +0000 Received: (at 26073) by debbugs.gnu.org; 12 Mar 2017 14:05:54 +0000 Received: from localhost ([127.0.0.1]:52728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cn48A-0004GF-IY for submit@debbugs.gnu.org; Sun, 12 Mar 2017 10:05:54 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:34216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cn489-0004G2-Md for 26073@debbugs.gnu.org; Sun, 12 Mar 2017 10:05:54 -0400 Received: by mail-pf0-f177.google.com with SMTP id v190so59358721pfb.1 for <26073@debbugs.gnu.org>; Sun, 12 Mar 2017 07:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=ul+/PxexUfwwwj1mo7q/PXF3e34jcvcwdS9owquDLX8=; b=Rv6Qj/ymPhk4BPTmqWPhhypi/eTy33CUrkv6E86h3ZbdxpgAK9WZ+CHPxju0oT+zEF CEnuySmYoYEsnWMFJAaYqDTyqpVi4mOcxQP4OLQJdxGRh+36GKb+9JdX+X5qDi+gqD2m dA6LNCsjQgTJUDFOX7qaNuoU7/xAx3zP/UlbwEhhx33moaVSHoGpqwQ+emgCjXw7viwA zkc5v9nu0i5JkWahx+dUxiw7PkcH2Z3PLOfMIA+zImph+PruCvYGyB/1APnH7O6wIcas 8bFGtJ/a5qKCtkS7QDeDC8k5kEiskp+GUt88UiKk9er5tW4HgF4hnAjJGwbLVQrxK/mu xogQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ul+/PxexUfwwwj1mo7q/PXF3e34jcvcwdS9owquDLX8=; b=gPpfeDpBbWNf9xhzIG2y9mXoJRjSMOId0VE+LEZv5Q+2MFWeohcCOOI+3Dyht1RmQz NVb2qIkFCNMnzRv2jeIz6xLSNnhs/ub8J+V3VjuL3/n8DDgSmHEjDOvzx/FCF0nR9gVT ARysp+v9UCqq51mKm7NRwg6Cr+2WuM0dh0HH19ONIxP0y71Qk87KoYrU0HoDkdT92UeN 4+c49LwtYl8Bl832iEblM8n8j9EBgKYDLNZVkSAkILUtpJPxJVgJUtipog8bzJxaYnFj gQCvFNPkoCXKZyVvpsyWMFO5aKEJb7fOInkWeqbP/DY9GB/1sU1uEjTlCFEacUGX5t7Q Jq9g== X-Gm-Message-State: AMke39nzG7zLyBe6b9+layNSZbbb7QWpfHvr86KUIEjIbtWzNng73Q8is6mOHsgWU7uvQD6urSTi+Nb3xsjT7w== X-Received: by 10.98.82.216 with SMTP id g207mr32458693pfb.139.1489327547808; Sun, 12 Mar 2017 07:05:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.176.176 with HTTP; Sun, 12 Mar 2017 07:05:47 -0700 (PDT) From: Paul Pogonyshev Date: Sun, 12 Mar 2017 15:05:47 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) This form should evaluate to -2: (iter-next (funcall (iter-lambda () (let ((it 1)) (iter-yield (funcall (lambda (it) (- it)) (1+ it))))))) However, it evaluates to -1 instead. From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround References: In-Reply-To: Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Mar 2017 19:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 26073@debbugs.gnu.org Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.148995192711845 (code B ref 26073); Sun, 19 Mar 2017 19:33:01 +0000 Received: (at 26073) by debbugs.gnu.org; 19 Mar 2017 19:32:07 +0000 Received: from localhost ([127.0.0.1]:35469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpgYh-00034z-KF for submit@debbugs.gnu.org; Sun, 19 Mar 2017 15:32:07 -0400 Received: from mail-pg0-f46.google.com ([74.125.83.46]:34473) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpgYf-00034S-9B for 26073@debbugs.gnu.org; Sun, 19 Mar 2017 15:32:05 -0400 Received: by mail-pg0-f46.google.com with SMTP id 21so33483833pgg.1 for <26073@debbugs.gnu.org>; Sun, 19 Mar 2017 12:32:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=mqEfefBZzrzjRR+1xPKs90Yr131399QCc/FtzMkvu7M=; b=LrMcT8h45SjLYisqvY4CVA7jklR/sKAPT5oJrEE7zwx9qQIOD0nUZqVQmcGDs8KSrr jD2oHmGtPVA+0cQEyx8/ANRd43MZ6WVfYp6x1dAVL6EU4y1Eht664V75zDlWlm9MrRtX Km41OvTlPcTLYeO+5vXzWDIKkSYgBSxU4mBXPJJyLxOOTfCE9nWXiH4HgyhCASGG8wOE eZrRSpGpeBl79K2m/+gVhGJamXkHU9mMJXPuYxtHqXEcU8W/aw7/bxKuFz9mpnKf+aXb Vq7/qEc1dJLYLudXq6c61ouqMGzgJhvDMEsq1h3DZsYaE4KZYQ/TxfTEmSyA/433hSRu VP+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=mqEfefBZzrzjRR+1xPKs90Yr131399QCc/FtzMkvu7M=; b=jE+4VIsSvRm/fkzzpsP4pnGxcBHERBU9Z+JQSf77roXMGNA2imEp31OkFHjtB4xXrD KJ5+8FZqwtU2xLmrXFJNCeF+6ssj54CisDsfvhgR4ql8EreOJTWZJ1cioVRS1KpGjMn2 Edw1OQu1Qht6N6MZYDcDodZ9IjIiPabZzKM8ZcqILtgf30+BZjX6EiogIQ3s23EmczyO PrrzfbdXcVUBp6veQ8LPOcwIUAy0rM2F8qt2cBONIMsyB56S90OirZNbR4YHLVrfY4a+ egDeWsgc1G+Ech/EmDE56BlnxHda7MNhV5V8V1bKLfLvA0Sti0al7fUIHSI4v3uVNaxq ZocA== X-Gm-Message-State: AFeK/H1hgYHkoJ2Q//S/bB0CiDjR/+4sK+jPtbWF2BknQtpvrOO6+r8kqICBkOYfkNYnOm6lf4uBzijnZOzomA== X-Received: by 10.98.196.12 with SMTP id y12mr28570328pff.49.1489951919156; Sun, 19 Mar 2017 12:31:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.138.13 with HTTP; Sun, 19 Mar 2017 12:31:58 -0700 (PDT) From: Paul Pogonyshev Date: Sun, 19 Mar 2017 20:31:58 +0100 Message-ID: Content-Type: multipart/mixed; boundary=94eb2c142220e0186f054b1a76f6 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --94eb2c142220e0186f054b1a76f6 Content-Type: text/plain; charset=UTF-8 Attached patch is a workaround for the bug. It adds special handling of lambdas to `cl--sm-macroexpand', similar to the way it handles `let'. However, there is an unhandled case of "binding" symbols to forms. I'm also not sure what would be correct behavior in old non-lexical-scope code (do we still care?). So, this patch cannot really go in as-is, but it can serve as a base for a real fix. --94eb2c142220e0186f054b1a76f6 Content-Type: text/x-patch; charset=US-ASCII; name="0001-Fix-for-rebinding-in-lambdas-in-generator-functions.patch" Content-Disposition: attachment; filename="0001-Fix-for-rebinding-in-lambdas-in-generator-functions.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j0h2svda0 ZGlmZiAtLWdpdCBhL2xpc3AvZW1hY3MtbGlzcC9jbC1tYWNzLmVsIGIvbGlzcC9lbWFjcy1saXNw L2NsLW1hY3MuZWwKaW5kZXggNThiY2RkNTJhYy4uNTJkOTQ2YTBjMCAxMDA2NDQKLS0tIGEvbGlz cC9lbWFjcy1saXNwL2NsLW1hY3MuZWwKKysrIGIvbGlzcC9lbWFjcy1saXNwL2NsLW1hY3MuZWwK QEAgLTIwOTIsNiArMjA5MiwyMSBAQCBleGNlcHQgdGhhdCBpdCBhZGRpdGlvbmFsbHkgZXhwYW5k cyBzeW1ib2wgbWFjcm9zLiIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNhciBl eHApKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsKG5yZXZlcnNlIG5icykKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgLEBib2R5KSkpKSkKKyAgICAgICAgICAgIChgKGZ1bmN0 aW9uIChsYW1iZGEgLiAsKG9yIGAoLHBhcmFtcyAuICxib2R5KSBfZG9udGNhcmUpKSkKKyAgICAg ICAgICAgICAobGV0IChmb3VuZCBuYnMpCisgICAgICAgICAgICAgICAoZG9saXN0IChwYXJhbSBw YXJhbXMpCisgICAgICAgICAgICAgICAgIChsZXQqICgoc20gKGFzc3EgcGFyYW0gZW52KSkpCisg ICAgICAgICAgICAgICAgICAgKHB1c2ggKGlmIChub3QgKGNkciBzbSkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHBhcmFtCisgICAgICAgICAgICAgICAgICAgICAgICAgICAobGV0ICgo bmV4cCAoY2FkciBzbSkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2V0cSBmb3Vu ZCB0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5sZXNzIChzeW1ib2xwIG5leHAp IChlcnJvciAiRklYTUUiKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV4cCkpCisg ICAgICAgICAgICAgICAgICAgICAgICAgbmJzKSkpCisgICAgICAgICAgICAgICAod2hlbiBmb3Vu ZAorICAgICAgICAgICAgICAgICAoc2V0cSBleHAgYChmdW5jdGlvbiAobGFtYmRhCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLChucmV2ZXJzZSBuYnMpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLEBib2R5KSkpKSkpCiAgICAgICAgICAg ICA7OyBGSVhNRTogVGhlIGJlaGF2aW9yIG9mIENMIG1hZGUgc2Vuc2UgaW4gYSBkeW5hbWljYWxs eSBzY29wZWQKICAgICAgICAgICAgIDs7IGxhbmd1YWdlLCBidXQgZm9yIGxleGljYWwgc2NvcGlu ZywgQ29tbW9uLUxpc3AncyBiZWhhdmlvciBtaWdodAogICAgICAgICAgICAgOzsgbWFrZSBtb3Jl IHNlbnNlIChhbmQgaW5kZWVkLCBDTCBiZWhhdmVzIGxpa2UgQ29tbW9uLUxpc3Agdy5yLnQK --94eb2c142220e0186f054b1a76f6-- From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Mar 2017 00:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Paul Pogonyshev Cc: 26073@debbugs.gnu.org Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.148997100116984 (code B ref 26073); Mon, 20 Mar 2017 00:50:02 +0000 Received: (at 26073) by debbugs.gnu.org; 20 Mar 2017 00:50:01 +0000 Received: from localhost ([127.0.0.1]:35686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cplWK-0004Pr-US for submit@debbugs.gnu.org; Sun, 19 Mar 2017 20:50:01 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:22893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cplWJ-0004Pf-Lz for 26073@debbugs.gnu.org; Sun, 19 Mar 2017 20:50:00 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0C/CgAYJs9Y/yTkr2xcGwEBAQMBAQEJAQEBg1FBihWFeZBmKQGXJ4YcBAICgwBEFAECAQEBAQEBAWsohRYBBAFWIwULCzQSFBgNJIoLCLRrij0BAQEBBgImiz2KOQEEnE2UJohkhmSSFIFENiGBBCMWCCyHNCSKPwEBAQ X-IPAS-Result: A0C/CgAYJs9Y/yTkr2xcGwEBAQMBAQEJAQEBg1FBihWFeZBmKQGXJ4YcBAICgwBEFAECAQEBAQEBAWsohRYBBAFWIwULCzQSFBgNJIoLCLRrij0BAQEBBgImiz2KOQEEnE2UJohkhmSSFIFENiGBBCMWCCyHNCSKPwEBAQ X-IronPort-AV: E=Sophos;i="5.36,191,1486443600"; d="scan'208";a="295827612" Received: from 108-175-228-36.dsl.teksavvy.com (HELO ceviche.home) ([108.175.228.36]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Mar 2017 20:49:52 -0400 Received: by ceviche.home (Postfix, from userid 20848) id DAF27661C2; Sun, 19 Mar 2017 20:49:51 -0400 (EDT) From: Stefan Monnier Message-ID: References: Date: Sun, 19 Mar 2017 20:49:51 -0400 In-Reply-To: (Paul Pogonyshev's message of "Sun, 19 Mar 2017 20:31:58 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Attached patch is a workaround for the bug. It adds special handling > of lambdas to `cl--sm-macroexpand', similar to the way it handles > `let'. However, there is an unhandled case of "binding" symbols to > forms. I'm also not sure what would be correct behavior in old > non-lexical-scope code (do we still care?). Hmm... I'm wondering why generator.el uses cl-symbol-macrolet like that, but indeed the precise behavior of cl-symbol-macrolet is currently a bit fishy. Stefan From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Mar 2017 09:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 26073@debbugs.gnu.org Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.149000066430870 (code B ref 26073); Mon, 20 Mar 2017 09:05:01 +0000 Received: (at 26073) by debbugs.gnu.org; 20 Mar 2017 09:04:24 +0000 Received: from localhost ([127.0.0.1]:35874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cptEm-00081p-7u for submit@debbugs.gnu.org; Mon, 20 Mar 2017 05:04:24 -0400 Received: from mail-pg0-f47.google.com ([74.125.83.47]:36273) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cptEk-00081d-BB for 26073@debbugs.gnu.org; Mon, 20 Mar 2017 05:04:23 -0400 Received: by mail-pg0-f47.google.com with SMTP id g2so73818045pge.3 for <26073@debbugs.gnu.org>; Mon, 20 Mar 2017 02:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NIskUCYAiF4mG5gy9joPkLg8IQWewg/ogiiUqpSeHHU=; b=YnaI/kw9tmOR/2phvGcV0WtvPcQjLYmKPh0MKSsiX2qsZqttwUQWn8a1yjqkeJ0hrE AECygUxpHFIIlqN6ykqnnPESiTQP4XKbDGWa0Rq/P82y2jEUVoXzWfqyHMgGmHBgSsQv zVhHy4OEFHrnI2nS94D2LWIa27vHwFI6IJx29tSrAfFcO8BRb07veuxd3/u/YnO2fOwy /vWAk+Fv1bOa3zDgyU/cyeie4jMOBaAC3uay+ZU8kfUOIxrZz7onKPjgxgw9pShqow4w Z2VZsv/+hPiTnojbX0N9+Fgow5+2xQxg/Rnr3a5pshBI+7AtRcBttN7wnH7Xbc3ihcKL V3Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NIskUCYAiF4mG5gy9joPkLg8IQWewg/ogiiUqpSeHHU=; b=qYexT5MCmiC4wk5W74YnvcYTOlzwfcZdWXz8FxAnPYdTtXH4nmO7d6EX3TWfqEmvhq zPEXywPU4L2aCeSstc6C3FnFkzu2o9Pp0oMb7Zx3eoO9Ze9f+lVUAg/LMsxxLGUm9bla 4KtesofTZChi38LHV+C7hO8rIYuuxlLV/Yu15cvqREGhKNrbugSc+P4bwwj2Qg6+KEul OXrNKP6X/91qc4qHS7Z5j0vNedz3+ZlpqsVpQUvMOXuHS3ivBjVZ0vgfJ/pytBvz6YgM s/jDDLElIb8WHDQjrswl2wYhYiVweshwbEadxVY0NE2xx0lPDzGSWFZ0VotgrC62QV5f SeZA== X-Gm-Message-State: AFeK/H1e21pyHldwondJoaxGh74QfbquFoZTfrj7yFcyMjCclKhOCitBrwzlSQnLuTXjd36676xtfNhOqRn8XA== X-Received: by 10.98.196.12 with SMTP id y12mr31332659pff.49.1490000656615; Mon, 20 Mar 2017 02:04:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.138.13 with HTTP; Mon, 20 Mar 2017 02:04:16 -0700 (PDT) In-Reply-To: References: From: Paul Pogonyshev Date: Mon, 20 Mar 2017 10:04:16 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -2.8 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) > I'm wondering why generator.el uses cl-symbol-macrolet like that Because that's how it works. It needs to store variables in an outer scope so that their values are preserved between calls to `iter-next' on the same iterator. Therefore it "rebinds" local variables to different symbol and declares those symbols in outer scope, so that they become non-local variables captured by resulting closures. It's not a problem within generator function builder, rather it's a bug in in `cl-symbol-macrolet' that incorrectly applies `bindings' to forms with lambdas. The bug is that it rebinds variables even inside `lambda', not realizing that they (at least in lexical scope) are shadowed by the lambda's arguments. In comparison, it does handle shadowing with `let' properly. Paul On 20 March 2017 at 01:49, Stefan Monnier wrote: >> Attached patch is a workaround for the bug. It adds special handling >> of lambdas to `cl--sm-macroexpand', similar to the way it handles >> `let'. However, there is an unhandled case of "binding" symbols to >> forms. I'm also not sure what would be correct behavior in old >> non-lexical-scope code (do we still care?). > > Hmm... I'm wondering why generator.el uses cl-symbol-macrolet like that, > but indeed the precise behavior of cl-symbol-macrolet is currently > a bit fishy. > > > Stefan From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Mar 2017 09:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 26073@debbugs.gnu.org Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.149000178632558 (code B ref 26073); Mon, 20 Mar 2017 09:24:02 +0000 Received: (at 26073) by debbugs.gnu.org; 20 Mar 2017 09:23:06 +0000 Received: from localhost ([127.0.0.1]:35881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cptWr-0008T4-Rg for submit@debbugs.gnu.org; Mon, 20 Mar 2017 05:23:05 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:36072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cptWp-0008SL-Oz for 26073@debbugs.gnu.org; Mon, 20 Mar 2017 05:23:04 -0400 Received: by mail-pg0-f48.google.com with SMTP id g2so74058573pge.3 for <26073@debbugs.gnu.org>; Mon, 20 Mar 2017 02:23:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tJedIy9bZwDBwkuUjnfSymvRE8qPhRWCLzzrpJ94BQo=; b=hhaY3IrqS6SbB3/uH6/TIXAM2ZCxK67LbhuuNLwxu1CUMEP4okCC1XsIp85z31gB6Z ARpByQgAgHzXlydNhBGPs08Jpc8tjAqJ4a3nnd+TfzgzaaPbZJAvYyYxaC+zE9zUL7Op IyWnM3v8eBsYPvluVAaBZg/Pc2I8WTaU3dykGTxUMVHgEjgZQHjSG/X0p98OtXcZ04aE 6waHci6MwoFfez9zAduC8Tceo6vm1boOKjwHJrDdsQwltHJ3NUhWPwESwWcjZbBlJOin piKDwqn9t195ZTozbs2iyXqxDLGPjN/aJj2aMyAOMQlLXInnX8N0N1QZ3Ev/xM8zy+Gz 6thA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tJedIy9bZwDBwkuUjnfSymvRE8qPhRWCLzzrpJ94BQo=; b=DwUChhkyDjlomi/LZZbd83cM7fSVLe1Q3PbxtiDi2dq8gJm8wra0P9amjgD7HzUz0B SAYabcMRWDcFwgSpPOA5Q/BFOOspVwHml143uCrWv6FPsRCLF2EN8Qa3Mid19BS/T8Wu kAo0VKj0MxFAxdYrJSAvk4ctUSXRFh2BP09tzNB8TKL9Jdefm8lR+iuW9kvDDMdrp7rZ ojA5V1dShbfr0YZmU3nODu68vZxO+3r3AlS1kWGcnCF46DTW1+9QkgKfLIi9E8xjERG0 +Mraj84gUAM3TAoUfezNa/hm9UQwblM5BbFY3win0hYqam4r6xXKNzQGJNJinpP2gW/+ kuUQ== X-Gm-Message-State: AFeK/H3O4yIelSD8o/aG8FPWY1tuAFKMUI+Koqr/mwL/YTW8hhY5Qizdxk0mqZ0A4tLYheJPI0lshjlilv35+g== X-Received: by 10.99.237.17 with SMTP id d17mr29381282pgi.82.1490001778032; Mon, 20 Mar 2017 02:22:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.138.13 with HTTP; Mon, 20 Mar 2017 02:22:57 -0700 (PDT) In-Reply-To: References: From: Paul Pogonyshev Date: Mon, 20 Mar 2017 10:22:57 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) To see the wrong expansion: (progn (pp (macroexpand-all '(cl-symbol-macrolet ((it xxx)) (let ((it 1)) (iter-yield (funcall (lambda (it) (- it)) (1+ it))))))) nil) Too see it in the generator function: (progn (pp (macroexpand-all '(cl-symbol-macrolet ((it xxx)) (iter-lambda () (let ((it 1)) (iter-yield (funcall (lambda (it) (- it)) (1+ it)))))))) nil) Particularly these lines are wrong in the latter: > #'(lambda > (it) > (- cps-binding-xxx-)) From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Mar 2017 13:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Paul Pogonyshev Cc: 26073@debbugs.gnu.org Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.149001631829693 (code B ref 26073); Mon, 20 Mar 2017 13:26:02 +0000 Received: (at 26073) by debbugs.gnu.org; 20 Mar 2017 13:25:18 +0000 Received: from localhost ([127.0.0.1]:35962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpxJG-0007iq-3R for submit@debbugs.gnu.org; Mon, 20 Mar 2017 09:25:18 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:55140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpxJE-0007ie-79 for 26073@debbugs.gnu.org; Mon, 20 Mar 2017 09:25:17 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BODABY189Y/yTkr2xeGwEBAQMBAQEJAQEBg1FBhD6FWIV5kGkpAZcnhhwEAgKDB0QUAQIBAQEBAQEBayiFFgEEAVYjBQsLNBIUGA0kLoldCLNcikYBAQEBBgImiz2KOQEEnE2dCoZkkhSBRDYhgQQjFggshzQkiigBAQE X-IPAS-Result: A0BODABY189Y/yTkr2xeGwEBAQMBAQEJAQEBg1FBhD6FWIV5kGkpAZcnhhwEAgKDB0QUAQIBAQEBAQEBayiFFgEEAVYjBQsLNBIUGA0kLoldCLNcikYBAQEBBgImiz2KOQEEnE2dCoZkkhSBRDYhgQQjFggshzQkiigBAQE X-IronPort-AV: E=Sophos;i="5.36,194,1486443600"; d="scan'208";a="295885904" Received: from 108-175-228-36.dsl.teksavvy.com (HELO ceviche.home) ([108.175.228.36]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Mar 2017 09:25:07 -0400 Received: by ceviche.home (Postfix, from userid 20848) id A4C56661C2; Mon, 20 Mar 2017 09:25:01 -0400 (EDT) From: Stefan Monnier Message-ID: References: Date: Mon, 20 Mar 2017 09:25:01 -0400 In-Reply-To: (Paul Pogonyshev's message of "Mon, 20 Mar 2017 10:04:16 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> I'm wondering why generator.el uses cl-symbol-macrolet like that > Because that's how it works. It needs to store variables in an outer > scope so that their values are preserved between calls to `iter-next' > on the same iterator. Therefore it "rebinds" local variables to > different symbol and declares those symbols in outer scope, so that > they become non-local variables captured by resulting closures. Could you give me some concrete (but simple) example? > bug in in `cl-symbol-macrolet' that incorrectly applies `bindings' to > forms with lambdas. Yes, I understand this part of the problem (and fixing it should actually be easier than for `let` since in lexical-binding mode, all lambda args are lexically scoped, regardless of special-variable-p). [ Note: I haven't looked at your suggested patch, but I agree with your problem&solution description so your patch is probably right. ] Stefan From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Mar 2017 14:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 26073@debbugs.gnu.org Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.14900196662863 (code B ref 26073); Mon, 20 Mar 2017 14:22:01 +0000 Received: (at 26073) by debbugs.gnu.org; 20 Mar 2017 14:21:06 +0000 Received: from localhost ([127.0.0.1]:36482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpyBG-0000k7-0r for submit@debbugs.gnu.org; Mon, 20 Mar 2017 10:21:06 -0400 Received: from mail-pg0-f42.google.com ([74.125.83.42]:33647) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpyBE-0000jG-Kd for 26073@debbugs.gnu.org; Mon, 20 Mar 2017 10:21:04 -0400 Received: by mail-pg0-f42.google.com with SMTP id n190so78206515pga.0 for <26073@debbugs.gnu.org>; Mon, 20 Mar 2017 07:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ddGjUJEgbv9rS6h30RD7y7SOYRHsXzAkT6gXAsg3FZg=; b=M7ckST7z6gS7mxvkXvL7FxPuclt4jceMuFrMhEfBoKSf02IViW78TPIosm5wbd2kp1 x8NKUBEpczeEJztXCpAhDhVP1NyRJTrzK6hx1q5jam5/bUQhrbh8BoipOXqJJbtuEih8 HrrsPgNEQxKUefDvg8nNmQIyEh9QA3+DZb6NjyfmcWVrfaCLg/KGARiegFr5t42uqIKs hSdxbpkzV2GFaYGZhPSb3eNvZ5RAKCVP/jWiiOIGGxcpnhyJhqRdAHTPydU97IgqJUuM U5xlbGzMFVUqxzFi+reqYvlNF6Rv2bT7fwv/1Oy8j6/adbrLQKS+YCDCFtDgRchUikN7 E0TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ddGjUJEgbv9rS6h30RD7y7SOYRHsXzAkT6gXAsg3FZg=; b=GGZ9jwNHt8WPAUFpBZeFAfSTNSA5ijqmU3JdOy9YOwujaN7zMX+6sRkshQZnLh1SA6 ksDuVYkShTCmpjDR/ELaQOGoWPxJOrrfk9aBMRFvx9d70l/yv1YjOCB4YXlx8tDqR3bs YAOUmRp4183DUhHKD5P6Cca5JV9XgLQmpDuNMINI/sR/Aw5Vo5A36B/0wK29x+LYGlh7 LTVqAlb5esRNP3Bub3UGICCGpUlFNRwo3zXDeu7J/GySxGdai0Hzt5Me4QXCzNDUfpuS ac2+Y5Fzw38n9A6PClE9sHj48Ehld43+TG29b+U2m+B26t74J7yXmpoOXgJQtN7NqEEA L2Iw== X-Gm-Message-State: AFeK/H2LCpVCW6xKAZtZ830u5XDFJ2+UuAELRy6DZgFQSYeYhBXN3+9wRX+GlIelpfwa+njYmnUg1lmkS0/ZMA== X-Received: by 10.98.196.12 with SMTP id y12mr32989830pff.49.1490019658748; Mon, 20 Mar 2017 07:20:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.138.13 with HTTP; Mon, 20 Mar 2017 07:20:58 -0700 (PDT) In-Reply-To: References: From: Paul Pogonyshev Date: Mon, 20 Mar 2017 15:20:58 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > Could you give me some concrete (but simple) example? Basically, when you define a generator function (iter-defun foo () (let ((x (bar 1))) (iter-yield x) (iter-yield (+ x (bar 2))))) the resulting iterator must somehow preserve value of `x' after the first yield-point. Therefore, the iterator function will look something like this (simplified): (defun foo-iterator () (let* (outer-scope-x to-execute (step-1 (lambda () (setf to-execute step-2) (setf outer-scope-x (bar 1)) (throw 'yield outer-scope-x))) (step-2 (lambda () (throw 'yield (+ outer-scope-x (bar 2)))))) (setf to-execute step-1) (build-iterator-object ...))) Here `outer-scope-x' is the rebinding of `x' needed to somehow send its value from first step closure to the second. Iteration (let ((iter (foo-iterator))) (iter-next iter) (iter-next iter)) will then look like (omitting all the internal crap): (let ((iter (foo-iterator))) (call-to-execute iter) ; here to-execute = step-1 (call-to-execute iter)) ; here to-execute = step-2 But remember that the caller of `iter-next' knows nothing about how iterator internally works and has no idea what it really does and how it achieves the documented behavior (or doesn't, when there is a bug). Paul From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Sep 2017 14:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Paul Pogonyshev Cc: 26073@debbugs.gnu.org Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.150643672310792 (code B ref 26073); Tue, 26 Sep 2017 14:39:02 +0000 Received: (at 26073) by debbugs.gnu.org; 26 Sep 2017 14:38:43 +0000 Received: from localhost ([127.0.0.1]:33300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwr0V-0002nu-Iw for submit@debbugs.gnu.org; Tue, 26 Sep 2017 10:38:43 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:60172) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwr0S-0002ng-RH; Tue, 26 Sep 2017 10:38:42 -0400 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v8QEcal0008990; Tue, 26 Sep 2017 10:38:38 -0400 Received: by ceviche.home (Postfix, from userid 20848) id AACA766262; Tue, 26 Sep 2017 10:38:36 -0400 (EDT) From: Stefan Monnier Message-ID: References: Date: Tue, 26 Sep 2017 10:38:36 -0400 In-Reply-To: (Paul Pogonyshev's message of "Mon, 20 Mar 2017 10:22:57 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6124=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6124> : inlines <6090> : streams <1764695> : uri <2506894> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) retitle 26073 How should cl-symbol-macrolet interact with rebindings? thanks The problem here is indeed different from the one in bug#26068. bug#26068 was clearly triggering a (known) bug in cl-symbol-macrolet. Here it's triggering a (known) misfeature. The source code has the following comments about it: ;; CL's symbol-macrolet treats re-bindings as candidates for ;; expansion (turning the let into a letf if needed), contrary to ;; Common-Lisp where such re-bindings hide the symbol-macro. and ;; FIXME: The behavior of CL made sense in a dynamically scoped ;; language, but for lexical scoping, Common-Lisp's behavior might ;; make more sense (and indeed, CL behaves like Common-Lisp w.r.t ;; lexical-let), so maybe we should adjust the behavior based on ;; the use of lexical-binding. more concretely cl-symbol-macrolet implements the following semantics: (cl-symbol-macrolet ((x )) ... (let ((x )) ..x..)) => ... (cl-letf (( )) ....) whereas Common-Lisp's symbol-macrolet wants the following semantics instead: => ... (let ((x )) ..x..) As mentioned in the comment, it probably makes sense to change cl-symbol-macrolet in lexical-binding code to follow Common-Lisp's semantics (tho we'd want to give access to the old semantics if the user explicitly uses cl-letf). Not sure what might break if we do that: the main user of cl-symbol-macrolet outside of generator.el AFAIK is the with-slots of eieio, so the question is whether some users of with-slots expect a subsequent `let` binding to temporarily change the slot's value. I just checked and it seems that no code in Emacs itself relies on this behavior, so maybe it's "safe" to change it. Stefan From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Sep 2017 17:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 26073@debbugs.gnu.org Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.1506619094664 (code B ref 26073); Thu, 28 Sep 2017 17:19:01 +0000 Received: (at 26073) by debbugs.gnu.org; 28 Sep 2017 17:18:14 +0000 Received: from localhost ([127.0.0.1]:37019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxcRy-0000Ad-83 for submit@debbugs.gnu.org; Thu, 28 Sep 2017 13:18:14 -0400 Received: from mail-pg0-f49.google.com ([74.125.83.49]:48669) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxcRw-0000AR-4i for 26073@debbugs.gnu.org; Thu, 28 Sep 2017 13:18:13 -0400 Received: by mail-pg0-f49.google.com with SMTP id v23so1292475pgc.5 for <26073@debbugs.gnu.org>; Thu, 28 Sep 2017 10:18:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MuVE88IEu1Mthqn4uCnIdXLu4FYGfhoIIHJ0HlVeV2g=; b=sKoMXGoc0manu170JyVebgNGdvP8oRHUbSG9ajucyJ+OEhc+687595AmTuyOTuvb2u uif4q/kJN+gtJLHY5C2DNqDRxMWzKR3jlDckTOz94V5uuX7S9VT1fQlDS+5xBMabGvne 71o8kknCMtMmf3epZi/g1xcS/OVnQj+CFEm1zVwAxnDJcqjikF31bxR8FGUq53hsOcWQ WvANiKGfJCtC1n5Q7CUbAINJ5uIne40fKIxYREVEUhm1W6M46UAZUAbWxNNErp4NQBxu 1UQtNgkm9xtBD3ipohF6Um2/lABRt4v/zM6pXgJx0CAb8D7RHuHkI9imTOKnkdb4qBt+ W6Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=MuVE88IEu1Mthqn4uCnIdXLu4FYGfhoIIHJ0HlVeV2g=; b=nJ4uzyLLD8sGAWFCfc0gLjBNjz3km2Zir33UgPWoawDvNg9gRIyea9TS50p4nt75FN Bmj2EWU3YXoKXcRLkMI1JoXJ5gj1sPgmmhs3axQygti5MgC7eYZKYGlt2mBNl5EUywxI P4QtiCvkk/NuagifJwMCTRF54oytWfn5ZEdRTKXI0T6RSv2ZPFIOdQStMLVwVw2vf395 QdusXbZ2pij6NqmhQ9f4Pj5geB8WFdD+QBCgizq5IDPiLfIiU7VmCQBdokORDvfnHhTf ZW2gdcSDDUqz2FloNZ7Aisgzw2LGEbY9dbXA8FEShgpDFYiVENaBwY7VCJY+3UVGkTk5 A20w== X-Gm-Message-State: AHPjjUi1llaXZt1rnPmSnw89GMbssA3P4A31KarGYYxLYBpU2TFVrmPX 3i2xe5WePCdXDoyNSeKNFxcXDniz8aXVusUEeQ== X-Google-Smtp-Source: AOwi7QBIBB/zOscZz/lOFXzNK76bz59+YYlYYJ6g2EMj05z+CSngU8PPb6nzIvu6WhoXFGW6QZKmpmNgIAquNxLwV3Q= X-Received: by 10.99.141.74 with SMTP id z71mr4818431pgd.407.1506619086066; Thu, 28 Sep 2017 10:18:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.144.87 with HTTP; Thu, 28 Sep 2017 10:18:05 -0700 (PDT) In-Reply-To: References: From: Paul Pogonyshev Date: Thu, 28 Sep 2017 19:18:05 +0200 Message-ID: Content-Type: multipart/alternative; boundary="94eb2c03aca86fe01b055a431732" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --94eb2c03aca86fe01b055a431732 Content-Type: text/plain; charset="UTF-8" I frankly don't know how it should behave and whether fixing it for generators would break 'with-slots'. What I can see, however, is that generator functions with nested lambdas do not work properly. And you cannot realisctically say "don't use those", because lambdas can be just introduced by macros without you even thinking about it. And then the function unexpectedly produces wrong results without any hint of what might be wrong. Paul On 26 September 2017 at 16:38, Stefan Monnier wrote: > retitle 26073 How should cl-symbol-macrolet interact with rebindings? > thanks > > The problem here is indeed different from the one in bug#26068. > bug#26068 was clearly triggering a (known) bug in cl-symbol-macrolet. > > Here it's triggering a (known) misfeature. The source code has the > following comments about it: > > ;; CL's symbol-macrolet treats re-bindings as candidates for > ;; expansion (turning the let into a letf if needed), > contrary to > ;; Common-Lisp where such re-bindings hide the symbol-macro. > and > ;; FIXME: The behavior of CL made sense in a dynamically scoped > ;; language, but for lexical scoping, Common-Lisp's behavior > might > ;; make more sense (and indeed, CL behaves like Common-Lisp > w.r.t > ;; lexical-let), so maybe we should adjust the behavior based > on > ;; the use of lexical-binding. > > more concretely cl-symbol-macrolet implements the following semantics: > > (cl-symbol-macrolet ((x )) > ... (let ((x )) ..x..)) > => > ... (cl-letf (( )) ....) > > whereas Common-Lisp's symbol-macrolet wants the following semantics > instead: > > => ... (let ((x )) ..x..) > > As mentioned in the comment, it probably makes sense to change > cl-symbol-macrolet in lexical-binding code to follow Common-Lisp's > semantics (tho we'd want to give access to the old semantics if the user > explicitly uses cl-letf). > > Not sure what might break if we do that: the main user of > cl-symbol-macrolet outside of generator.el AFAIK is the with-slots of > eieio, so the question is whether some users of with-slots expect > a subsequent `let` binding to temporarily change the slot's value. > I just checked and it seems that no code in Emacs itself relies on this > behavior, so maybe it's "safe" to change it. > > > Stefan > --94eb2c03aca86fe01b055a431732 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I frankly don't know how it should behave and whether = fixing it for generators would break 'with-slots'. What I can see, = however, is that generator functions with nested lambdas do not work proper= ly. And you cannot realisctically say "don't use those", beca= use lambdas can be just introduced by macros without you even thinking abou= t it. And then the function unexpectedly produces wrong results without any= hint of what might be wrong.

Paul
<= /div>

On 26 Septem= ber 2017 at 16:38, Stefan Monnier <monnier@iro.umontreal.ca>= wrote:
retitle 26073 How should c= l-symbol-macrolet interact with rebindings?
thanks

The problem here is indeed different from the one in bug#26068.
bug#26068 was clearly triggering a (known) bug in cl-symbol-macrolet.

Here it's triggering a (known) misfeature.=C2=A0 The source code has th= e
following comments about it:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; CL's symbol-macrolet= treats re-bindings as candidates for
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; expansion (turning the l= et into a letf if needed), contrary to
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Common-Lisp where such r= e-bindings hide the symbol-macro.
and
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; FIXME: The behavior of CL made= sense in a dynamically scoped
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; language, but for lexical scop= ing, Common-Lisp's behavior might
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; make more sense (and indeed, C= L behaves like Common-Lisp w.r.t
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; lexical-let), so maybe we shou= ld adjust the behavior based on
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; the use of lexical-binding.
more concretely cl-symbol-macrolet implements the following semantics:

=C2=A0 =C2=A0 =C2=A0 (cl-symbol-macrolet ((x <e>))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ... (let ((x <foo>)) ..x..))
=C2=A0 =C2=A0 =3D>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ... (cl-letf ((<e> <foo>)) ..<e&= gt;..)

whereas Common-Lisp's symbol-macrolet wants the following semantics ins= tead:

=C2=A0 =C2=A0 =3D> ... (let ((x <foo>)) ..x..)

As mentioned in the comment, it probably makes sense to change
cl-symbol-macrolet in lexical-binding code to follow Common-Lisp's
semantics (tho we'd want to give access to the old semantics if the use= r
explicitly uses cl-letf).

Not sure what might break if we do that: the main user of
cl-symbol-macrolet outside of generator.el AFAIK is the with-slots of
eieio, so the question is whether some users of with-slots expect
a subsequent `let` binding to temporarily change the slot's value.
I just checked and it seems that no code in Emacs itself relies on this
behavior, so maybe it's "safe" to change it.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan

--94eb2c03aca86fe01b055a431732-- From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Sep 2017 19:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier , Paul Pogonyshev Cc: 26073@debbugs.gnu.org Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.150662756014034 (code B ref 26073); Thu, 28 Sep 2017 19:40:01 +0000 Received: (at 26073) by debbugs.gnu.org; 28 Sep 2017 19:39:20 +0000 Received: from localhost ([127.0.0.1]:37104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxeeW-0003eI-A3 for submit@debbugs.gnu.org; Thu, 28 Sep 2017 15:39:20 -0400 Received: from mail-oi0-f41.google.com ([209.85.218.41]:54479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxeeU-0003e5-Ov for 26073@debbugs.gnu.org; Thu, 28 Sep 2017 15:39:19 -0400 Received: by mail-oi0-f41.google.com with SMTP id u130so4052908oib.11 for <26073@debbugs.gnu.org>; Thu, 28 Sep 2017 12:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F0SsP3NUy0dnpefHNYbNoqH3WguRMiXoYef3RYvRNNA=; b=R3GeIejwcKqoyDgOyg3bOflLWgcIw+MW4nKEQMH7XxCb0aeSr9aOQwP5jGOQtfWRDb dV64i+6E6MLc4hohCSQtY/xzgkwJIYoAQkyMq4cphMEAjRMwKGKEpWIPb/KKdO/ckqU+ hjHXsWdzfrnrTg59bq2W1Z2PpyTAz7CUDl9+O3qwaDD4wtoUi7dQ86F91+BKeqMEMnpq wcej5Krk3vYsg2z0XRUCNy0RQ7Ob74XvyAnRafv7kY0yLqllgM6fplelYY1r3afJ9+qy t2uwLpSHLYqLg6HQ4fGPzVba6Gc5FpFpQBXo+5rq2/nmobVyeST6LwC1He0E6dM4wck0 vvxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F0SsP3NUy0dnpefHNYbNoqH3WguRMiXoYef3RYvRNNA=; b=ZgVWdTYe0LXkxdFf03Ba41UwJvDtVawEi2opu1oljyPHLQbamsAzITNuF48lSmyt/R MWliYqgLxH0EIFJj7yI4i36BlOeUIaJwG96J2o/g5lXmO+3ghiBd5uuiy8vQH5rbmJfh u18qkPkZJsPE/CqRO56vVq8tL02xiCb6CE+AkZ7V3zE/g7yFRJ0ZEOErSUuUyseSwDEW Gf+HMLEYSr/Us/8DOyI5+fpyexvdT4viFH/UxkEWO6PHk3FhWrg0E3EvCo7mkce6bRJ8 ka3GNCMWgg1wvm+NAwQ0dVRFUOxWFyoH0FSd2bR+VaX24TOYGgEkbpZ2n12I6+dLBnUW pJ2Q== X-Gm-Message-State: AMCzsaXLh6Umz3h3FwxDlK9/oXgm55Y0FaaQtMd5IeJ87tYMQfL7j1s+ rVrXqNZwHH0oaAB5YcZxqN4sKCRcjT0Md1T1tXY= X-Google-Smtp-Source: AOwi7QDc2qvoPPk3i4hYlGYheJxXhrXHf6MtzCGiXeYVwVOUv93qvIpgXt4C9R+DKtzw+8AbTei8b7qoI2OK5TskCU0= X-Received: by 10.202.229.5 with SMTP id c5mr1051967oih.82.1506627552871; Thu, 28 Sep 2017 12:39:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Stephani Date: Thu, 28 Sep 2017 19:39:02 +0000 Message-ID: Content-Type: multipart/alternative; boundary="001a1141a45c190980055a45104e" X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --001a1141a45c190980055a45104e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Stefan Monnier schrieb am Di., 26. Sep. 2017 um 16:47 Uhr: > > Not sure what might break if we do that: the main user of > cl-symbol-macrolet outside of generator.el AFAIK is the with-slots of > eieio, so the question is whether some users of with-slots expect > a subsequent `let` binding to temporarily change the slot's value. > I just checked and it seems that no code in Emacs itself relies on this > behavior, so maybe it's "safe" to change it. > At least the docstring of `with-slots' and the EIEIO manual both state: "Both =E2=80=98setf=E2=80=99 and =E2=80=98setq=E2=80=99 can be used to set = the value of the slot." In particular, it doesn't state that `let' can be used for this purpose. So as long as `setf' and `setq' continue working, I think it should be OK to change the behavior (it should still be documented as incompatible Lisp change though). --001a1141a45c190980055a45104e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Stefan= Monnier <monnier@iro.umontr= eal.ca> schrieb am Di., 26. Sep. 2017 um 16:47=C2=A0Uhr:

Not sure what might break if we do that: the main user of
cl-symbol-macrolet outside of generator.el AFAIK is the with-slots of
eieio, so the question is whether some users of with-slots expect
a subsequent `let` binding to temporarily change the slot's value.
I just checked and it seems that no code in Emacs itself relies on this
behavior, so maybe it's "safe" to change it.

At least the docstring of `with-slots'= and the EIEIO manual both state: "Both =E2=80=98setf=E2=80=99 and =E2= =80=98setq=E2=80=99 can be used to set the value of the slot." In part= icular, it doesn't state that `let' can be used for this purpose. S= o as long as `setf' and `setq' continue working, I think it should = be OK to change the behavior (it should still be documented as incompatible= Lisp change though).
--001a1141a45c190980055a45104e-- From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Sep 2017 20:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Paul Pogonyshev Cc: 26073@debbugs.gnu.org Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.150662924716814 (code B ref 26073); Thu, 28 Sep 2017 20:08:02 +0000 Received: (at 26073) by debbugs.gnu.org; 28 Sep 2017 20:07:27 +0000 Received: from localhost ([127.0.0.1]:37166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxf5j-0004N8-JP for submit@debbugs.gnu.org; Thu, 28 Sep 2017 16:07:27 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:54083) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxf5h-0004Mz-4O for 26073@debbugs.gnu.org; Thu, 28 Sep 2017 16:07:26 -0400 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v8SK7Nek006918; Thu, 28 Sep 2017 16:07:23 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 3A72C66268; Thu, 28 Sep 2017 16:07:23 -0400 (EDT) From: Stefan Monnier Message-ID: References: Date: Thu, 28 Sep 2017 16:07:23 -0400 In-Reply-To: (Paul Pogonyshev's message of "Thu, 28 Sep 2017 19:18:05 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6126=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6126> : inlines <6098> : streams <1765014> : uri <2508125> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > I frankly don't know how it should behave and whether fixing it for > generators would break 'with-slots'. What I can see, however, is that > generator functions with nested lambdas do not work properly. And you > cannot realisctically say "don't use those", because lambdas can be just > introduced by macros without you even thinking about it. And then the > function unexpectedly produces wrong results without any hint of what might > be wrong. Maybe my previous answer was not phrased properly, but it was just discussing how it should be fixed, rather than whether it should be fixed. Stefan From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Sep 2017 20:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Philipp Stephani Cc: 26073@debbugs.gnu.org, Paul Pogonyshev Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.150662939617054 (code B ref 26073); Thu, 28 Sep 2017 20:10:02 +0000 Received: (at 26073) by debbugs.gnu.org; 28 Sep 2017 20:09:56 +0000 Received: from localhost ([127.0.0.1]:37171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxf88-0004R0-0v for submit@debbugs.gnu.org; Thu, 28 Sep 2017 16:09:56 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:56561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxf86-0004Qs-5w for 26073@debbugs.gnu.org; Thu, 28 Sep 2017 16:09:54 -0400 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v8SK9rRx015856; Thu, 28 Sep 2017 16:09:53 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 430B166268; Thu, 28 Sep 2017 16:09:53 -0400 (EDT) From: Stefan Monnier Message-ID: References: Date: Thu, 28 Sep 2017 16:09:53 -0400 In-Reply-To: (Philipp Stephani's message of "Thu, 28 Sep 2017 19:39:02 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6126=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6126> : inlines <6098> : streams <1765014> : uri <2508125> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > At least the docstring of `with-slots' and the EIEIO manual both state: > "Both =E2=80=98setf=E2=80=99 and =E2=80=98setq=E2=80=99 can be used to se= t the value of the slot." In > particular, it doesn't state that `let' can be used for this purpose. So = as > long as `setf' and `setq' continue working, I think it should be OK to > change the behavior (it should still be documented as incompatible Lisp > change though). Right, the interaction with `let` is not documented, but some packages may still rely on it. What this means is that fixing bug#26073 for Emacs-26 may require introducing a second cl-symbol-macrolet so as not to risk breaking packages using the old semantics. I think for `master` it's OK to just change cl-symbol-macrolet (and risk breaking other packages). Stefan From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Nov 2017 20:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Philipp Stephani Cc: 26073@debbugs.gnu.org, Paul Pogonyshev Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.151181487525323 (code B ref 26073); Mon, 27 Nov 2017 20:35:01 +0000 Received: (at 26073) by debbugs.gnu.org; 27 Nov 2017 20:34:35 +0000 Received: from localhost ([127.0.0.1]:33114 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJQ6t-0006aN-40 for submit@debbugs.gnu.org; Mon, 27 Nov 2017 15:34:35 -0500 Received: from alt42.smtp-out.videotron.ca ([23.233.128.29]:58990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJQ6r-0006a7-CM for 26073@debbugs.gnu.org; Mon, 27 Nov 2017 15:34:34 -0500 Received: from fmsmemgm.homelinux.net ([23.233.195.134]) by Videotron with SMTP id JQ6iehifx5wubJQ6jesPyH; Mon, 27 Nov 2017 15:34:27 -0500 X-Authority-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=xXJ578j8WyTliCxld3/pTA==:117 a=xXJ578j8WyTliCxld3/pTA==:17 a=sC3jslCIGhcA:10 a=h4Xvx3uUypGG6LQPK8oA:9 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id B15C2AE09C; Mon, 27 Nov 2017 15:34:24 -0500 (EST) From: Stefan Monnier Message-ID: References: Date: Mon, 27 Nov 2017 15:34:24 -0500 In-Reply-To: (Philipp Stephani's message of "Thu, 28 Sep 2017 19:39:02 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-CMAE-Envelope: MS4wfHAKB1N3Mop5e3yJMWkQU4b3OEhn2b5x956LDavzGxczNT1erPHKLwjwdCT0fG5jC/tCc3uPw+ngbiN4Vqv+2ZT3JmnA8os4EfyXioRN0K297uFsxu1G W/BfC1xU9bqUnXc0SuMDaxW93whgW1IIlgt3LYNNw1NvtmHeIVLwvSwqO1C6PzJ+crKkawzWFl0uuOrPEheLrxeXvhpmUSC3xELUSlBfLtQyB4MZp8968daz QXp5/LTL9exvFJAgCwZiMeAsibNtodgVeCyaYm/o+gYWJFSfysjnf3lFQG8sYexo X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) I just installed a patch into `master` which should hopefully fix this problem without introducing new ones. Stefan From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Feb 2018 00:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 26073@debbugs.gnu.org, Philipp Stephani , Paul Pogonyshev Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.151813648817563 (code B ref 26073); Fri, 09 Feb 2018 00:35:02 +0000 Received: (at 26073) by debbugs.gnu.org; 9 Feb 2018 00:34:48 +0000 Received: from localhost ([127.0.0.1]:34491 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejweO-0004ZC-5w for submit@debbugs.gnu.org; Thu, 08 Feb 2018 19:34:48 -0500 Received: from mail-it0-f43.google.com ([209.85.214.43]:39402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejweM-0004Z0-2m for 26073@debbugs.gnu.org; Thu, 08 Feb 2018 19:34:46 -0500 Received: by mail-it0-f43.google.com with SMTP id c80so8674624itb.4 for <26073@debbugs.gnu.org>; Thu, 08 Feb 2018 16:34:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=pLeT/exaM8Bp31iW4u++EQCHM1t9JoLEJqJjnrABfTw=; b=E5wUXkbjqsGnJg/0v2UFzSxMQjzZbuNII3m4ASbQHem0WcDZ1oy6Y5xV8D36ene85n Q33dSfDqIFqn4HHBoC38YPzIZeybC/JBgwRl9802vRV6rTajbbKPgIiqiQ7ENPgCCGF/ MpH4DkmcStrG5/J5qBWgwjQC5z2IYo6ePOGnxmfYEDMMYaLRpADKhpSspzZ1npkxD7HT oDZepfPzcE7PATpFRQ2nxfSjWNws1GEhdMX/hscRSN0lfQc48be6LP9rgkCMu/d8q3FZ KaVD406PatPaANdFv2BtiGPJv+Ws/PksX9Xcoyh0Ntp+/xZLpq3ax2J0s31ijsyK3d2o oY5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=pLeT/exaM8Bp31iW4u++EQCHM1t9JoLEJqJjnrABfTw=; b=azrfG+Oiu4ZNvby/62qNIMKaTEUkfNsO/8guaBe8Up/HzU3zoEVQoxUhwTh3d4kvp2 vcIx5xkuJkO+qFCQVBioY8HKsqB9AB3IQkbXi4cdtVHCMDA7AKtsn1oZwytopPLZOLqC hrOTR/ArSFSOfkk+rikV2dCpM0ynsuf6ifHlBkn3ynrmc/IsTXfVNrGr1MTwH+BiYrc/ k05yzn5WM4/qfJh4JFKOW0nXfsfjMGMm8kyomkBUcpEi1iZw1HXVygChCM7h7NpNvSO3 2iFEO8ArAsmoCxt7MUXR7jzuZvmW0PsJbnAiCVf6o/JOtWhoJuipdJjx4MvYXj57e0Mn tENA== X-Gm-Message-State: APf1xPDvIViJqCeqki/AE9qN3EYaMghNUPauzdvwdDn7PPummeog36XF hFBe/HDkLPrV9GEn1+5kiEg= X-Google-Smtp-Source: AH8x226CUbRoafZcYMWffaj9q2Pi8EddCtkPCmvLnC+kSkWHeBwc8oFDZ1aQtEpiCPrh92FGcv9wFw== X-Received: by 10.36.3.206 with SMTP id e197mr1394672ite.47.1518136480678; Thu, 08 Feb 2018 16:34:40 -0800 (PST) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id o201sm1037223itb.7.2018.02.08.16.34.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2018 16:34:39 -0800 (PST) From: Noam Postavsky References: Date: Thu, 08 Feb 2018 19:34:38 -0500 In-Reply-To: (Stefan Monnier's message of "Mon, 27 Nov 2017 15:34:24 -0500") Message-ID: <876077dmqp.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Stefan Monnier writes: > I just installed a patch into `master` which should hopefully fix this > problem without introducing new ones. The examples given still fail on current master. (require 'generator) (setq lexical-binding t) ; for easier *scratch* evaluation (iter-do (y (funcall (iter-lambda (x) (dolist (it x) (let ((y (mapcar (lambda (it) (- it)) it))) (iter-yield y)))) '((1 2) ( 3 4)))) (print y)) ;=> Lisp error: (wrong-type-argument number-or-marker-p (1 2)) (iter-next (funcall (iter-lambda () (let ((it 1)) (iter-yield (funcall (lambda (it) (- it)) (1+ it))))))) ;=> -1 From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Feb 2018 02:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: 26073@debbugs.gnu.org, Philipp Stephani , Paul Pogonyshev Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.151814418518200 (code B ref 26073); Fri, 09 Feb 2018 02:44:02 +0000 Received: (at 26073) by debbugs.gnu.org; 9 Feb 2018 02:43:05 +0000 Received: from localhost ([127.0.0.1]:34536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejyeX-0004jT-IQ for submit@debbugs.gnu.org; Thu, 08 Feb 2018 21:43:05 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:45697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejyeV-0004jL-8O for 26073@debbugs.gnu.org; Thu, 08 Feb 2018 21:43:04 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w192h1AE025842; Thu, 8 Feb 2018 21:43:02 -0500 Received: by pastel.home (Postfix, from userid 20848) id 74CC760568; Thu, 8 Feb 2018 21:43:01 -0500 (EST) From: Stefan Monnier Message-ID: References: <876077dmqp.fsf@users.sourceforge.net> Date: Thu, 08 Feb 2018 21:43:01 -0500 In-Reply-To: <876077dmqp.fsf@users.sourceforge.net> (Noam Postavsky's message of "Thu, 08 Feb 2018 19:34:38 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6218=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6218> : inlines <6384> : streams <1778438> : uri <2589465> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > The examples given still fail on current master. > > (require 'generator) > (setq lexical-binding t) ; for easier *scratch* evaluation > (iter-do (y (funcall (iter-lambda (x) > (dolist (it x) > (let ((y (mapcar (lambda (it) (- it)) it))) > (iter-yield y)))) > '((1 2) ( 3 4)))) > (print y)) ;=> Lisp error: (wrong-type-argument number-or-marker-p (1 2)) > > (iter-next (funcall (iter-lambda () > (let ((it 1)) > (iter-yield (funcall (lambda (it) (- it)) (1+ it))))))) ;=> -1 Duh, the code failed to handle vars introduced by `lambda' (and `condition-case'). I installed a patch which fixes the above example (and hopefully the rest, but given my past track record on this you'd be foolish to believe it). Stefan From unknown Mon Aug 18 14:20:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26073: workaround Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Feb 2018 02:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 26073@debbugs.gnu.org, Philipp Stephani , Paul Pogonyshev Received: via spool by 26073-submit@debbugs.gnu.org id=B26073.151866227119686 (code B ref 26073); Thu, 15 Feb 2018 02:38:02 +0000 Received: (at 26073) by debbugs.gnu.org; 15 Feb 2018 02:37:51 +0000 Received: from localhost ([127.0.0.1]:43529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1em9Qk-00057M-SF for submit@debbugs.gnu.org; Wed, 14 Feb 2018 21:37:51 -0500 Received: from mail-it0-f54.google.com ([209.85.214.54]:38839) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1em9Qj-000571-EC; Wed, 14 Feb 2018 21:37:49 -0500 Received: by mail-it0-f54.google.com with SMTP id k6so17297375ita.3; Wed, 14 Feb 2018 18:37:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=kd/hTxOOynIXfJe/9xu7hVqmPFMdIl8qMN04BNx/3SM=; b=iXHGqceu+k9D4ZiQWQ1nucOvb4BwkROmpvpr+k5v7drUXSaMTe4iHGvO2ZGW0/w1U+ xPSIRF0gJzFtcHk/CTtZYhu3KfQFwnN7KQ4cRNk3hvtYvmeJ1K4GRda3iQVhltwavjrf 0VdNL37btaQyGcCNNrosJ6/0YW0McK7H0lAY/9DvYM7xKsbjt81coHz8gTH7zzArkult fDaXVdT7HJyOdyXtCvk9gSlOAhWwS6x9WUlFXgtUu0J7b1d5Ut6CwCOiMiSzexa6xLaO n9AZz/2HM9IJadqjIms72b/zZEtU8f3Lo4oFK6ffZp30qrY9ZyOtgLeU73y3yz7Foe15 F+jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=kd/hTxOOynIXfJe/9xu7hVqmPFMdIl8qMN04BNx/3SM=; b=cTws6hGtYm1E2UJf2hXNVRWGmS4/cYWglLMFK5jmBgyDAQYcQm6h4fBXVpjiWCg45G w27/c109UelwOAbmRHjknZNfnPTDZtkxaAflm/6qvNkxWWT855Nba9VK+6Z+UDwceb9G hofal2FD+67vYal9y0WeszFXjFvBQjkFQqoOw8tlLC2BKv/+9QRw+2MP1owTfnextJvl OQJ+yi2iaRIAJlsHBNeABXgJH377cHDCczv9k8oj8k0ISl8ZPGniqCefOIhOcJ6+w62k iDyFmpJ1W+S9QJCa5jdty+wdmGi8+PDcGzqrpYRbeSYfmC5WzVpwQuqLuTSu9b9C5+JB ksTA== X-Gm-Message-State: APf1xPBqNCIC+BXF1B7fbpiBd9eH76yb62cIek1KTtPOmOraS10H6bgz E/lA76ITfj/DTbzzo70xKRpzgQ== X-Google-Smtp-Source: AH8x224mZ6qI/NuO9ruUVG1IvSdL7/ZA7kHz2U3XqxUpv2pkTI4xo/46yTJ/YcwKiogEtGk/zhPysA== X-Received: by 10.36.61.142 with SMTP id n136mr1543440itn.6.1518662263719; Wed, 14 Feb 2018 18:37:43 -0800 (PST) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id k3sm9612873ioc.47.2018.02.14.18.37.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Feb 2018 18:37:42 -0800 (PST) From: Noam Postavsky References: <876077dmqp.fsf@users.sourceforge.net> Date: Wed, 14 Feb 2018 21:37:40 -0500 In-Reply-To: (Stefan Monnier's message of "Thu, 08 Feb 2018 21:43:01 -0500") Message-ID: <87y3jv6kqz.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) tags 26073 fixed close 26073 27.1 quit Stefan Monnier writes: > Duh, the code failed to handle vars introduced by `lambda' (and > `condition-case'). I installed a patch which fixes the above example > (and hopefully the rest, but given my past track record on this you'd > be foolish to believe it). Works for me [1: 6b183f85e0]. I've added the latter example as a test case [2: 82379efaaf]. [1: 6b183f85e0]: 2018-02-08 21:41:21 -0500 * lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand): Handle lambda! https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=6b183f85e02ae1b8527c1bbfa8c5e2c914d28f7c [2: 82379efaaf]: 2018-02-14 21:31:06 -0500 ; Add test for iter-lambda variable shadowing (Bug#26073) https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=82379efaaf92e964875c0648b45bcae27b54d213