Benjamin McMillan <mcmilla...@gmail.com> 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 likely break
>> 44e7ed1a59c8587c2d5c3a54917576f1505a6c7b that purposely calls
>> `narrow-to-subtree'. Your `without-restriction' removes that
>> narrowing.
>
> I don't really use datetrees, and don't know the reasoning for
> `org-narrow-to-subtree' there. I worry I might break it without
> understanding. But anyways, I think it makes sense to place the
> `save-restriction' starting before the `org-narrow-to-subtree' and ending
> when we exit the archive buffer, so I don't see how it would conflict with
> the narrow to subtree.

Looks right. What narrowing certainly affects is jumps to (point-min) and
(point-max), which change once we narrow/widen the buffer.

> Even deleting the `org-fold-show-all' I was not able to recreate the bug
> mentioned in that commit.
> However, there is also a call to `org-fold-show-subtree', which I don't
> think should be removed. For this reason, it may still make sense to wrap
> everything with `org-fold-core-save-visibility'.
> ...
> In fact, a possibly better solution is to not worry about preserving
> folding and instead, at the end of archiving, fold closed the archive
> subtree. It seems that one wouldn't typically want to look at a heading
> that was just archived. Well, if that would break other people's workflow,
> we could leave it as is, but this last option would be my preference.

But that will do exactly the opposite of what `org-fold-show-subtree'
does, won't it?

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to