From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CsMBJvbld2HUNQEAgWs5BA (envelope-from ) for ; Tue, 26 Oct 2021 13:26:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id gPMBIfbld2FZfAAAB5/wlQ (envelope-from ) for ; Tue, 26 Oct 2021 11:26:46 +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 BD11BD3A for ; Tue, 26 Oct 2021 13:26:45 +0200 (CEST) Received: from localhost ([::1]:40330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfKbM-0001Vw-0i for larch@yhetil.org; Tue, 26 Oct 2021 07:26:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfKXL-0000fd-J4 for emacs-orgmode@gnu.org; Tue, 26 Oct 2021 07:22:35 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:51071) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfKXI-0001vf-4y for emacs-orgmode@gnu.org; Tue, 26 Oct 2021 07:22:35 -0400 Received: by mail-pj1-x1035.google.com with SMTP id gn3so10700016pjb.0 for ; Tue, 26 Oct 2021 04:22:30 -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=DRY1uXF04lyTBcjksUhsvH2A9+qUmt9QDWuiROPPddo=; b=BwRuB5mK/dfukjzLnrGXBRhlF3OOabaP/SjpGHWEQhyljQwpjm+RV4+rPXmnTv4gzs fQX0i1jXt4Km+nwhpuNvX9V6ld2ua2t0s08WG3p+/aOvK2iIoTjrZL+LdVQLokLn9/u7 fk94Ij/aKirm6edA4to0yOoeZN2c2yi9y+lEsuIDSXJOPHElk8FOjMX24ryrnDJMcZCL YnJM8pe1ueTdrp8hC/iIfJBTMdhXF4scnrvPOndHoAPBwTUqSHcjyuwSux9jyoIoZ9y8 HXnWjmMcnzsTetZwS/orkLhoqpiwIYgDGcXxWA6W6ckCRiWJaPrSbDMJ4TM3y1/7zWjf pQTA== 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=DRY1uXF04lyTBcjksUhsvH2A9+qUmt9QDWuiROPPddo=; b=tklKsHHirRPxzMoEKOOTGcGMboCvD5dvGUplgt++avWVibxGnJeLtauUfbUE8sHA/B 7rlMc++4jetrl6KHxmIYyj9NfjayWkRMlFwJSzO6VmZiHtM92x43xpxThzb5Y4j+Sk+W Mr3G5vnFC2br6YtG1ct93FJslhjG6JoDit4uxW0CRkpScom+yLuuG13Klqdy5MtYVcp6 4KLZBXg2wEE0lFsYaEz2GSFWtceuCe1DzHskVsQYVf4IKnwW42QlpibXUszR0ksmMMg0 IroJtxB4A3ljNJDi/D57HKPXNA1VdCMRUS9WRyoFtvMN1IifyIR+h/mgSpBx98PU4/7U YGPA== X-Gm-Message-State: AOAM531ER9/4+gF7edat0gC012piOOeNFAKHXPJegAGLAO0oxAe+tJKX wF/PYWkcyvTibdhkd6Ra0t8= X-Google-Smtp-Source: ABdhPJyHqd3fovYfqj+ncbPKdtwqk4qKlI8E0ccIqpqXPs17x221FDUKXE7STnFGHC+KQxGoC2yNyg== X-Received: by 2002:a17:90a:4586:: with SMTP id v6mr9625298pjg.43.1635247349177; Tue, 26 Oct 2021 04:22:29 -0700 (PDT) Received: from localhost ([103.125.234.161]) by smtp.gmail.com with ESMTPSA id s6sm11062101pfu.137.2021.10.26.04.22.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 04:22:28 -0700 (PDT) From: Ihor Radchenko To: Colin Baxter =?utf-8?Q?=F0=9F=98=BA?= Subject: Re: org-persist warning when archiving In-Reply-To: <87sfworvq8.fsf@yandex.com> References: <87wnm0rw3b.fsf@yandex.com> <87sfworvq8.fsf@yandex.com> Date: Tue, 26 Oct 2021 19:23:54 +0800 Message-ID: <87cznsuj05.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1035.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.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=1635247606; 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=DRY1uXF04lyTBcjksUhsvH2A9+qUmt9QDWuiROPPddo=; b=M3xVzf+7ecYZ84kLzEHml5aswSaecVb3OW3Cz7HRG36FFlHaw0ZdU/2pUNeXo9VggAaHoL hQAzl6tDyLJU8ZpdvveHs/ArRyWZyQrhoADwj28IXGwl0mLEqLgVHKG9+sEkIKAxWtdp23 hhiyqW9tO+YYYAT4cfggsXXiAVt56cTts0vfj8UKV2WtaOY9sqxkaF/Gpr7LwZY0VHnIA3 HMrSk/HP1VX9mhyIWvT1EY32psohg2Vho/IZUa1NHdTML/8NWt3qtfavpUhD+Qx6wj+Rip zrgDPl7LGj5H/v+qdQS9EPF4CbjT/pXrWTfuOs3lNjsw/1ufPiWk1picuDr+EA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635247606; a=rsa-sha256; cv=none; b=GAOIu5+xaxlHTqKG1ZSNXZsdHo32yF1rNvUrTwNPcamUxRl/Al0fOsCjuulfp6cR19fjlO aQx2TvDVibyKcqr7SQKDtsKR2uSSBTytUCk1+8qd54n1RrWwIXtxO+wGxiL4APOIiW2pKs Je0tX/k5baNauu6AWd/MzHOhWtvqGxFWMV0K7tOyrj3u/cgPAqzn2mDhCQjlxAt04/P7gK qhmlSbbZvBtZaQUM4c5gn8feJCxf8zHE8qlVkHhayf2CqQVzPO3gqqvpJeizGNoDttNWVO zt8+pWFlumeLREOl4i65IDoih5Oa+TONMAkuDGoLDJKCnahVEspzMko4SLDplA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=BwRuB5mK; dmarc=pass (policy=none) header.from=gmail.com; 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: -3.26 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=BwRuB5mK; dmarc=pass (policy=none) header.from=gmail.com; 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: BD11BD3A X-Spam-Score: -3.26 X-Migadu-Scanner: scn0.migadu.com X-TUID: 0Rm1pKTI+pk5 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Colin Baxter =F0=9F=98=BA writes: > > Hello, Whenever I archive a DONE item via 'C-c C-x C-a' I get the > > warning: > > > Warning (emacs): org-element--cache: Unregistered buffer > > modifications detected. Resetting. > > > The archiving is successful, but I keep getting the warning and > > therefore wonder if there is some org-persist or cache setting > > that needs to be adjusted. > > Thinking a little more about this, I have not yet had a chance of > archiving an item in a new emacs session. It may be that the warning > is temporary to the first session and will disappear if and when I > archive a DONE item in a new session. This message always indicates some problem. However, I cannot reproduce what you observe on my side. Did you try with emacs -Q? Also, you might not be running the latest Org. I have extended this warning in recent commits. My crystal ball tells me that the attached patch might help. Can you try it? Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org.el-org-mode-Do-not-inhibit-after-change-function.patch >From da1e23bd1d8aaa673d034b288a6088868fe8abb7 Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Tue, 26 Oct 2021 19:19:57 +0800 Subject: [PATCH] org.el/org-mode: Do not inhibit `after-change-functions' when loading * lisp/org.el (org-mode): Let-bind `buffer-undo-list' instead of using `org-unmodified'. The latter suppresses org-element-cache handling of buffer changes. --- lisp/org.el | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 69ff7a8d4..a20be7aac 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4672,22 +4672,22 @@ (define-derived-mode org-mode outline-mode "Org" (= (point-min) (point-max))) (insert "# -*- mode: org -*-\n\n")) (unless org-inhibit-startup - (org-unmodified - (when org-startup-with-beamer-mode (org-beamer-mode)) - (when (or org-startup-align-all-tables org-startup-shrink-all-tables) - (org-table-map-tables - (cond ((and org-startup-align-all-tables - org-startup-shrink-all-tables) - (lambda () (org-table-align) (org-table-shrink))) - (org-startup-align-all-tables #'org-table-align) - (t #'org-table-shrink)) - t)) - (when org-startup-with-inline-images (org-display-inline-images)) - (when org-startup-with-latex-preview (org-latex-preview '(16))) - (unless org-inhibit-startup-visibility-stuff (org-cycle-set-startup-visibility)) - (when org-startup-truncated (setq truncate-lines t)) - (when org-startup-numerated (require 'org-num) (org-num-mode 1)) - (when org-startup-indented (require 'org-indent) (org-indent-mode 1)))) + (let ((buffer-undo-list t)) + (when org-startup-with-beamer-mode (org-beamer-mode)) + (when (or org-startup-align-all-tables org-startup-shrink-all-tables) + (org-table-map-tables + (cond ((and org-startup-align-all-tables + org-startup-shrink-all-tables) + (lambda () (org-table-align) (org-table-shrink))) + (org-startup-align-all-tables #'org-table-align) + (t #'org-table-shrink)) + t)) + (when org-startup-with-inline-images (org-display-inline-images)) + (when org-startup-with-latex-preview (org-latex-preview '(16))) + (unless org-inhibit-startup-visibility-stuff (org-cycle-set-startup-visibility)) + (when org-startup-truncated (setq truncate-lines t)) + (when org-startup-numerated (require 'org-num) (org-num-mode 1)) + (when org-startup-indented (require 'org-indent) (org-indent-mode 1)))) ;; Add a custom keymap for `visual-line-mode' so that activating ;; this minor mode does not override Org's keybindings. -- 2.32.0 --=-=-=--