unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56423: 29.0.50; Hi-lock in dired broken by toggling wdired-mode
@ 2022-07-06 16:22 Michael Heerdegen
  2022-07-06 18:58 ` Michael Heerdegen
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Heerdegen @ 2022-07-06 16:22 UTC (permalink / raw)
  To: 56423


Hello,

in a dired buffer, M-x hi-lock-face-buffer RET and enter a pattern so
that there are matches.  Then M-x wdired-change-to-wdired-mode and edit
something (insert a char or so).  Hi-Lock highlighting immediately
disappears.  Changing back to normal dired doesn't let highlighting
reappear.  That's not good.  I would like highlighting to stay when
starting or finishing `wdired-mode'.

The (only) reason for this is that when toggling `wdired-mode' the
hi-lock pattern rules added to `font-lock-keywords' are gone (why?).

So this fixes the problem for me:

#+begin_src emacs-lisp
(defun my-wdired-run-font-lock-mode-hook (&rest _)
  "Necessary to get hi-lock survive toggling `wdired-mode'."
  (run-hooks 'font-lock-mode-hook))

(dolist (f `(,#'wdired-change-to-wdired-mode
             ,#'wdired-finish-edit
             ,#'wdired-abort-changes))
  (advice-add f :after #'my-wdired-run-font-lock-mode-hook))
#+end_src

Running `hi-lock-font-lock-hook' instead of the complete
`font-lock-mode-hook' also works.

I would like to know why this is necessary at all, and what a correct
fix that can be installed would look like.

TIA,

Michael.


In GNU Emacs 29.0.50 (build 14, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2022-07-06 built on drachen
Repository revision: b2df1cc19c2312b27f7bab6b3eb7d339f668113d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)






^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-07-08 12:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06 16:22 bug#56423: 29.0.50; Hi-lock in dired broken by toggling wdired-mode Michael Heerdegen
2022-07-06 18:58 ` Michael Heerdegen
2022-07-06 19:19   ` Michael Heerdegen
2022-07-07  5:35     ` Eli Zaretskii
2022-07-07 10:26       ` Michael Heerdegen
2022-07-07 10:35         ` Eli Zaretskii
2022-07-07 11:14           ` Michael Heerdegen
2022-07-07 13:29             ` Eli Zaretskii
2022-07-07 15:09               ` Michael Heerdegen
2022-07-07 15:19                 ` Michael Heerdegen
2022-07-07 16:03                   ` Eli Zaretskii
2022-07-08 12:04                     ` Michael Heerdegen
2022-07-08 12:22                       ` Eli Zaretskii
2022-07-08 12:57                         ` Michael Heerdegen
2022-07-08 12:59                           ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).