unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: 56423@debbugs.gnu.org
Subject: bug#56423: 29.0.50; Hi-lock in dired broken by toggling wdired-mode
Date: Wed, 06 Jul 2022 21:19:35 +0200	[thread overview]
Message-ID: <87mtdmyrp4.fsf@web.de> (raw)
In-Reply-To: <87iloa2hlm.fsf@web.de> (Michael Heerdegen's message of "Wed, 06 Jul 2022 20:58:45 +0200")

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

Michael Heerdegen <michael_heerdegen@web.de> writes:

> [...] and `font-lock-set-defaults' finds that
>
>   (derived-mode-p font-lock-major-mode)
>
> fails so that it recomputes the `font-lock-keywords' from the
> defaults.  I guess we could prevent that happening?

This patch seems to fix the issue.  Good idea?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-WIP-Fix-wdired-vs.-hi-lock-Bug-56423.patch --]
[-- Type: text/x-diff, Size: 1152 bytes --]

From 26baa6c65e934b110499c77255c5c54a89acd116 Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen@web.de>
Date: Wed, 6 Jul 2022 21:16:19 +0200
Subject: [PATCH] WIP: Fix wdired vs. hi-lock Bug#56423

---
 lisp/wdired.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/wdired.el b/lisp/wdired.el
index a5858ed190..7c8969431f 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -261,6 +261,7 @@ wdired-change-to-wdired-mode
   (add-hook 'before-change-functions #'wdired--before-change-fn nil t)
   (add-hook 'after-change-functions #'wdired--restore-properties nil t)
   (setq major-mode 'wdired-mode)
+  (setq font-lock-major-mode 'wdired-mode)
   (setq mode-name "Editable Dired")
   (add-function :override (local 'revert-buffer-function) #'wdired-revert)
   (set-buffer-modified-p nil)
@@ -457,6 +458,7 @@ wdired-change-to-dired-mode
   (force-mode-line-update)
   (setq buffer-read-only t)
   (setq major-mode 'dired-mode)
+  (setq font-lock-major-mode 'dired-mode)
   (setq mode-name "Dired")
   (dired-advertise)
   (remove-hook 'kill-buffer-hook #'wdired-check-kill-buffer t)
--
2.30.2


[-- Attachment #3: Type: text/plain, Size: 17 bytes --]



TIA,

Michael.

  reply	other threads:[~2022-07-06 19:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mtdmyrp4.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=56423@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).