[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff bu
From: |
Juri Linkov |
Subject: |
bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers |
Date: |
Mon, 27 Dec 2021 21:52:13 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) |
>> I am now back to the origin of this bug report (toggling visibility of
>> some diff hunks depending on long lines, chunks size, or file names) and
>> I see there's a major drawback with the outline mode default visibility
>> state approach: When outline minor mode is set through diff-mode-hook,
>> the buffer is emtpy and applying the default state visibility is a
>> no-op; It's a side-effect of the buffer content being generated
>> asynchronously...
>
> I fixed it using an advice to `vc-diff-finish',
This problem is not specific to diff-mode. Like I demonstrated
earlier, xref requires using xref-after-update-hook,
so now it could look like this:
#+begin_src emacs-lisp
(add-hook 'xref-after-update-hook
(lambda ()
(setq-local outline-regexp (if (eq xref-file-name-display 'abs)
"/" "[^ 0-9]")
outline-default-state 1)
(outline-minor-mode)
(outline-apply-default-state)))
#+end_src
> but wondering whether there's a clean way to achieve the same...
Some time ago in another bug report I proposed to add a hook
at the end of 'vc-diff-finish', so it will solve this problem.
PS: Please give me more time to test your patch thoroughly
in various modes.
- bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers, Matthias Meulien, 2021/12/11
- bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers, Juri Linkov, 2021/12/12
- bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers, Matthias Meulien, 2021/12/13
- bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers, Matthias Meulien, 2021/12/26
- bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers, Matthias Meulien, 2021/12/26
- bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers,
Juri Linkov <=
- bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers, Juri Linkov, 2021/12/28
- bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers, Matthias Meulien, 2021/12/28
- bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers, Matthias Meulien, 2021/12/28
- bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers, Juri Linkov, 2021/12/28
- bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers, Matthias Meulien, 2021/12/28