Subject: Re: bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers

From: Juri Linkov <[email-masked]>
Date: Tue, 11 Jan 2022 19:46:05 +0200

>> (...)  Also xref works nicely, although I don't know why it requires
>> `outline-apply-default-state' after enabling `outline-minor-mode':
>
> It's a mistake to rely on `hack-local-variables-hook' to call
> `outline-apply-default-state' when Outline minor mode is enabled since
> `hack-local-variables-hook' is run after processing a file's local
> variable specs.

There is also such a case possible where the file begins with a prop-line:

  # -*- mode: outline-minor; -*-

and ends with the Local Variables section, e.g.:

  # outline-default-state: 2

`hack-local-variables-hook' can handle such case in `outline-minor-mode'.

> I'll send an updated patch after some time using this.

Now you can take in use a new hook added in bug#52855 that allows
applying the default state after vc-diff finishes:

  (add-hook 'vc-diff-finish-functions 'outline-apply-default-state)