Thanks for sending this! I looked at the patch and it makes sense, but I don't have enough context to determine if it's the right way to fix this. Also, it would be nice to have a unit test since you've already put together an example.
Derek On Wed, Apr 29, 2026 at 2:43 AM Ignacio Casso <[email protected]> wrote: > Ignacio Casso <[email protected]> writes: > > > I tried to use `org-sort-entries` programmatically to keep some > > heading sorted when capturing in it or refiling in it. But I saw that > > sometimes a different heading was the one being sorted. After > > debugging it a little, I realize that `org-sort-entries` works only if > > the target heading is visible in the buffer. If it's not, it sorts its > > top-most parent instead. > > This patch fixes it: > > -- +---------------------------------------------------------------+ | Derek Chen-Becker | | GPG Key available at https://keybase.io/dchenbecker and | | https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org | | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC | +---------------------------------------------------------------+
