From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id OMH6FSB27GLUJgEAbAwnHQ (envelope-from ) for ; Fri, 05 Aug 2022 03:45:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id ED/1FSB27GI5jwAAauVa8A (envelope-from ) for ; Fri, 05 Aug 2022 03:45:04 +0200 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 B7DFC17C54 for ; Fri, 5 Aug 2022 03:45:03 +0200 (CEST) Received: from localhost ([::1]:50086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJmOc-0002c0-Sm for larch@yhetil.org; Thu, 04 Aug 2022 21:45:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJmOB-0002bC-15 for emacs-orgmode@gnu.org; Thu, 04 Aug 2022 21:44:35 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:46886) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJmO8-0001a9-Rv for emacs-orgmode@gnu.org; Thu, 04 Aug 2022 21:44:34 -0400 Received: by mail-pl1-x635.google.com with SMTP id p8so1355920plq.13 for ; Thu, 04 Aug 2022 18:44:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=SxFP1YKiXf1CoEm4JB4nuXOnKqqZFBtbg/HfEQjyjHI=; b=Jpgj7PFGQcXqrbYt9RUhPGcIGyyEhYzQnNm5u8div+wPqfFRmeq1gdZCJ0QD3zCGLe DlUg8LJoBREjuevHW/geQlVjJWY/7KkGz7yteKQykKqGm46e8GVPPaJOdryQIvkBjF1K wYt0XZiZDQQfVQlY7O6q5QemXZeBOVPKM5m1xndga8DgHgj/BXa8WSx0Cd/bL1f0Sx6a 61Zb21r3UZhOGbn+PG89KACy/a9klfCjDA+aCAXNW1e2vWkVlgrSeLkkAeZ5x3oy5wI8 Drb99cUhh9apfa1o+H0Y5GERiVA1jFYsVTdY2vd5/f8iHXLimg/du2bCsJXXsiIT60MT cGIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=SxFP1YKiXf1CoEm4JB4nuXOnKqqZFBtbg/HfEQjyjHI=; b=qFhccFsYJHvd7UgnuDeOOe3o0c8NzXaO5hUzaogfcG5+CALNFA793v5zKHZenXNvA9 77zKV4t+gYn6vQO07ImHmME84Hv/GJCpn7l/0U3BYBDhoka4hzFy0n7bhZyqCTYIY21M D/jStA1nqKzqn0TYazBngxrMfcxlLvbe0/OIFRAoeHgh5eziYGOCeDd8J9aQ7qGkuoTB 0WP3caDGqmMS3uT0d5UeTlE+NubwKguvuqPgP8uY2Tww6A9a7l1zWGQbP3xLRRclewcs hiisBnm8N8Z2inZ1BEHgHLjpxxZjFmghIJMrnAOw7XzFMYwUrb0LW4HElw/ezMbTksjN pWxw== X-Gm-Message-State: ACgBeo1F8ZMPkxxpc0dBtSfVrtKaAs40uNqFh5u0PWmEWSeb/fQUZ47C UiPL6x3Ic2U5NH+TuGuZU0Y= X-Google-Smtp-Source: AA6agR5B4SZVfJBnIkIgMVQB5vNov2rWcLHaaAH55IMyERvYbRbNeHwXEsVnzMqTYM1lzC3+AlJf3A== X-Received: by 2002:a17:902:7c88:b0:16c:5301:8a52 with SMTP id y8-20020a1709027c8800b0016c53018a52mr4402714pll.95.1659663871228; Thu, 04 Aug 2022 18:44:31 -0700 (PDT) Received: from localhost ([115.154.175.57]) by smtp.gmail.com with ESMTPSA id ij29-20020a170902ab5d00b0016dc6243bb2sm1605960plb.143.2022.08.04.18.44.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 18:44:30 -0700 (PDT) From: Ihor Radchenko To: "Fraga, Eric" Cc: Emacs Org mode mailing list Subject: Re: folding problems In-Reply-To: <87fsichwo0.fsf@ucl.ac.uk> References: <87sfmci1kw.fsf@ucl.ac.uk> <871qtwqdqk.fsf@localhost> <87fsichwo0.fsf@ucl.ac.uk> Date: Fri, 05 Aug 2022 09:45:38 +0800 Message-ID: <87edxvpinx.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=yantar92@gmail.com; helo=mail-pl1-x635.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1659663903; 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:dkim-signature; bh=SxFP1YKiXf1CoEm4JB4nuXOnKqqZFBtbg/HfEQjyjHI=; b=VntMfs/sdox8CJaTy4PTsreCLaRhUiakZkO2qGdNkunMMkK1YiS5lNGpxm3DrY6xvGvlCl 6bA2qAb3vMneGqV0690liF2tKIfz2YT9U8+ceK8/ssu8a4cyJYqi5y0ce2KOz6wCkhWJKm PF+HdVGIoxgVqjIPEQyHUFy5wzSRzzgQ8Ju3ttj1tkE7If9BJa0pnhHE9JYeqjMAjom5OD tuH3BCZlexxMh4YNgxiAv5iCh0jhpdV4hFZJxeDfHz2SQYFVCw8x5ztyGFW8BIvwIlw0Wt sGa7ZHFp2UYOxY5JxGdN4ooGHTduDu7mXxJfquqdBdBp3j6EKSVvAQhC96DIrA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659663903; a=rsa-sha256; cv=none; b=FyLKLGZKv5CCLrGnT4eWSC5SHunyyaGE0tj8Nem0Bc/PUGgEAbllqODkn2gRcp5LwkKlaC s4QcXhY1aUiEW3gkNpefzpebuEdAYSh7+QDAoTupVizYDiYvabxKjDaBHRYS/b994WRYIz KOhd1GyjgHlKefmAGzryGbYd3L4+a3zqW3eceQsYoIqbcVVX5khzWThEPC8ZaOYW6slqgb waIM0ZCOQ0dU6q/eCs4oRJMbds4iaDrit0e+C+Dyu3FI4Sfo6JW9+WqXPLLDEzTPwfMZi9 4hnW9JUmYPmPAnWbSv/CV/XI4xcSosId1RyFLin51Hc1IJ9E84bhfDDu+sxHbQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Jpgj7PFG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.41 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Jpgj7PFG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: B7DFC17C54 X-Spam-Score: -3.41 X-Migadu-Scanner: scn1.migadu.com X-TUID: vcWzV2m3h+mX --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable "Fraga, Eric" writes: > Maybe unrelated but I will add that the recent changes to how local > variables are processed is breaking my usage of org quite seriously. To > be clear: I am not complaining: it's my fault for tracking the bleeding > edge of development for both org and Emacs. =F0=9F=98=89 But I thought I = would > mention what I am seeing just in case it's useful. > > An example: when exporting a long document which has many src blocks, > each of those blocks is now being loaded and local variables (which > include dir local variables) are being evaluated (which they were not > before, I guess?). I don't know if this is an org change or an Emacs > change? > > The src blocks are likely loaded by org because I am using engraved for > formatting the src blocks on export. This is a nightmare if any of the > variables are considered unsafe as it requires confirmation for each > such case. > > And if some src block mode needs a special input method, this is causing > the export to fail: > > activate-input-method: Can=E2=80=99t activate input method =E2=80=98T= eX=E2=80=99 > > although I am not sure, at this point, where/when this is happening. If you have some time, can you try the attached patch? > I will need to revert to an older version of org as I need to get work > done. There's too much breaking to spend the time at the moment > investigating. =F0=9F=98=95 But no worries: that's what git is for! =F0= =9F=91=8D Sorry for this. This is one of those innocently-looking changes that can cause unforeseen consequences. Best, Ihor --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-export-Do-not-try-to-load-file-directory-locals-.patch >From 197bbbd91c54b28516ec6818f57bb07539fcfd9f Mon Sep 17 00:00:00 2001 Message-Id: <197bbbd91c54b28516ec6818f57bb07539fcfd9f.1659663319.git.yantar92@gmail.com> From: Ihor Radchenko Date: Fri, 5 Aug 2022 09:33:44 +0800 Subject: [PATCH] org-export: Do not try to load file/directory-locals in export buffer * lisp/org.el (org-inhibit-local-variables): New variable controlling loading file-local and directory-local variables when `org-mode' is being loaded. (org-mode): Use `org-inhibit-local-variables'. * lisp/ox.el (org-export--generate-copy-script): Disable loading local variables in the export buffer. Fixes https://orgmode.org/list/87fsichwo0.fsf@ucl.ac.uk --- lisp/org.el | 5 ++++- lisp/ox.el | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 9549ec5f0..12214ecbb 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4691,6 +4691,8 @@ (defvar org-element-cache-persistent); Defined in org-element.el (defvar org-element-use-cache); Defined in org-element.el (defvar org-mode-loading nil "Non-nil during Org mode initialisation.") +(defvar org-inhibit-local-variables nil + "Unless nil, Org mode will not load file/directory-local variables.") ;;;###autoload (define-derived-mode org-mode outline-mode "Org" "Outline-based notes management and organizer, alias @@ -4719,7 +4721,8 @@ (define-derived-mode org-mode outline-mode "Org" ;; Apply file-local and directory-local variables, so that Org ;; startup respects them. See ;; https://list.orgmode.org/587be554-906c-5370-2cf2-f08b14fa58ff@gmail.com/T/#u - (hack-local-variables 'ignore-mode-settings) + (unless org-inhibit-local-variables + (hack-local-variables 'ignore-mode-settings)) (org-load-modules-maybe) (org-install-agenda-files-menu) (when (and org-link-descriptive diff --git a/lisp/ox.el b/lisp/ox.el index fa6f3f19a..57d375b35 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -2623,8 +2623,12 @@ (defun org-export--generate-copy-script (buffer) (lambda () (let ((inhibit-modification-hooks t)) ;; Set major mode. Ignore `org-mode-hook' as it has been run - ;; already in BUFFER. - (let ((org-mode-hook nil) (org-inhibit-startup t)) (org-mode)) + ;; already in BUFFER. Ignore loading local variables as + ;; well. + (let ((org-mode-hook nil) + (org-inhibit-startup t) + (org-inhibit-local-variables t)) + (org-mode)) ;; Copy specific buffer local variables and variables set ;; through BIND keywords. (pcase-dolist (`(,var . ,val) varvals) -- 2.35.1 --=-=-=--