From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#38072: when `byte-compile-file' finds out that a file is `no-byte-compile', it ignores `load' parameter Date: Sat, 5 Sep 2020 00:30:38 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000043a2be05ae861852" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25359"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 38072@debbugs.gnu.org To: Paul Pogonyshev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 05 02:31:14 2020 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 1kEM6s-0006U4-3L for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Sep 2020 02:31:14 +0200 Original-Received: from localhost ([::1]:40212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEM6r-0008Lh-04 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Sep 2020 20:31:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEM6g-0008Jx-B9 for bug-gnu-emacs@gnu.org; Fri, 04 Sep 2020 20:31:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57799) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kEM6g-0004Px-2H for bug-gnu-emacs@gnu.org; Fri, 04 Sep 2020 20:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kEM6f-0005p4-Ve for bug-gnu-emacs@gnu.org; Fri, 04 Sep 2020 20:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Sep 2020 00:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38072 X-GNU-PR-Package: emacs Original-Received: via spool by 38072-submit@debbugs.gnu.org id=B38072.159926584722353 (code B ref 38072); Sat, 05 Sep 2020 00:31:01 +0000 Original-Received: (at 38072) by debbugs.gnu.org; 5 Sep 2020 00:30:47 +0000 Original-Received: from localhost ([127.0.0.1]:41110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEM6R-0005oT-8H for submit@debbugs.gnu.org; Fri, 04 Sep 2020 20:30:47 -0400 Original-Received: from mail-ed1-f67.google.com ([209.85.208.67]:43724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEM6P-0005oA-AB for 38072@debbugs.gnu.org; Fri, 04 Sep 2020 20:30:46 -0400 Original-Received: by mail-ed1-f67.google.com with SMTP id n13so7635598edo.10 for <38072@debbugs.gnu.org>; Fri, 04 Sep 2020 17:30:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=yGkG9Acf7R0an1TKZrupxWdxeF7GkHUeQf0FLKKRkDk=; b=ngQ4QxbwfCpmiQmjz2JAGAsJ5MkE12UUzi2rGXsZTO5TRyBLNXHMLEEgqbljD0yfEO gKNVOYtJydlFvBblXPM1dwAKRC970MEP7/zEh9CG+j5ch/EQ8lsxzyDzM5DjL9UhE+sT 9tAN6jTGf0Nvz3jaZJJ+s5boikAPhx9M3Od47Yz1g+uT3Ap2WpU72rROnXyM9D0mBi8g zhPL377cgN/P+G9W9Mh3RV0PPIRUmPYxjfL5FrX30uEgJiEfsAxCx7LStteP+E+eahoP 3hsvuNxzdHd8y+gCOCJAUhQ9j8q0J/8EzLiO6VS+HZ2vk6Eslo/5HKzqt0HLdFRH48jC Y6ew== X-Gm-Message-State: AOAM5331MMzhr71J9cItqQWv2Xi2n8k9sM1OAbWsVvIXC/KXMtVXtT7h GlhxQWid+tLzGnMd8v2Zsz57CJcPMnO4toASRvA= X-Google-Smtp-Source: ABdhPJzVizFg42HDr4WZVhrm1R0lccz/1O/FoKdWu6zsHY23gLJrbnJ41JVG4ZyLFa0dwdMqTO2Q5ZUr8Ybu3zOE9kU= X-Received: by 2002:a50:8524:: with SMTP id 33mr11787142edr.123.1599265839482; Fri, 04 Sep 2020 17:30:39 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 5 Sep 2020 00:30:38 +0000 In-Reply-To: (Paul Pogonyshev's message of "Tue, 5 Nov 2019 21:58:55 +0100") 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:187173 Archived-At: --00000000000043a2be05ae861852 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable tags 38072 + patch thanks Paul Pogonyshev writes: > After (byte-compile-file "..." t) one normally expects that the file > is loaded, all its functions and variables are visible etc. However, > if file contains local variable `no-byte-compile', not only > compilation is cancelled, `byte-compile-file' also doesn't load the > file. > > Expected: if `byte-compile-file' cancels byte-compilation and `load' > is non-nil, it should load the uncompiled source instead. The fix is pretty simple (see attached), but I'm not sure what the correct behavior is here. The doc string of `byte-compile-file' says: Compile a file of Lisp code named FILENAME into a file of byte code. The output file=E2=80=99s name is generated by passing FILENAME to the function =E2=80=98byte-compile-dest-file=E2=80=99 (which see). With prefix arg (noninteractively: 2nd arg), LOAD the file after compil= ing. ^^^^^^^^^^^^= ^^^ So should we load the file if we did not compile the file? I'm thinking yes, and I don't see what it could hurt to change it to load the file. If the user uses a prefix arg or the LOAD argument from Lisp, surely that was the intention. But on the other hand the text above seems deliberate, somehow? (And AFAICT the behavior has been not to load the file since pretty much forever, possibly since byte-compilation was first added.) Any other opinions here? Best regards, Stefan Kangas --00000000000043a2be05ae861852 Content-Type: text/x-diff; charset="US-ASCII"; name="0001-Ensure-byte-compile-file-loads-file-with-non-nil-loa.patch" Content-Disposition: attachment; filename="0001-Ensure-byte-compile-file-loads-file-with-non-nil-loa.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: 71f2cf30ea3ac7cd_0.1 RnJvbSBmNDhjMmE0NDZlNTM0M2Y4YWQxMDRlYjU1MjNlODM0YmIxMjc4MjVkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5rYW5nYXNAZ21haWwuY29t PgpEYXRlOiBTYXQsIDUgU2VwIDIwMjAgMDI6MTQ6NTQgKzAyMDAKU3ViamVjdDogW1BBVENIXSBF bnN1cmUgYnl0ZS1jb21waWxlLWZpbGUgbG9hZHMgZmlsZSB3aXRoIG5vbi1uaWwgbG9hZCBhcmcK CiogbGlzcC9lbWFjcy1saXNwL2J5dGVjb21wLmVsIChieXRlLWNvbXBpbGUtZmlsZSk6IExvYWQg ZmlsZSB3aGVuCmFyZ3VtZW50ICdsb2FkJyBpcyBub24tbmlsLCBldmVuIGlmICduby1ieXRlLWNv bXBpbGUnIGlzIGFsc28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