Subject: bug#56423: 29.0.50; Hi-lock in dired broken by toggling wdired-mode

From: Eli Zaretskii <[email-masked]>
Date: Thu, 07 Jul 2022 13:35:10 +0300

> From: Michael Heerdegen <[email-masked]>
> Cc: [email-masked]
> Date: Thu, 07 Jul 2022 12:26:03 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Don't we need to make sure font-lock-major-mode is restored no matter
> > how wdired is exited, whether normally or abnormally?
> 
> There are two official ways to return - `wdired-abort-changes' and
> `wdired-finish-edit' - both call `wdired-change-to-dired-mode' (which I
> modified).
> 
> If a way of exiting doesn't call `wdired-change-to-dired-mode' your
> dired buffer would be broken afterwards AFAIU - you must call it to get
> rid of the modifications made by wdired.

It sounds like you described the "normal" ways of returning?  I mostly
had in mind the "abnormal" ones, via one of the non-local exits.  If
that is possible, we should set up unwind-protect form.