GNU bug report logs - #33092
26.1; Re-running shell wipes font-lock from xterm-color

Previous Next

Package: emacs;

Reported by: Allen Li <darkfeline <at> felesatra.moe>

Date: Fri, 19 Oct 2018 07:18:02 UTC

Severity: minor

Found in version 26.1

Full log


Message #8 received at 33092 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Allen Li <darkfeline <at> felesatra.moe>
Cc: 33092 <at> debbugs.gnu.org, "Richard M. Stallman" <rms <at> gnu.org>
Subject: Re: 26.1; Re-running shell wipes font-lock from xterm-color
Date: Wed, 30 Oct 2019 20:18:13 +0100
Allen Li <darkfeline <at> felesatra.moe> writes:

> The `shell' command will call `make-comint-in-buffer' and `shell-mode'.
>
> `shell-mode' will then call `comint-mode' as a derived mode.
>
> `comint-mode' will call `kill-all-local-variables'.
>
> `comint-mode' also adds `font-lock-defontify' to
> `change-major-mode-hook'.  Since we're already in `shell-mode' derived
> from `comint-mode', switching "back" to `shell-mode' wipes font-lock.
>
> I can work around this pretty easily in my personal config, by removing
> `font-lock-defontify' from `change-major-mode-hook' with a well-placed
> advice, but the current behavior doesn't seem comfortable to me.

Yes, that seems odd.  Unfortunately the commit log for this just says:

commit 3dd4c1c5af3cdf77ba98b7255ec4034051107c6f
Author: Richard M. Stallman <rms <at> gnu.org>
Date:   Tue Sep 10 16:44:58 2002 +0000

    (comint-mode): Add font-lock-defontify to change-major-mode-hook.

So I have no idea what this was supposed to fix.  Richard, do you
remember, by any chance?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 5 years and 230 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.