From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#54079: 29.0.50; Method dispatching eratically fails Date: Tue, 08 Mar 2022 14:53:07 -0500 Message-ID: References: <87bkz113hz.fsf@web.de> <87mtik3l54.fsf@web.de> <87ilt6bgnt.fsf@web.de> <87sfsapgv0.fsf@web.de> <87o82ypfxz.fsf@web.de> <875youbhbu.fsf@web.de> <87k0d7257t.fsf@web.de> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11457"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Michael Heerdegen , Lars Ingebrigtsen , 54079@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 08 20:54:11 2022 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 1nRfuM-0002n5-Pd for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Mar 2022 20:54:10 +0100 Original-Received: from localhost ([::1]:53860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRfuL-0003ef-Fd for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Mar 2022 14:54:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRfuE-0003cy-N3 for bug-gnu-emacs@gnu.org; Tue, 08 Mar 2022 14:54:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35847) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRfuE-0001E5-Ch for bug-gnu-emacs@gnu.org; Tue, 08 Mar 2022 14:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRfuE-0005E5-73 for bug-gnu-emacs@gnu.org; Tue, 08 Mar 2022 14:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Mar 2022 19:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54079 X-GNU-PR-Package: emacs Original-Received: via spool by 54079-submit@debbugs.gnu.org id=B54079.164676919920029 (code B ref 54079); Tue, 08 Mar 2022 19:54:02 +0000 Original-Received: (at 54079) by debbugs.gnu.org; 8 Mar 2022 19:53:19 +0000 Original-Received: from localhost ([127.0.0.1]:57977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRftX-0005Cz-8Z for submit@debbugs.gnu.org; Tue, 08 Mar 2022 14:53:19 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:34131) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRftV-0005Cl-DZ for 54079@debbugs.gnu.org; Tue, 08 Mar 2022 14:53:18 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id ECBCE8062B; Tue, 8 Mar 2022 14:53:10 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D83C780009; Tue, 8 Mar 2022 14:53:08 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1646769188; bh=O7z8RY6GpG7RE/xo2Jr/ZfpRTFqS/sjnAzuWytpDJDU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=gbDnAB8pP/VGPl4hNNAIun2hjIgVLC5PZxIMu9meKcC0RPP23YvUTVQa5g9DxqqGJ XJ8FKomGDfRjS+UfEfzb/y8O542XONMZzetvqv5W6UOyioeXnZL1vwr1DszlOKLgya 5ouOogCkWaxeM9QzxYq3zg+69R/oP7fw40ebY3s9VHvIcpmY0pbUQt3i2H6uKs6KKc xpIAqIfw8pCtcaV8dEpt+cELacbWSHSSY9e4V9mTt4RcI+4fc9deTvLO+/ZBdzEvOI Zz9Gzkq+W548VIkNR4CHG8O+FN10AkRx5bCR+fHOuWwa8BvtLkFoYKjXeCOzBBKkWv u4yqFVWKGzWiA== Original-Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A1EF31202C1; Tue, 8 Mar 2022 14:53:08 -0500 (EST) In-Reply-To: (Alan Mackenzie's message of "Tue, 8 Mar 2022 19:28:27 +0000") 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:228154 Archived-At: > diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el > index 9be44a8d5a..fb9f70bd67 100644 > --- a/lisp/emacs-lisp/bytecomp.el > +++ b/lisp/emacs-lisp/bytecomp.el > @@ -499,9 +499,10 @@ byte-compile-initial-macro-environment > (byte-compile-new-defuns > byte-compile-new-defuns)) > (setf result > - (byte-compile-eval > + (byte-run-strip-symbol-positions > + (byte-compile-eval > (byte-compile-top-level > - (byte-compile-preprocess form))))))) > + (byte-compile-preprocess form)))))))) I'd expect the reverse: strip first and then eval the result. Why should we not strip the form passed to `byte-compile-eval`? Does `byte-compile-top-level` already return a stripped form of code? And why bother stripping the result of `byte-compile-eval`? > @@ -512,9 +513,10 @@ byte-compile-initial-macro-environment > ;; or byte-compile-file-form. > (let* ((print-symbols-bare t) ; Possibly redundant binding. > (expanded > - (macroexpand--all-toplevel > - form > - macroexpand-all-environment))) > + (byte-run-strip-symbol-positions > + (macroexpand--all-toplevel > + form > + macroexpand-all-environment)))) > (eval expanded lexical-binding) > expanded))))) > (with-suppressed-warnings Fundamentally, `eval` should always strip before doing its job. Yes, I know, it might be a bit expensive, but we should probably define a local function in `bytecomp.el` which does strip+eval and use that instead of `eval` (both here and in `byte-compile-eval`). WDYT? Stefan