From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id APFKKER/iGDxLQAAgWs5BA (envelope-from ) for ; Tue, 27 Apr 2021 23:16:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id ePvgI0R/iGALPwAAbx9fmQ (envelope-from ) for ; Tue, 27 Apr 2021 21:16:52 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E36571557A for ; Tue, 27 Apr 2021 23:16:51 +0200 (CEST) Received: from localhost ([::1]:39128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbV4d-0005g4-28 for larch@yhetil.org; Tue, 27 Apr 2021 17:16:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbV0n-0004sx-1c for emacs-orgmode@gnu.org; Tue, 27 Apr 2021 17:12:53 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:44407) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbV0k-0002sa-L2 for emacs-orgmode@gnu.org; Tue, 27 Apr 2021 17:12:52 -0400 X-Originating-IP: 185.131.40.67 Received: from localhost (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 57B1560003; Tue, 27 Apr 2021 21:12:46 +0000 (UTC) From: Nicolas Goaziou To: Stefan Monnier Subject: Re: More use of lexical-binding in ox.el References: Mail-Followup-To: Stefan Monnier , emacs-orgmode@gnu.org Date: Tue, 27 Apr 2021 23:12:46 +0200 In-Reply-To: (Stefan Monnier's message of "Mon, 19 Apr 2021 23:37:50 -0400") Message-ID: <87wnsnig8h.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.183.195; envelope-from=mail@nicolasgoaziou.fr; helo=relay3-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619558212; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=dXxo2A8u6syB310251AqyflELh5B7ui0Laae0ADIsv8=; b=S+qT0VAwef78OX5fO1CqxMXvOBYL6hLHiFGRjyuC2kIjFzRvjfH69ECojlSktsc0kWZW/y OkALq0mlGtiY1TVmJuCAl6jos8W5+KNCrEgCGtunmeeS+utUjiBs1fvcf8b4ogFEAFBKLt BpiDC3V6CPUQFhuWC3RgOru4FLgHrJ64WFAgi11L5JvPovKQOzBIkKi3egiw3C/ogFkx3H S/5xG7t4OSQqLe1pUe+Q3cbDwXLaSw9S8NM4WeVPuhjuFLVGMxiiTQjpLn/5olx/E2H4w1 eNO0AWG+sv5vHOSrX4y9RpxGuePOtUXeulDHyHX1rqYFrHB4qa/8DU9NYB/gCw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619558212; a=rsa-sha256; cv=none; b=AnkUehgMCuo62DKFtAF/uKK25V9V95aI3ORpViwJZiyisGWc3wktS59gm20359JPiCdEH2 K7mrorJToCl8i4xPaGUmYIgWg49H9rJZn1vareZa4YhoivzptKpFhYe33vH2CeAqjeN0Wu YKGcXtAAKneH2mVqq9FKaO1x5PZ+siKqLQ13r/AkVaMkzzaMeyyK+6nCTXIRxFWw+fpooN oZNCg3riC2c9/rlZwmCMw+rFHG6t/MUq6U2HHnkJMQrc3EqitVVOaj3DbajpgdAUk8VhaC mXLSUY9BL5hG7aTTSYOxNrk9KF3R8JKZgOLflPgfYvkgJR4qyLBO6WumgDi9YQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.45 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: E36571557A X-Spam-Score: -2.45 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6n8pnC0sJkrY Hello, Stefan Monnier writes: > Here's another patch to remove some more use of the old dynamically > scoped dialect of ELisp. > > Stefan > > > * lisp/ox.el: Fix various uses of the non-lexical-binding ELisp dialect. > (org-export--get-global-options, org-export-insert-default-template): > Use lexical-binding. > (org-export--generate-copy-script): Return a closure rather than > list starting with `lambda`. > (org-export-async-start): Turn it into a function (there seems to be > no reason this was a macro). Use `write-region` rather than > `with-temp-file`. Always use `utf-8-emacs-unix` coding system since > it's more efficient and is guaranteed to handle all chars. > Use lexical-binding in the temp file as well. > Actually set `debug-on-error` if `org-export-async-debug` says so. > (org-export-to-buffer, org-export-to-file): Pass a closure rather than > list starting with `lambda` to `org-export-async-start`. Thank you! It looks great but it introduces a test failure, however. `org-export-expand-include-keyword' is called from within `org-export-with-buffer-copy'. At the very beginning of `org-export-expand-include-keyword', there is (buffer-file-name (buffer-base-buffer)) Before the patch, it returned the source file name. After the patch it returns nil. Actually I'm a bit surprised it used to work, since we're evaluating this from a new buffer, not an existing one. But hey, it worked! Do you know what could cause this? Regards, -- Nicolas Goaziou