From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#56423: 29.0.50; Hi-lock in dired broken by toggling wdired-mode Date: Wed, 06 Jul 2022 18:22:36 +0200 Message-ID: <874jzui52r.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36245"; mail-complaints-to="usenet@ciao.gmane.io" To: 56423@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 06 18:24:07 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o97ot-0009F7-88 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Jul 2022 18:24:07 +0200 Original-Received: from localhost ([::1]:58272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o97or-0004jk-PS for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Jul 2022 12:24:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o97nq-0003KT-NJ for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2022 12:23:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32812) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o97nq-0002kM-F1 for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2022 12:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o97nq-0003BC-Ag for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2022 12:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Jul 2022 16:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56423 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.165712456912184 (code B ref -1); Wed, 06 Jul 2022 16:23:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Jul 2022 16:22:49 +0000 Original-Received: from localhost ([127.0.0.1]:54942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o97nc-0003AS-Hn for submit@debbugs.gnu.org; Wed, 06 Jul 2022 12:22:49 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:53542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o97nW-0003AC-IJ for submit@debbugs.gnu.org; Wed, 06 Jul 2022 12:22:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o97nW-0002sw-CP for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2022 12:22:42 -0400 Original-Received: from mout.web.de ([217.72.192.78]:34129) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o97nU-0002if-K2 for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2022 12:22:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1657124557; bh=DLeu6/EgV/ig+SXRZIiIJXpYxpqb50MV8rAGpzy0tIw=; h=X-UI-Sender-Class:From:To:Subject:Date; b=YwBZUk+B780VMHEICRg24t98/npF0W2/yQX92rMfltd2rgjgNQUWuNuSmECqSA93e FQ0ssgyHmHqzlLRMOeMAX84T/KqQtdKPILaEjONmm6yAUHnw+yBtdnONjvNuupukiT Gazve8t05jZd6o86SuDHa8sR925yCuWDuFlFMo8Q= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([84.59.210.236]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MMY1N-1nqlQo2D4h-00JLZx for ; Wed, 06 Jul 2022 18:22:37 +0200 X-Provags-ID: V03:K1:1E58ytEQkN++3nn56tCBS8hdSftgAU41ug1SCjDFvlfWUSb6DyQ xUdw04UDJWjmGIxfDqiBaVm+QPMr7e9JmGlC1jaZcRyjZcGiDgFtBLcyWMfj0inJvJXXEyl R2HXtZPRJ2H7EeZ+bEPgMpbRLSC8Ynp58/12W8COXARWKyPe/wnXFcTKwxLORX9Kj5Y3R93 kd6jIZiCEGaebf0NXDk3g== X-UI-Out-Filterresults: notjunk:1;V03:K0:SWSZ1qvS6fc=:dsb9J8cGpEr6VtfnjX/ukV XIgIv67b06HAWfBRp5wPTaJI5GCAFcOnOLiifGOodcABNTVx+kxWjeZycuZEwv27bnjPHbEOC tz0p2jE8+1aTk2C3ux7W0qkdSbORL28XbHMzGsk9LbzxB4aLDxM9y4r3r7fx/8p2kgsw53vHL rNMldN4GvlreQtohSrHECMdGDIjF6AqC4SOYNM70Fz5YJDR/QAFojWo6OAWVYEnknMnJQJ5hs uCyvrO4qJ7oCSVLOX0ytaPRjmCk4rPKh/I75r1oedyVwbz7R5R1Xs3HJv0WoVRWM9pyTAFGs+ k0cgUNx1iarPKwv1JiQOCozSG5FPjVpMsju2bs7cZiWQ7PxIH40vHxQnwTIwyNzahXAn1HXSr aN7qen4PoCHCIkL0SS8pHCUKqEsSzVC/hR6xOjwV4xhLmHLg9dB5PdcAwvcoXASeqK1TSqnad Sh7FTjfL5s8GuIbb+4YNkZSfQM+OvXzV8A7AvSRaKDZ6r5KM/sQIuFFYJ9aaxAvH0+85xWATh NwMpEatr+h9lBdKyA12dsxU7oTSRq3tIUgirLSaHMhqSaOWYX74jQZvz82fKhACqyU6jToKt9 thTAVgDV66EJpfmDpss+MF72GUfVmX6RRga4zYSJG9fQHgLmVjqY/ABuzv80azRnVXwzB81/z CdNEXoILDLjvEVWwcjKX3ANxTPkWdFSWnw5MFJ8fpx1q9zIyVqGJ6Avh959UBQnKj0x4lbduj CQ9PpIEidZMwxQKxR9a5p08mnaz/pqXPPnNM7bltIyx3AAUt6XV5z18QNgQTDb9ctwnExZET Received-SPF: pass client-ip=217.72.192.78; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:236272 Archived-At: 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)