From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +IiiE2/5qmFA9QAAgWs5BA (envelope-from ) for ; Sat, 04 Dec 2021 06:15:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yPAtD2/5qmEmAwAAbx9fmQ (envelope-from ) for ; Sat, 04 Dec 2021 05:15:27 +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 426802D7FF for ; Sat, 4 Dec 2021 06:15:26 +0100 (CET) Received: from localhost ([::1]:54698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtNOO-0008Ey-0Y for larch@yhetil.org; Sat, 04 Dec 2021 00:15:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtM6u-0004u9-3U for emacs-orgmode@gnu.org; Fri, 03 Dec 2021 22:53:17 -0500 Received: from [2607:f8b0:4864:20::335] (port=42782 helo=mail-ot1-x335.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtM6r-0006Vs-Fb for emacs-orgmode@gnu.org; Fri, 03 Dec 2021 22:53:15 -0500 Received: by mail-ot1-x335.google.com with SMTP id 47-20020a9d0332000000b005798ac20d72so5937981otv.9 for ; Fri, 03 Dec 2021 19:53:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=YzWPoLUZBw/MEP83YwtjKi/zdVEJ4opbdFvL5o4/f1I=; b=eC3z3vewWlXS8efqN+pVy8sxr+VO8mUxErGLVGfGgAHR46aIBPnLv8ZYCTQYqHaVES ykXhTIxHqLp84ku1ey0zeFo9cZgl87GoSrLY3kQkzG/00aLbGtD0X8M1JXKaOyzLjxf+ KOVK6+rxiAkbkWu8JE9YFws7zWsJnQqtk0lFncuLPVNI3J2/e9MX5eyw51ynxebbUp1C 3PRkPmWdy01UXxCUT8n3mKxPMxEeqONx4XXUK20leqerKsJ5hCHv5s73zDH4ylvIQ5PE NMr/km8KK/CScd41IUrewrk8qR8+xcya6yhn7QGh9LaWs7gzjWBIGrVbhbGAXIegDBTc qhiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=YzWPoLUZBw/MEP83YwtjKi/zdVEJ4opbdFvL5o4/f1I=; b=BlxNNjzDvZytGxvsWf/du3abvz3WZSpeG7DoJKXlVn7deyQz22L2DcrDWdVgVsYTUs 3YTdpnLCGmaj5mpoxL3YppuxE5BwKW2YiMQ4xxzwVXHkHTvThs5dMiNFPXZ/UmyHhJzk xxmg4bhwlGQkWOt/vYsDXbzzNk1XGV1DUzm7NDZ59GxvordEKh8O0YUwGrQCVrJmT0fJ K9pD4pA6pr8EegKrNRM7HXNcPbaZJd2xcHjCOq1ljy2RmVdsJcF8fwHoLZin9xU5JKFv vLLKZnJid9zo+yTfWZ/Ya8ptXayXLkunYCrON5wdAgF2Cb7i0FXdFb+bkGuMvRsvwwzA mBcQ== X-Gm-Message-State: AOAM532gotUjlw8OE/gF3CWKeLrdOx8m78oqLNliW9jWbLeTSFLPHjet eqAdmqDbdtxdo3pndEV+yvG2WrnRJYuzchzv4y5jQPBMVQE= X-Google-Smtp-Source: ABdhPJzbdQTzob7vJkUEEYlZtziS/4ij/JhVcKUa5OKTetcOeKEddgZ9ZCjP0Z3fvN8HnfXo6qtYD9tiengItMyAV1c= X-Received: by 2002:a9d:68d9:: with SMTP id i25mr19713430oto.189.1638589991546; Fri, 03 Dec 2021 19:53:11 -0800 (PST) MIME-Version: 1.0 From: Nisan Stiennon Date: Fri, 3 Dec 2021 19:53:00 -0800 Message-ID: Subject: [BUG] Indirect buffer of indirect buffer is truncated [9.5.1 (9.5.1-g36086a @ /home/nisan/.emacs.d/elpa/org-9.5.1/)] To: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="00000000000060f35105d249f6c5" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::335 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::335; envelope-from=nisan.stiennon@gmail.com; helo=mail-ot1-x335.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, HTML_MESSAGE=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-Mailman-Approved-At: Sat, 04 Dec 2021 00:14:48 -0500 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-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638594926; 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=YzWPoLUZBw/MEP83YwtjKi/zdVEJ4opbdFvL5o4/f1I=; b=cCE3dyopjHSbwW4ZXxBo08XIOdT6c65cFp1JT7KzTCDG7Lr2iaK6o6Ae+inROoGTALimFR 1Ik6cTSpOFjhvZEB6xlMIsbn24TQFjQNZnGHxVHZ4YYeMvddgd1w112CfiobDcPXvLXg2Y kmeX3L4aNdkOS3xKRDmefJzm9YH8YVSESDIfhdIHiper1w2FbDyB9irpLfBalPxY/echOV 9oXr1SkQT1F9c+gs8hXyg+7eotkYN4Xj395I5fyRyv2Y22dzLr81WRBUxigTDDbsn3AsTv yba9dLy7OY1Ys4flQjqPKlFOKKVtXxLPQPbCnidq3q9lWtkBA70H4crlTg1VQw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638594926; a=rsa-sha256; cv=none; b=StwJnmWSafnC9HTn9a8a+aaXC1trxKHsnjW6hxg615osXL1H7/kTxhPMx+8OgpV2sCbFev xJ+aaK5ZjCEFVOD9hTeviDWQdHNdWP5mlIJp+UY1QLTLg4Ivj2Ze7c2kjirjc/DQdX7Jbq /c9gKVLb7ojgjMJ7fmYIjeGA/l9flnIQ3QZtOxexHlJ4Mj9Ok330CzFvcKU6SGm8DCAxEK S2IsK1cgqc8PAgCyVnkMtVSMbz/5H25zgtoEB7PmQzVVG6U87is0qS5iMsURvZ8gqMR5X1 4k1w8BNifE7RRGjCIBJsy94P7twPx01Kbxtyp4IBNdzVLuZKoBrOLMiCQqXCNw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eC3z3vew; 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: -4.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eC3z3vew; 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: 426802D7FF X-Spam-Score: -4.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: dsAlqtic6eI8 --00000000000060f35105d249f6c5 Content-Type: text/plain; charset="UTF-8" If I run org-tree-to-indirect-buffer twice with a prefix argument, I get a buffer that's too narrow and omits the text of the last heading in the tree. In this state, tree operations can result in data loss. To reproduce, open a file containing the following data: * I ** A ** B * II Follow these steps: 1. S-tab to fold everything. 2. With point on the "I" heading, C-u C-c C-x b to open an indirect buffer. 3. With point on the "I" heading in the new buffer, C-u C-c C-x b to open another indirect buffer. The buffer created in step 3 will look like: * I ** A ** Note that the text "B" is missing from the last heading. Expected behavior is * I ** A ** B 4. With point on the last, blank heading in the buffer created in step 3, M-up to move the heading. The heading will disappear, resulting in: * I ** A If you write the file, it will look like this: * I ** A B * II Expected behavior from steps 1-4 is: * I ** B ** A * II I can reproduce on both the version of org that shipped with emacs 27.2, and with the gnu elpa package. Emacs : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2021-11-04 Package: Org mode version 9.5.1 (9.5.1-g36086a @ /home/nisan/.emacs.d/elpa/org-9.5.1/) current state: ============== (setq org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-link-shell-confirm-function 'yes-or-no-p org-metadown-hook '(org-babel-pop-to-session-maybe) org-clock-out-hook '(org-clock-remove-empty-clock-drawer) org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-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-archive-hook '(org-attach-archive-delete-maybe) org-confirm-elisp-link-function 'yes-or-no-p org-agenda-before-write-hook '(org-agenda-add-entry-text) org-metaup-hook '(org-babel-load-in-session-maybe) org-bibtex-headline-format-function #[257 "\300 \236A\207" [:title] 3 "\n\n(fn ENTRY)"] org-babel-pre-tangle-hook '(save-buffer) org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-agenda-loop-over-headlines-in-active-region nil org-occur-hook '(org-first-headline-recenter) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate) org-export-before-parsing-hook '(org-attach-expand-links) org-confirm-shell-link-function 'yes-or-no-p org-link-parameters '(("attachment" :follow org-attach-follow :complete org-attach-complete-link) ("id" :follow org-id-open) ("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) ("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) ("file+sys") ("file+emacs") ("shell" :follow org-link--open-shell) ("news" :follow #[514 "\301\300\302 Q \"\207" ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"] ) ("mailto" :follow #[514 "\301\300\302 Q \"\207" ["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"] ) ("https" :follow #[514 "\301\300\302 Q \"\207" ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"] ) ("http" :follow #[514 "\301\300\302 Q \"\207" ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"] ) ("ftp" :follow #[514 "\301\300\302 Q \"\207" ["ftp" browse-url ":"] 6 "\n\n(fn URL ARG)"] ) ("help" :follow org-link--open-help) ("file" :complete org-link-complete-file) ("elisp" :follow org-link--open-elisp) ("doi" :follow org-link--open-doi)) org-link-elisp-confirm-function 'yes-or-no-p ) --00000000000060f35105d249f6c5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If I run org-tree-to-indirect-buffer twice with a prefix a= rgument, I get a buffer that's too narrow and omits the text of the las= t heading in the tree. In this state, tree operations can result in data lo= ss.

To reproduce, open a file containing the following data:

= * I
** A
** B
* II

Follow these steps:

1. S-tab to f= old everything.
2. With point on the "I" heading, C-u C-c C-x = b to open an indirect buffer.
3. With point on the "I" heading= in the new buffer, C-u C-c C-x b to open another indirect buffer.

T= he buffer created in step 3 will look like:

* I
** A
**
Note that the text "B" is missing from the last heading. Expecte= d behavior is

* I
** A
** B

4. With point on the last, = blank heading in the buffer created in step 3, M-up to move the heading. Th= e heading will disappear, resulting in:

* I
** A

If you wr= ite the file, it will look like this:

* I
** A
B
* II
Expected behavior from steps 1-4 is:

* I
** B
** A
* II

I can reproduce on both the version of org that shipp= ed with emacs 27.2, and with the gnu elpa package.

Emac= s =C2=A0: GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.2= 0, cairo version 1.16.0)
=C2=A0of 2021-11-04
Package: Org mode versio= n 9.5.1 (9.5.1-g36086a @ /home/nisan/.emacs.d/elpa/org-9.5.1/)

curre= nt state:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(setq
=C2=A0o= rg-src-mode-hook '(org-src-babel-configure-edit-buffer
=C2=A0 =C2= =A0 org-src-mode-configure-edit-buffer)
=C2=A0org-link-shell-confirm-fun= ction 'yes-or-no-p
=C2=A0org-metadown-hook '(org-babel-pop-to-se= ssion-maybe)
=C2=A0org-clock-out-hook '(org-clock-remove-empty-clock= -drawer)
=C2=A0org-mode-hook '(#[0 "\300\301\302\303\304$\207&q= uot;
=C2=A0 [add-hook change-major-mode-hook org-show-all append loca= l]
=C2=A0 5]
#[0 "\300\301\302\303\304$\207"
= =C2=A0 [add-hook change-major-mode-hook org-babel-show-result-all
=C2= =A0 =C2=A0append local]
=C2=A0 5]
org-babel-result-hide-spec or= g-babel-hide-all-hashes)
=C2=A0org-archive-hook '(org-attach-archive= -delete-maybe)
=C2=A0org-confirm-elisp-link-function 'yes-or-no-p=C2=A0org-agenda-before-write-hook '(org-agenda-add-entry-text)
=C2= =A0org-metaup-hook '(org-babel-load-in-session-maybe)
=C2=A0org-bibt= ex-headline-format-function #[257 "\300 \236A\207" [:title] 3 &qu= ot;\n\n(fn ENTRY)"]
=C2=A0org-babel-pre-tangle-hook '(save-buff= er)
=C2=A0org-tab-first-hook '(org-babel-hide-result-toggle-maybe =C2=A0 =C2=A0 =C2=A0org-babel-header-arg-expand)
=C2=A0org-agenda-lo= op-over-headlines-in-active-region nil
=C2=A0org-occur-hook '(org-fi= rst-headline-recenter)
=C2=A0org-cycle-hook '(org-cycle-hide-archive= d-subtrees org-cycle-hide-drawers
=C2=A0org-cycle-show-empty-lines =C2=A0org-optimize-window-after-visibility-change)
=C2=A0org-speed-c= ommand-hook '(org-speed-command-activate
=C2=A0org-babel-speed-c= ommand-activate)
=C2=A0org-export-before-parsing-hook '(org-attach-e= xpand-links)
=C2=A0org-confirm-shell-link-function 'yes-or-no-p
= =C2=A0org-link-parameters '(("attachment" :follow org-attach-= follow :complete
org-attach-complete-link)
=C2=A0 =C2=A0 =C2=A0= ("id" :follow org-id-open)
=C2=A0 =C2=A0 =C2=A0 ("eww= " :follow org-eww-open :store org-eww-store-link)
=C2=A0 =C2=A0 = =C2=A0 ("rmail" :follow org-rmail-open :store
org-rmail-sto= re-link)
=C2=A0 =C2=A0 =C2=A0 ("mhe" :follow org-mhe-open := store org-mhe-store-link)
=C2=A0 =C2=A0 =C2=A0 ("irc" :foll= ow org-irc-visit :store org-irc-store-link
:export org-irc-export) =C2=A0 =C2=A0 =C2=A0 ("info" :follow org-info-open :export or= g-info-export
:store org-info-store-link)
=C2=A0 =C2=A0 =C2=A0 = ("gnus" :follow org-gnus-open :store
org-gnus-store-link) =C2=A0 =C2=A0 =C2=A0 ("docview" :follow org-docview-open :ex= port
org-docview-export :store org-docview-store-link)
=C2=A0 = =C2=A0 =C2=A0 ("bibtex" :follow org-bibtex-open :store
org-= bibtex-store-link)
=C2=A0 =C2=A0 =C2=A0 ("bbdb" :follow org= -bbdb-open :export org-bbdb-export
:complete org-bbdb-complete-link := store
org-bbdb-store-link)
=C2=A0 =C2=A0 =C2=A0 ("w3m"= ; :store org-w3m-store-link) ("file+sys")
=C2=A0 =C2=A0 =C2= =A0 ("file+emacs") ("shell" :follow org-link--open-shel= l)
=C2=A0 =C2=A0 =C2=A0 ("news" :follow
#[514 "\= 301\300\302 Q \"\207"
=C2=A0["news" browse-url &= quot;:"] 6 "\n\n(fn URL ARG)"]
)
=C2=A0 =C2=A0 = =C2=A0 ("mailto" :follow
#[514 "\301\300\302 Q \"= \207"
=C2=A0["mailto" browse-url ":"] 6 &qu= ot;\n\n(fn URL ARG)"]
)
=C2=A0 =C2=A0 =C2=A0 ("https&= quot; :follow
#[514 "\301\300\302 Q \"\207"
=C2= =A0["https" browse-url ":"] 6 "\n\n(fn URL ARG)&qu= ot;]
)
=C2=A0 =C2=A0 =C2=A0 ("http" :follow
#[5= 14 "\301\300\302 Q \"\207"
=C2=A0["http" br= owse-url ":"] 6 "\n\n(fn URL ARG)"]
)
=C2= =A0 =C2=A0 =C2=A0 ("ftp" :follow
#[514 "\301\300\302 Q= \"\207" ["ftp" browse-url ":"]
=C2=A0= 6 "\n\n(fn URL ARG)"]
)
=C2=A0 =C2=A0 =C2=A0 ("h= elp" :follow org-link--open-help)
=C2=A0 =C2=A0 =C2=A0 ("fi= le" :complete org-link-complete-file)
=C2=A0 =C2=A0 =C2=A0 (&quo= t;elisp" :follow org-link--open-elisp)
=C2=A0 =C2=A0 =C2=A0 (&qu= ot;doi" :follow org-link--open-doi))
=C2=A0org-link-elisp-confirm-f= unction 'yes-or-no-p
=C2=A0)
--00000000000060f35105d249f6c5--