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 6JWsAuwepmHlsQAAgWs5BA (envelope-from ) for ; Tue, 30 Nov 2021 13:54:04 +0100 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 oE7SOesepmEhHAAAB5/wlQ (envelope-from ) for ; Tue, 30 Nov 2021 12:54:03 +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 A362660AF for ; Tue, 30 Nov 2021 13:54:03 +0100 (CET) Received: from localhost ([::1]:50570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ms2e2-0000B7-Sv for larch@yhetil.org; Tue, 30 Nov 2021 07:54:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ms2cs-0007oD-0m for emacs-orgmode@gnu.org; Tue, 30 Nov 2021 07:52:50 -0500 Received: from [2607:f8b0:4864:20::1036] (port=39874 helo=mail-pj1-x1036.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ms2cl-0002Y3-99 for emacs-orgmode@gnu.org; Tue, 30 Nov 2021 07:52:44 -0500 Received: by mail-pj1-x1036.google.com with SMTP id y14-20020a17090a2b4e00b001a5824f4918so18183738pjc.4 for ; Tue, 30 Nov 2021 04:52:42 -0800 (PST) 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=CM9xni53sy8/fhlbkteLF3z6anSDm9z5sbqQ+HjTYK0=; b=SKkoibOveU4gimyXxjjXUlPe/IStHKXYp+VMHIZ2hd4RvjM7LjeDOn4478Qop71Jvg Wd6PX07iirIWzOgk71NO3Z1E0x0q2z7dqKiqREezHUWqeKQgO+Ueod5uQ7jAH/JulboH 4Pr/xcuFeX85eORlCn5MQHwGntf/1Ai+dhOTAEl3aOdu9PhscsX1+sdh9p+Tu4KNC9SK wG9hZWBSRK2+lMs1hNB23HHgUx98Md3TemnsG5aqH73f00dtooA1fwDmCByehrHyZ4c2 A4dRUBWFxjKH10vFTogiELa26Lu/4YvXMD+tA8Z3W3zqm60mYPcQx9c1V5F5fp9mr2Rw dNzQ== 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=CM9xni53sy8/fhlbkteLF3z6anSDm9z5sbqQ+HjTYK0=; b=h0M2ObecjmfCQFIBIPERj8Aj3yHx4zCJbF4Fm6cw2/c5SMX+9wOjRixN045nnZdv+J Uio7jidgc4ox8H2U9py7aCw/ASomD3azNRz4sx8RJb97M6+1VwQF671E9+SLrs1m2Bvl XWvxe6I0QSxDneL4OtpxzhyGvty/utIwmZS7EjIHIw0cxmGWq+IxBomlD2RJInfOh4mU 02rriPqGVGp0xfnuyWH0XNretbTQe7Gh94W9Iq5+Uy8KKD6+LJKSWkL5ax57XoHF8Dwl 3lizalZHLgy/Kpd2Nnuho7CxJfs9TO88EJ5n4D0BTePdR6RCVtpx80rQLMhe2JuFBoDM jHvQ== X-Gm-Message-State: AOAM531BskhyxqaCcL1BbyAJtWC/HfW/DK7/eISXVfgAUgtnub75bwyw yc7i3jPFt/fxDpJ0x4PXVbo= X-Google-Smtp-Source: ABdhPJwev+7VhFHSeGVEvv6i/+ZyflZPViB/3Clp1kQ2sUOWPSLEazXZSJj2hLUsfwfmesLPcJKXpA== X-Received: by 2002:a17:902:e5d1:b0:141:cd4a:f318 with SMTP id u17-20020a170902e5d100b00141cd4af318mr66954966plf.47.1638276761837; Tue, 30 Nov 2021 04:52:41 -0800 (PST) Received: from localhost ([103.125.234.161]) by smtp.gmail.com with ESMTPSA id s16sm21343044pfu.109.2021.11.30.04.52.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 04:52:41 -0800 (PST) From: Ihor Radchenko To: Max Nikulin Subject: Re: [BUG] C-c C-* causes "org-element--cache: Unregistered buffer modifications detected." In-Reply-To: References: <87pmr6lu1y.fsf@localhost> <87ee7jdv70.fsf@localhost> <87czmtvrbz.fsf@localhost> Date: Tue, 30 Nov 2021 20:54:05 +0800 Message-ID: <871r2x953m.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1036 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1036.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638276843; 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=CM9xni53sy8/fhlbkteLF3z6anSDm9z5sbqQ+HjTYK0=; b=X6Fc+1JBIOPxv5njBjJSz5yeGgQcp8ZnSz22rLcfbaiGTPX/yi/VP0X3BxLQ1ioeG8gwRj c68d3vNbfGBqA29vtueJ6IvgGUgL9MMMHjKvoCMauUfuWgXy4kk7nbBUHA2OAEKJHZngp9 Cpq2xaAw2gFWu4VgM7JX6rpoaUp/URuQyz4tSukO2xyjZwW4PvgXn8ZsHRaDl1HPfri2Uo 7aoZTvWEL4Jq9x3ZZJHnzvVp2xaoXHHFuW2hE5kVV85GyiD/jwtSIaZPsyJV0MZdTNd2zc C1k3nIHxPQXVd9FI6wq6wykomdeTo6wT85snF404+mosfSH8xY+yvFDWuHbF9g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638276843; a=rsa-sha256; cv=none; b=luTLVM2kQQD0mNCKf8GczIdd+nJxTOSzxGvpOYaNNGBlLSJ9bPnFUJI7OmJeF84WRXpclr KJUNvg5w3njW5xeCnB6VI5Ah5ad5YgvEJVQ9fvsqGEfh3NiiAS0kFGZ8XOmcFpNfKTqdmw tJRcGOxpqpN+N6JMMQR5LRM/qpZKDvPt35A4bIDqoqAfKa33mlwuPBi7HxsF3BeTD8CNMS F4rDGo34Zfv1HZGur4xgsN9mSFxtFuf1QZxFAxLdlMNQa8/iBbZM5qCaFA093y9INe6hYD 4tHaV3bg3w0BfplZ1vgeNyJuJ0ZBVZHoA4XVEzkFR/bW6bAbODURjvH+XJePQg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=SKkoibOv; 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.61 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=SKkoibOv; 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: A362660AF X-Spam-Score: -3.61 X-Migadu-Scanner: scn0.migadu.com X-TUID: Hc9HFI1P1Fbo Max Nikulin writes: > Ihor, thank you for your work related to such issues. I had a hope to > thank you for the fix, but I faced a warning again in a bit modified > scenario. This time it is soft indent mode. > ... > First letter of new heading must be a capital one, though it can be > Latin. Converting top-level "H" heading by C-c C-* does not cause such > warning. Well... I added yet another exception on main. Note that this special case is also just in older Emacs versions. > I am not an active user of main branch (I was merely hunting for another > bug), so I can not estimate performance penalty for large files due to > continuous cache resetting. I do not follow emacs-devel mail list last > weeks. Have you managed to negotiate with Eli concerning changes > required in Emacs code? I mean some followups of ... The conclusion from that discussion is that someone needs to prepare upstream patch for Emacs. I may do it in future, but it does not feel like high priority because fixes for Emacs master will not solve the problem in older Emacs versions. (and I secretly hope that this kind of patch will be implemented by someone else as a part of tree-sitter integration). As for the performance, the last series of special cases you reported (thanks again for doing this!) should not happen too frequently. I cannot imagine users spamming C-c C-* all the time. The most problematic is the case triggered by self-insert-command, but it will not trigger cache reset. The worst impact we can see with C-c C-* issue is ~1.5-2x slower agenda (or other full-text search queries) if cache is reset between agenda updates. It is still much better than not using cache. Actually, growing cache too much makes Emacs garbage collector perform pretty poorly (at least when you have a file so large that cache has 300-400k elements). Reducing cache size from time to time may be even beneficial for performance. I do not know the realistic cutoff values though. We may want to implement access frequency-based cache element removal. Best, Ihor