From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id ALFON/+CpGKlbAAAbAwnHQ (envelope-from ) for ; Sat, 11 Jun 2022 13:56:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 4PI8Nv+CpGKBjgAAG6o9tA (envelope-from ) for ; Sat, 11 Jun 2022 13:56:47 +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 8110431BE3 for ; Sat, 11 Jun 2022 13:56:47 +0200 (CEST) Received: from localhost ([::1]:38414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzzjS-0003hm-7s for larch@yhetil.org; Sat, 11 Jun 2022 07:56:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzziq-0003he-IH for emacs-orgmode@gnu.org; Sat, 11 Jun 2022 07:56:08 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:46969) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzzio-0002HT-U5 for emacs-orgmode@gnu.org; Sat, 11 Jun 2022 07:56:08 -0400 Received: by mail-pf1-x435.google.com with SMTP id j6so1655773pfe.13 for ; Sat, 11 Jun 2022 04:56:06 -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=CuyT7YIJNcNWzQcC7nG021nJ6One8Pl7kOQgh5GoPvo=; b=a7JXcnExp31Nab3/T4S/tw5pCOXP/d6SCmBbW/6oi+B1Sdkj6z57Hmz4+//X4RMee+ 2mdnumfJgGMMlx0GBLHXnpP8floyy/KpRQaO0UZrwvBp96KcxJzk7Sp2sqtNgUANFMLJ 92bP8dqRT4TlNSzOzSS7/35tu+vm0jnXtm/iXXYTQxcVXguzIF05KQmQMAS+e3e6SPVn ZIFsSoKuqN6t5UsY9k+Hqa3acBxRqsMILkZ+Gw3DhT7MICxEPvdSkYN7Fx2vI1IQH3xd Oj/W48Dhxzi4skDSq0CLrsl/Rspul+VF+fLTdR+1F7aDSZ4mZZ3hT1SDwLUYh22Ig98w Ztdw== 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=CuyT7YIJNcNWzQcC7nG021nJ6One8Pl7kOQgh5GoPvo=; b=ZszU40u+7hQexR1pu6Fn3XBRaEynygWAR10RPkkRBOMY/80NnBIhcH7HaLq0SFsLXS v6AttO2ucuSz/oGMMIvgTQHbJjNmOCi8mwIaWzlsTIcLnUU/HNJdl+BfimXBPixBoZj9 8dx2gzqpZdcyTfOjKrWdVKvb27quCI3XqYyWtYf4VUxSOVr7Rb9DF0zwvhy84VNhUlyQ hn6q4QXwZ73hZBN93pXs6ujHy/F3WR7Kp0DfE2oCbzJXVcHltwiIj1aRdJNxBn+aupKz Sn293Fg374mhIrb80VKBOIl/iltWuJNvOem0NJ1U4RN5OO4638l6YlGaM4s+8ms8yHsS Ilgw== X-Gm-Message-State: AOAM5331OiFueFQxNhVQAbE3PGFHeaZwO2qpsMgpfmJFMiQebZOQF8IK c5r+wt9rINvtelOe364ErNE= X-Google-Smtp-Source: ABdhPJxtf+1HoLVn9HWau8EQTBPvmbXOCAamSkoQACbfyY+hNQoOHpW689fLnfCJNu1YRTeMr2sA4Q== X-Received: by 2002:a65:6786:0:b0:3fc:e1c0:7bbc with SMTP id e6-20020a656786000000b003fce1c07bbcmr42382523pgr.65.1654948565408; Sat, 11 Jun 2022 04:56:05 -0700 (PDT) Received: from localhost ([64.32.23.62]) by smtp.gmail.com with ESMTPSA id b21-20020a056a000cd500b0050dc7628179sm1387055pfv.83.2022.06.11.04.56.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jun 2022 04:56:04 -0700 (PDT) From: Ihor Radchenko To: Alen Alex Ninan Cc: emacs-orgmode@gnu.org Subject: [PATCH] Re: Help with assigning org-attach-id-dir using directory local variables In-Reply-To: <587be554-906c-5370-2cf2-f08b14fa58ff@gmail.com> References: <587be554-906c-5370-2cf2-f08b14fa58ff@gmail.com> Date: Sat, 11 Jun 2022 19:56:44 +0800 Message-ID: <87leu3begz.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=yantar92@gmail.com; helo=mail-pf1-x435.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=1654948607; 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=CuyT7YIJNcNWzQcC7nG021nJ6One8Pl7kOQgh5GoPvo=; b=FlsL1wqJJFm7XPKvoXpK961n8iqNJkk6vZiKF4diRTRIpCZRMFUblr5Rn7Cj4PRoR+VL7P BonYQuPrzNeLh4l5FX3rNnfz0iFVH/MPmsd9Sk+ri6bxlPKzm3QubIIMyl79ewuvSO/BcK K6A1p7p9h88vY09YofeF5eCFOAOlpoP1NF6Ghsu7crD4Lnmpj0f7GbPCgsp43ALGkB60jr QWVXcJUSLppjv+Z15BCP5gjqaUv9PL2F4Wkuoc0W92kHK7ZYDUwGM1iWGr+/Pj3xyKelGX UbQPiVCMLk4TlvbnUYthlo+sLZj6uzYZXFudDqH3RWqkbZFHrO4GfpNFf9Oh+Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654948607; a=rsa-sha256; cv=none; b=p4/dJyot9o7lRA2ZQSn/IB8VsSYLGF7KiG8aiqTgChLtOBibUiLlZ3mggCcQqDJdIOadXL xzESs8BKXd6U1//28XTMJQlX3VDyI8gwXd+7p7rK1WABWCvvqHd/qz42yLRLTQLnkWN4fw jOtE/FkaOp56CQFT7KTEYktSw5PXAhh2TDjdyvTIl91L2O567RwMsv46DmNrHK98SduLYN LKND5uZbEsDedSLbXBzLf8XCfJdAxMgj8mm160didOsYIIJVbJDGQS5v/p6Y1m3egG7e5k JT+Iy9u0y5G/Mey5v9C/PnkR5OWHLpLXN4jcPHk/yGPe+fO2GC5Xaleq1lJ3Rg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=a7JXcnEx; 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: -8.78 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=a7JXcnEx; 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: 8110431BE3 X-Spam-Score: -8.78 X-Migadu-Scanner: scn0.migadu.com X-TUID: 45NlaBOtasQX --=-=-= Content-Type: text/plain Alen Alex Ninan writes: > 1. Have I made an error in how I define the directory local file? No. > 2. If I have not made and error, Is it possible to define the attachment > directory in directory local variable and have org mode respect the > location when display of inline images are enabled during startup? The problem you are seeing is because Emacs assigns directory-local and buffer-local variables _after_ Org mode (or any other major mode) is loaded. Org startup staff happens during loading before directory-local variables are assigned. Hence error. I've seen multiple issues coming from the above behavior. Hence, I'd like to propose Org to call `hack-local-variables' early during startup. The patch is attached. Best, Ihor --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-mode-Make-local-variables-effective-during-Org-s.patch >From 85af884fcb70cda42acd4cb1610411dcacac82b9 Mon Sep 17 00:00:00 2001 Message-Id: <85af884fcb70cda42acd4cb1610411dcacac82b9.1654948539.git.yantar92@gmail.com> From: Ihor Radchenko Date: Sat, 11 Jun 2022 19:53:37 +0800 Subject: [PATCH] org-mode: Make local variables effective during Org startup * lisp/org.el (org-mode): Call `hack-local-variables' early during Org mode startup. This way, Org startup options will regard local variable settings. Fixes https://list.orgmode.org/587be554-906c-5370-2cf2-f08b14fa58ff@gmail.com/T/#u --- lisp/org.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/org.el b/lisp/org.el index 080962cdb..2b8a6cd10 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4606,6 +4606,10 @@ (define-derived-mode org-mode outline-mode "Org" \\{org-mode-map}" (setq-local org-mode-loading t) + ;; 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) (org-load-modules-maybe) (org-install-agenda-files-menu) (when (and org-link-descriptive -- 2.35.1 --=-=-=--