> AFAICT the problem is that sometimes this heading is already hidden > (because of a preceding subtree covering the current one), so we end up > going back to the preceding/larger subtree and re-hiding it. So for > a subtree like that of `;;; Code:` covering N smaller subtrees that were > previously hidden, we end hiding the `;;; Code:` subtree N times (and > each time, this requires looping through all the covered headings), > which introduces an O(N^2) complexity. The patch below seems to fix it (and bug#78673 as well). Juri, comments? Stefan