From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id sIbHKSbH/2b1NAEAqHPOHw:P1 (envelope-from ) for ; Fri, 04 Oct 2024 10:44:54 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id sIbHKSbH/2b1NAEAqHPOHw (envelope-from ) for ; Fri, 04 Oct 2024 12:44:54 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IpkRtNHL; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1728038694; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=kpCc5MTkjL0HdTeFK385WNdDKLCc+xPmwAZFrTMaW7Q=; b=Gm3MWugSS43yDrF757rBWakR0wwS12yv15HcylFf44G0Cn5qE5GcLUPPERlGdEat9LVT4y O6vzPyeLzwH4HnUqe+nTDqUcpZw++NljHWCFpK/96xCqflB4YSbMWhJ5W42Y6fi/S4db+h 1WzMma05ounjSj9X1gU4RysxU7Pbd/opZSMRAdfQm7MWlq/yRj6DvIa4hnaM1d40/w9eWs Cr3jAUKIxudS58wmEbHjwFg7gcPTO1O9n4ZF1PaC8ZTO7wXUD/wqLFow/wJnZmc+sxMEbd IZzrwTCDsNh+D7p6JdBHI0UOgkBMzB7Jy5QQS+JBxzGRNHq/Qtb4EJoUm+siMg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IpkRtNHL; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1728038694; a=rsa-sha256; cv=none; b=AT7wfZfkvJjvA+GIfqPXPnsOd1VfYKdqDpPFnLqqQ9xsfIrVLyWYylI11iyG20gRY+OCq0 ZuSHWS0h+H5zhsCSAS2D0rYhM73T3BJzYtcteJ6kgxXvlWr+lBIihlNoI23FmmeB0K3h73 8pZErg0Qo++rihOtkKvaJwRrda00TXTgzbqJikWcXqF396iozZjh/u1SrXBgiWGWacTBSX jPqRrG0iGkN/TDkYggK2F0Mi/iVYUm7XOO1FeeLhxcGhilMbt+xHP+OQlWDyVE+DrGKuPp h5ZQ+c/ihFP7fjWlP94NVfQiU1ZddbydZTkeKm5T6aNH5AOmmNGCBvTVSulkTA== 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 3360F8FA83 for ; Fri, 04 Oct 2024 12:44:54 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swfn6-0001hk-5w; Fri, 04 Oct 2024 06:44:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swfn4-0001hb-T4 for emacs-orgmode@gnu.org; Fri, 04 Oct 2024 06:44:06 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swfn3-0001Ui-De for emacs-orgmode@gnu.org; Fri, 04 Oct 2024 06:44:06 -0400 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2e0b93157caso2192527a91.0 for ; Fri, 04 Oct 2024 03:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728038643; x=1728643443; darn=gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kpCc5MTkjL0HdTeFK385WNdDKLCc+xPmwAZFrTMaW7Q=; b=IpkRtNHLemKpzyRau1k+7/DmhZC5qYIfZCFZirKDxpzmqjrZywgLKYGOVd9zgdNpXg 5ezLuZBEqKsD/M9ATJ73pYu78ZmPtC7gWIHulX1l0GbHbGKBEQrCzs6TdpWz/9rzk/Hb ru95oqhbcv6OLZcC3JTdFgJhReZ4WVgQfoTS8cTvRhb337p2dGmEeDgXuxiJ/bsGC5B4 fS/a1Ca9L2OAIjW+FO2whndpu9tQZga8QKxd7HnM11i9adeHMgLrmCCiqGSbJ7urwNEE xJQ/d+qX2twxlu8l9EXyFDnyot4F/NBTnm7FpukCs4uLbDQ4TED7xlMN7N62yLUwDW3Y zRNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728038643; x=1728643443; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kpCc5MTkjL0HdTeFK385WNdDKLCc+xPmwAZFrTMaW7Q=; b=H+cLmlzcB0aq1dmQ+DLy4MXcjv81a/2z+WOu8v3NZtAUBsG/TFeeoxrnY8aqSuNOzG KqL39TUPmwZKcmDduTHPVEnoWKqkue/A5f+D1uQ6SoGJXsi407og48B9HuWydaQjQLw5 q0vTW0Vh8z4THyXm/70Zk4QKCDsFFc/CPW0aod8wh7ur71XY2nNUX3eJgZmLh0NQOqIr JjXjvKPNFVhIF98gykiP1lssvyBT5ucTpAjFZyfzKqgKGdZwAZig2IbdPPwN2CEDCyg1 YuiXpZh/pR/kYzjH1h5Ifyd5RCGzATZ53izTx8W+WbJLXmBvTljYOA+vTPJJi+X3IQmX te/A== X-Gm-Message-State: AOJu0YwLjmpQTzVwZk767KpZuy++ayqJc3leOGMZTJZR9NaNoJmkI+MQ dUEBe93TWrgxSzKGaCmFyrEQXIXg03k8Jsu6qgkaKYWYiIdV1bqqinLFmrdT X-Google-Smtp-Source: AGHT+IE/izmihcysPvBQ/3bS/xnPSgCCSp3i+7fdr3E50NBMY0NLFloN6XM4yImIeVx1eIrEAvd3SA== X-Received: by 2002:a17:90a:c70a:b0:2d8:a744:a81c with SMTP id 98e67ed59e1d1-2e1b3752147mr9605367a91.1.1728038643147; Fri, 04 Oct 2024 03:44:03 -0700 (PDT) Received: from localhost.localdomain ([103.211.132.17]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e1e86210ffsm1234320a91.37.2024.10.04.03.44.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 03:44:02 -0700 (PDT) From: Akash To: akashpaul21@gmail.com Cc: emacs-orgmode@gnu.org Subject: Re: org-element-cache error when storing footnotes using capture buffer Date: Fri, 4 Oct 2024 16:13:57 +0530 Message-Id: <20241004104357.119625-1-akashpaul21@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=akashpaul21@gmail.com; helo=mail-pj1-x102f.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -0.17 X-Spam-Score: -0.17 X-Migadu-Queue-Id: 3360F8FA83 X-TUID: c1JLKLCnj5zy Dear Maintainers, I seem to have been able to solve this issue through some brute force debugging. The problem emanates from when copying over the local variables, especially the `buffer-file-name' variable The function definition `org-src--edit-element' contains a provision to make the said variable nil - but it is quickly reset during initialisation of the buffer just 1 line downstream. Moving the setq statement 4 lines below seems to solve the issue, Herein I give the patch, ``` --- org-src.el 2024-10-04 15:54:11.357117268 +0530 +++ org-src-patched.el 2024-10-04 15:55:24.041730163 +0530 @@ -609,7 +609,6 @@ (let ((lf (eq type 'latex-fragment))) (unless preserve-ind (org-do-remove-indentation (and lf block-ind) lf))) (set-buffer-modified-p nil) - (setq buffer-file-name nil) ;; Initialize buffer. (when (functionp initialize) (let ((org-inhibit-startup t)) @@ -617,6 +616,7 @@ (funcall initialize) (error (message "Initialization fails with: %S" (error-message-string e)))))) + (setq buffer-file-name nil) ;; Transmit buffer-local variables for exit function. It must ;; be done after initializing major mode, as this operation ;; may reset them otherwise. ``` The following in .init can also be done by users not willing to patch the source file `org-src.el' ;; HHHH--------------------------------------------------- (defun patch/org-src--edit-element (&rest args) (setq-local buffer-file-name nil)) (advice-add 'org-src--edit-element :after #'patch/org-src--edit-element) ;; HHHH--------------------------------------------------- Thank you, Akash P