From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Prickliness of the "invalid byte code" stuff Date: Mon, 17 Jun 2019 14:10:58 -0400 Message-ID: References: <87tvcq9b0w.fsf@igel.home> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="55213"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 17 20:12:31 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hcw7L-000EDq-As for ged-emacs-devel@m.gmane.org; Mon, 17 Jun 2019 20:12:31 +0200 Original-Received: from localhost ([::1]:50808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcw7K-0001y2-27 for ged-emacs-devel@m.gmane.org; Mon, 17 Jun 2019 14:12:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56727) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcw64-0001wc-W0 for emacs-devel@gnu.org; Mon, 17 Jun 2019 14:11:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcw62-0006Aq-4d for emacs-devel@gnu.org; Mon, 17 Jun 2019 14:11:11 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:11549) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hcw60-000693-EE; Mon, 17 Jun 2019 14:11:08 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 329EF443A48; Mon, 17 Jun 2019 14:11:05 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E7D0B443A45; Mon, 17 Jun 2019 14:11:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1560795063; bh=3WpZGcWjmppaG1tOiHjQZkPCN/64F67Q05e4dpwFV5Y=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=kV6IRZthNfqvmYoEnw1g8pAsgDOpPfSVLDeZUGHdk7HD+6iwxR13+4ZCfwp/vtfBu FkkDfyDT3gUDxact8lKBrsCO3JQnPh7EUlYTD/2iKHfxjpp3FvBEgOr2OXA4hf4eBW Np9Iwljwh9eMjkOn3J9g6hLC3oZHSDAX1Ln2dreRqcSm6QQ1w5FSITRFiyYMp+/MjO WicEKUaxSE9WjECq0HPEmaQg9sLn7NS8/yU4c+UXr0PXpNWQrMubn2kIV4u2GQofqi E4puZpcZpKDYvmMiIVjNvdJMwPgZSZWoqhpku8dQ2ujw4cFbBtIP8dbWr9ol1MZ+VH gPtnyDD+0CzqQ== Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E030A12077F; Mon, 17 Jun 2019 14:11:03 -0400 (EDT) In-Reply-To: (Richard Stallman's message of "Mon, 17 Jun 2019 12:04:23 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:237795 Archived-At: > > > session. My thought was that if we could detect this specific case, > > > then we could as well have emacs load that file, rather than having the > > > user reload it by hand. > > > Yes, that usually works, but unless we reorganize the current code, we > > end up having to solve a slightly different problem similar to: > > > (setq sm-foo (indirect-function '-)) > > (load "") > > (funcall sm-foo ) > > That is true -- but since indirect-function is called in only around > 40 places, problems of this kind will be far less frequent than the > problems we have now. No, the problem we have now is exactly this one, because at the place where we try to fetch the bytecode, all we have is a byte-code-function-p object (i.e. what indirect-function returned above). In many cases, this object was found in the symbol-function cell of a symbol, but we don't even currently try and propagate this symbol to the fetch-bytecode function, so while in theory it's stashed somewhere up in the stack we don't currently have any way to recover it. In any case, I think deprecating byte-compile-dynamic is a better solution than trying to fix its many shortcomings, since I don't know of any concrete evidence that it has any real benefit. Stefan