From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id GE4JGEOk9GUFAQAAe85BDQ:P1 (envelope-from ) for ; Fri, 15 Mar 2024 20:40:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id GE4JGEOk9GUFAQAAe85BDQ (envelope-from ) for ; Fri, 15 Mar 2024 20:40:51 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fXtxQciZ; 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=1710531651; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=qTAAZdFnnds5pfpFg1rHNnnNtQIE09yeDT/MOILaM1o=; b=f+t5lUr8OVxOnrpYj/GHQDOJYBtNJ10ZDgJlIM1yJ3Q6fhENR0eMViJiHI1DtcHPg3bXTr jwjNvBjFWuAgkazVnH6ke6itTNlO2pw06nS7N/AYagIXj+9jrOJ7nfDpafI2cPFEzlbS7J eGeTzkZAUKyN2hZFIh23hOOV3k3CBPXH8w/fqH88/kyKqamzycwr7r5vsP2skLV+jVlcHH WKbxP+0Fny6qyKMclvdvCNej9D4FC9Qv/K2jw+c/YW+ynNhry9X/j92nF1tP82HB/ZTvCH zh3kJTx8BjMg2ul+kIZtTOratB1JBK7HuCLzFHW1AfSB8GRHdzqY4V92mFzKfw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1710531651; a=rsa-sha256; cv=none; b=Ls4V9kEsawBLtA5fFrKeUHkLm0FHQZTd9bCq/kIPFLeSFX3Emy5X18wZJGwxPEFprFkcVh n2IPTi15L4F18tv0Y59QbkevfXrNs8r9UNzQzhLk/4rLqbphm0z0Bk0S5Nbu9LNryCq4i5 HV98/Zvfj8WXNrxYdrK0gVyWJb6jLy4mzKOxChVoSV9d+ePVOy6SiYmFX9ZaRS1be52UMx qAiwOgF4BpHMU8muuoD0fCchebPIHb5EF7O2IgPOvjLd5nR3iKJY5Y3bVR1p4XE0LKCmL1 pm2G7G61+TUs5g4t1GznuidRqq86Pt5LBcNBTXY6aN5cf9YCy9YeirkhksBoFw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fXtxQciZ; 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 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 08B605D360 for ; Fri, 15 Mar 2024 20:40:51 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rlDPL-00056k-O6; Fri, 15 Mar 2024 15:39:59 -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 1rlDPJ-00056O-QN for emacs-orgmode@gnu.org; Fri, 15 Mar 2024 15:39:57 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rlDPH-0003Ue-Vt for emacs-orgmode@gnu.org; Fri, 15 Mar 2024 15:39:57 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33ed5b6bf59so488690f8f.0 for ; Fri, 15 Mar 2024 12:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710531593; x=1711136393; darn=gnu.org; h=mime-version:date:subject:to:from:message-id:from:to:cc:subject :date:message-id:reply-to; bh=qTAAZdFnnds5pfpFg1rHNnnNtQIE09yeDT/MOILaM1o=; b=fXtxQciZAh9TbSPs3epKvqYup/Se13qzGytcBBgjHhT/TE8r87c/UWnsS1VWWAfhCF ZjYVeosn6hR/hVFWD1MQEpkSACGmwP7f4Ettve5i+S077UFGEXgIPBqSOVab9mgeQw0q Zj8wo+5fu5VgpZEWBp93RGI5/D03SH877bZMLQwR1XY0k5iAZAgaO3PNqOjJ8vpX6M7z ob6hz4kcAlclvT2BlNF8WaEsZfxaZ0hS3dHNJIB7GfoxXWHTUZZLfq0oj/O84ub/goip ELK2LCRbN0zdyFPEGXREmPE+68pmL03NJvZeTxJj31in+fvqmQjqKH3aamNLzUR0slGe qiIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710531593; x=1711136393; h=mime-version:date:subject:to:from:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=qTAAZdFnnds5pfpFg1rHNnnNtQIE09yeDT/MOILaM1o=; b=UO/dqZGbrfZ/Arn+MRnI9muKK4Nc3MQ4nxglId1Smjpid82XUVpmr8oTQFsooe2Fa9 qImQ+hhg8TXVXEGi7NgjY4WhweSHq3lBpvkQ/p1RubWXJNPzNwAyZLepyBhACSUNyUzT NMllVqELWDzXv46barLl+wxw5HFZfey0w+bQgKOwqzUN0pK4uCYDAQrOMkshArEXvFKW NAWbYbGBbz4v019atnlAvTqQJReobB16wEj01WbvRNx4WJV5oSDc9Nqr81/5RbdxX1hY DXeUHKbVWYRybRdrJJZD0Bd7GkHKFFhVrjLzqUUR3PNJUg0J8S/e2kDj8r3l9pbMJNZ2 yJbQ== X-Gm-Message-State: AOJu0Yyp0o+czNOBLJ3ngJ+vF7uSt0HhyOh4W08JnwqO83mhuLKgKix8 uDiDvO009FFZA+LRSO9L9CB6KDhtd16hmHNxKjXHVPJRgmW4Bzb0t0PB1Si8 X-Google-Smtp-Source: AGHT+IFn9uRAHl1Y7OKd99yUOw3+dFh0rAKue1Qalq0h/ctbbpciR1ZoaEOozqfa3g4Fg/bucJHomQ== X-Received: by 2002:a5d:4e51:0:b0:33e:90b8:9332 with SMTP id r17-20020a5d4e51000000b0033e90b89332mr3695359wrt.49.1710531593061; Fri, 15 Mar 2024 12:39:53 -0700 (PDT) Received: from keynux ([2a01:e0a:505:3460:1c18:688d:ece4:372e]) by smtp.gmail.com with ESMTPSA id d10-20020adfe88a000000b0033b6e26f0f9sm3821619wrm.42.2024.03.15.12.39.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 12:39:52 -0700 (PDT) Message-ID: <65f4a408.df0a0220.5debf.2c65@mx.google.com> Received: by keynux (sSMTP sendmail emulation); Fri, 15 Mar 2024 20:39:51 +0100 From: Bruno Barbier To: emacs-orgmode@gnu.org Subject: [BUG] org-babel-execute-subtree removes all overlays (org-fold-save-outline-visibility) [9.7-pre, gfb61e8] Date: Fri, 15 Mar 2024 20:39:50 +0100 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=brubar.cs@gmail.com; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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_FROM=0.001, MSGID_FROM_MTA_HEADER=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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -0.70 X-Spam-Score: -0.70 X-Migadu-Queue-Id: 08B605D360 X-Migadu-Scanner: mx11.migadu.com X-TUID: 98dSyrn9N9tW Hi, Org removes all overlays when calling org-babel-execute-subtree. Here is a way to reproduce: #+begin_src elisp (with-temp-buffer (let (ovl (statuses nil) (live-p (lambda (xo) (or (and (overlay-buffer xo) "alive") "dead")))) (insert "* Mandatory heading") (org-mode) (setq ovl (make-overlay (point-min) (point-max))) (push (list "before" (funcall live-p ovl)) statuses) (org-babel-execute-subtree) (push (list "after" (funcall live-p ovl)) statuses) (nreverse statuses))) #+end_src #+RESULTS: | before | alive | | after | dead | Org should not remove overlays it doesn't own. After investigation, it seems that any use of `org-save-outline-visibility' will call: (org-fold-core-region START END nil) ^^^ which will, indeed, remove any overlay (except for those that are both 'org-invisible and 'invisible). Thanks, Bruno Emacs : GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.0) of 2024-03-12 Package: Org mode version 9.7-pre (release_9.6.20-1281-gfb61e8.dirty @ /home/bruno/work/open-src/emacs/orgmode/orgmode/lisp/) current state: ============== (setq org-yank-image-file-name-function 'org-yank-image-autogen-filename org-persist-before-write-hook '(org-element--cache-persist-before-write) org-html-format-headline-function 'org-html-format-headline-default-function org-html-format-drawer-function #[514 "\207" [] 3 ("/home/bruno/work/open-src/emacs/orgmode/orgmode/lisp/ox-html.elc" . 24162)] org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate) org-persist-after-read-hook '(org-element--cache-persist-after-read) org-confirm-elisp-link-function 'yes-or-no-p org-latex-format-headline-function 'org-latex-format-headline-default-function org-latex-format-drawer-function #[514 "\207" [] 3 ("/home/bruno/work/open-src/emacs/orgmode/orgmode/lisp/ox-latex.elc" . 37582)] org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-fold-show-all append local] 5] #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes) org-confirm-shell-link-function 'yes-or-no-p org-odt-format-headline-function 'org-odt-format-headline-default-function org-archive-hook '(org-attach-archive-delete-maybe) org-metaup-hook '(org-babel-load-in-session-maybe) org-occur-hook '(org-first-headline-recenter) org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function org-ascii-format-drawer-function #[NON PRINTABLE] org-bibtex-headline-format-function 'org-bibtex-headline-format-default org-link-parameters '(("attachment" :follow org-attach-follow :complete org-attach-complete-link) ("id" :follow org-id-open :store org-id-store-link-maybe) ("eww" :follow org-eww-open :store org-eww-store-link) ("rmail" :follow org-rmail-open :store org-rmail-store-link) ("mhe" :follow org-mhe-open :store org-mhe-store-link) ("irc" :follow org-irc-visit :store org-irc-store-link :export org-irc-export) ("info" :follow org-info-open :export org-info-export :store org-info-store-link :insert-description org-info-description-as-command) ("gnus" :follow org-gnus-open :store org-gnus-store-link) ("docview" :follow org-docview-open :export org-docview-export :store org-docview-store-link) ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link) ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete org-bbdb-complete-link :store org-bbdb-store-link) ("w3m" :store org-w3m-store-link) ("doi" :follow org-link-doi-open :export org-link-doi-export) ("file+sys") ("file+emacs") ("shell" :follow org-link--open-shell) ("news" :follow #[ ---NON PRINTABLE--- ] ("/home/bruno/work/open-src/emacs/orgmode/orgmode/lisp/ol.elc" . 52731)] ) ("mailto" :follow #[ ---NON PRINTABLE--- ] ) ("https" :follow #[ ---NON PRINTABLE--- ] ) ("http" :follow #[ ---NON PRINTABLE--- ] ) ("ftp" :follow #[ ---NON PRINTABLE--- ] ) ("help" :follow org-link--open-help :store org-link--store-help) ("file" :complete org-link-complete-file) ("elisp" :follow org-link--open-elisp)) org-persist-directory "/tmp/org-persist-6fkhMh" org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-metadown-hook '(org-babel-pop-to-session-maybe) org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org--warnings nil org-babel-pre-tangle-hook '(save-buffer) org-export-before-parsing-hook '(org-attach-expand-links) org-link-shell-confirm-function 'yes-or-no-p org-fold-core-isearch-open-function 'org-fold--isearch-reveal outline-isearch-open-invisible-function 'outline-isearch-open-invisible org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-agenda-loop-over-headlines-in-active-region nil org-link-elisp-confirm-function 'yes-or-no-p org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines org-cycle-optimize-window-after-visibility-change org-cycle-display-inline-images) org-persist-before-read-hook '(org-element--cache-persist-before-read) org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default org-odt-format-drawer-function #[514 "\207" [] 3 ("/home/bruno/work/open-src/emacs/orgmode/orgmode/lisp/ox-odt.elc" . 18494)] )