Re: [BUG] org-archive-subtree when archiving to same buffer, loses narrowing and folding

2025-08-01 Thread Benjamin McMillan
> Might as well just use org-with-wide-buffer I think. Ah, didn't know about that one. Sounds good, will try it. > But that will do exactly the opposite of what `org-fold-show-subtree' does, won't it? I thought `org-fold-show-subtree' was there because various later commands wouldn't work well i

Re: [BUG] org-archive-subtree when archiving to same buffer, loses narrowing and folding

2025-07-27 Thread Ihor Radchenko
Benjamin McMillan writes: >> We cannot use `without-restriction' because it is only available since >> Emacs 29, while we still support Emacs 28. > > Got it! Will use (save-restriction (widen) ...) instead. Might as well just use org-with-wide-buffer I think. >> More importantly, this will like

Re: [BUG] org-archive-subtree when archiving to same buffer, loses narrowing and folding

2025-07-26 Thread Benjamin McMillan
> We cannot use `without-restriction' because it is only available since > Emacs 29, while we still support Emacs 28. Got it! Will use (save-restriction (widen) ...) instead. > More importantly, this will likely break > 44e7ed1a59c8587c2d5c3a54917576f1505a6c7b that purposely calls > `narrow-to-su

Re: [BUG] org-archive-subtree when archiving to same buffer, loses narrowing and folding

2025-07-22 Thread Ihor Radchenko
Benjamin McMillan writes: > Ihor, I don't quite understand your remark about the two previous patches, > are they something I need to take into account in this patch? Yes. More specifically, you should make sure that the commits I linked to are not broken by your patch. > Although the commit on

Re: [BUG] org-archive-subtree when archiving to same buffer, loses narrowing and folding

2025-07-22 Thread Benjamin McMillan
Here is my patch, which works for my use case. Although the commit only changes a couple of lines, there are large blocks whose indentation changes. The non-whitespace changes are 1) to add a without-restriction as soon as buffer switches to archive buffer. 2) to wrap the call to org-fold-show-all

Re: [BUG] org-archive-subtree when archiving to same buffer, loses narrowing and folding

2025-07-19 Thread Ihor Radchenko
Benjamin McMillan writes: > When archiving a subtree to a different heading in the same buffer, all > headings are unfolded and the current narrowing is lost. This is easily > reproduced in a minimal instance of emacs by the following steps: > > 1. In an org file, create two headings "head" and "

[BUG] org-archive-subtree when archiving to same buffer, loses narrowing and folding

2025-06-06 Thread Benjamin McMillan
When archiving a subtree to a different heading in the same buffer, all headings are unfolded and the current narrowing is lost. This is easily reproduced in a minimal instance of emacs by the following steps: 1. In an org file, create two headings "head" and "arch". Create a "child" heading for "