GNU bug report logs - #35815
26.2; mhtml-mode (in HTML+CSS and HTML+JS) doesn't respect Whitespace Mode face settings

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Andrew T <summerfallsaway@HIDDEN>; Keywords: confirmed; merged with #30263; dated Tue, 21 May 2019 00:32:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Merged 30263 35815. Request was from Tom Tromey <tom@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 35815 <at> debbugs.gnu.org:


Received: (at 35815) by debbugs.gnu.org; 25 May 2020 16:27:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 25 12:27:48 2020
Received: from localhost ([127.0.0.1]:42315 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jdFx5-0000QP-UX
	for submit <at> debbugs.gnu.org; Mon, 25 May 2020 12:27:48 -0400
Received: from gateway31.websitewelcome.com ([192.185.143.51]:11175)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <tom@HIDDEN>) id 1jdFx3-0000QH-Po
 for 35815 <at> debbugs.gnu.org; Mon, 25 May 2020 12:27:46 -0400
Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8])
 by gateway31.websitewelcome.com (Postfix) with ESMTP id 08120BB3D
 for <35815 <at> debbugs.gnu.org>; Mon, 25 May 2020 11:27:45 -0500 (CDT)
Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP
 id dFx2j1MuS1s2xdFx2jVnPj; Mon, 25 May 2020 11:27:45 -0500
X-Authority-Reason: nr=8
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; 
 s=default;
 h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=UNSXMqhlbyoNh9ZtGYqnugwVXFjhYTWOVKXcUeRHo4U=; b=i8e1fkDCU9lOb2cXNjBAPe9/dI
 4/3hR+GdcSzKjCoBlXuxv6lUn5kGTRDhro7twd+wEfk+Vcc3GRVikRfyxQU9AR49zWfXHbaBoagXQ
 TrC9L2fhhRkTSyNhSbibyUbsI;
Received: from 174-16-104-48.hlrn.qwest.net ([174.16.104.48]:36108 helo=bapiya)
 by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256)
 (Exim 4.92) (envelope-from <tom@HIDDEN>)
 id 1jdFx2-0042x3-Lt; Mon, 25 May 2020 10:27:44 -0600
From: Tom Tromey <tom@HIDDEN>
To: Andrew T <summerfallsaway@HIDDEN>
Subject: Re: bug#35815: 26.2; mhtml-mode (in HTML+CSS and HTML+JS) doesn't
 respect Whitespace Mode face settings
References: <df64612e170606ddb2192e5e86de8c48791e1efa.camel@HIDDEN>
X-Attribution: Tom
Date: Mon, 25 May 2020 10:27:43 -0600
In-Reply-To: <df64612e170606ddb2192e5e86de8c48791e1efa.camel@HIDDEN>
 (Andrew T.'s message of "Mon, 20 May 2019 17:30:59 -0700")
Message-ID: <87mu5wrncw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - box5379.bluehost.com
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - tromey.com
X-BWhitelist: no
X-Source-IP: 174.16.104.48
X-Source-L: No
X-Exim-ID: 1jdFx2-0042x3-Lt
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Source-Sender: 174-16-104-48.hlrn.qwest.net (bapiya) [174.16.104.48]:36108
X-Source-Auth: tom+tromey.com
X-Email-Count: 4
X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20=
X-Local-Domain: yes
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 35815
Cc: 35815 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

Andrew> However, MHTML Mode, within CSS or JavaScript blocks, doesn't respect
Andrew> these settings. The dots representing all spaces display in the default
Andrew> foreground color, or in the color of the nearest highlighted text
Andrew> token.

I think the bug here is that whitespace mode ultimately calls
font-lock-add-keywords to do its work.  However, mhtml-mode captures the
value of font-lock-keywords on a per-submode basis.  So, the change is
not detected.

mhtml probably needs some form of indirection in font-lock-keywords, so
it can apply the subregion matchers as well as any introduced by other modes.
I'm not sure there's a way to do this today.  The easiest would be some
form of a function in the list, where the function would return
font-lock-keywords rather than matches.

Tom




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#35815; Package emacs. Full text available.
Added tag(s) confirmed. Request was from Akshay Gaikwad <akgaikwad001@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 21 May 2019 00:31:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 20 20:31:21 2019
Received: from localhost ([127.0.0.1]:38316 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hSsgb-00078I-9Y
	for submit <at> debbugs.gnu.org; Mon, 20 May 2019 20:31:21 -0400
Received: from eggs.gnu.org ([209.51.188.92]:44173)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <summerfallsaway@HIDDEN>) id 1hSsgY-000781-Rp
 for submit <at> debbugs.gnu.org; Mon, 20 May 2019 20:31:19 -0400
Received: from lists.gnu.org ([209.51.188.17]:33759)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <summerfallsaway@HIDDEN>)
 id 1hSsgT-0001Zx-Dh
 for submit <at> debbugs.gnu.org; Mon, 20 May 2019 20:31:13 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58550)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <summerfallsaway@HIDDEN>) id 1hSsgR-0002Nf-Rx
 for bug-gnu-emacs@HIDDEN; Mon, 20 May 2019 20:31:13 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <summerfallsaway@HIDDEN>) id 1hSsgQ-0001YM-BC
 for bug-gnu-emacs@HIDDEN; Mon, 20 May 2019 20:31:11 -0400
Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:45999)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <summerfallsaway@HIDDEN>)
 id 1hSsgP-0001WS-Ux
 for bug-gnu-emacs@HIDDEN; Mon, 20 May 2019 20:31:10 -0400
Received: by mail-lf1-x132.google.com with SMTP id n22so11608178lfe.12
 for <bug-gnu-emacs@HIDDEN>; Mon, 20 May 2019 17:31:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=message-id:subject:from:to:date:user-agent:mime-version
 :content-transfer-encoding;
 bh=ZddpD43BjtkzkJZIrpbSLaXDqz2jFXI2TafCpAO40rQ=;
 b=O7mKRpEosaCeHHs/RoNug3uFaCbJCmioDfJ088mxqjEzvUepDZ7xwC48QM0JOkjzV4
 Xa6mvxY4Y65fnVMII6nbCIYboR+g8+QjmEUd+6RAEeEQ8+a9O+rs9WX/4vYS4J6pizUv
 xU+dRtplKb2D4oyCvN2IUom3+QgbwzspcP7PTKvniTYEX3d7GKFynTP8b/1OGSMjiAEL
 sdUo5cr28kxbLYtu8dCGkOsWL5MD6zyXRNCutT6mesacIAJJs3j7behpAM64Ju9Yue1a
 vipmSBPxEWOWopoQPcVfMM6GKGmoPRVvaDECLM7Onuc0x/cNoKC5eIhRCzbU73FqajzB
 EINw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:message-id:subject:from:to:date:user-agent
 :mime-version:content-transfer-encoding;
 bh=ZddpD43BjtkzkJZIrpbSLaXDqz2jFXI2TafCpAO40rQ=;
 b=OIuQH8fQlSZShQjAY/Etlatzv9+Ruw+Fm5CEPCDOez2wz1vBcBkkrNbzB9vM0VXDMO
 I9AqQRD2gOc/hSb08RyT95DJakbGBCidBehT6TPRBXvoCu9/NDgPt9KXHb47TgRQSJnp
 DmcLPWKO/DjBDuWE8zYW6vXM1AFGuI04LYifaluOezPFzPnZENfwyrM2JGM0uRrjnbaL
 TCEI6CwcOo5YRJrER+z7bbxg6JPg7lALyKgjZsnbCCcWGTE+HROMSGJq6Pco67ySNwpE
 7499bjK7qgxiK8PLkZI5T+bX4b2Fh6tycIHBhvLPy4UGKX9uKwaZBmCiIvuE4LJzDzTa
 RGyg==
X-Gm-Message-State: APjAAAUm9YbONeeTw1SaBtbU0iYGW/oCLiHFcUPRv+6IGVLbKk73pddT
 th6tJgJ0jMnI2P6VsbTYAK016HXi
X-Google-Smtp-Source: APXvYqxIzP/oa553zzuut+lUfIT4o8ntlofO1/kPRwsewZ1JEuANpLQZawq0F6fjB7giQLLxGyoEpA==
X-Received: by 2002:a19:c20e:: with SMTP id l14mr18818526lfc.5.1558398664559; 
 Mon, 20 May 2019 17:31:04 -0700 (PDT)
Received: from mars.localdomain (50-37-23-70.grdv.nv.frontiernet.net.
 [50.37.23.70])
 by smtp.gmail.com with ESMTPSA id m21sm4187305ljb.40.2019.05.20.17.31.02
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);
 Mon, 20 May 2019 17:31:03 -0700 (PDT)
Message-ID: <df64612e170606ddb2192e5e86de8c48791e1efa.camel@HIDDEN>
Subject: 26.2; mhtml-mode (in HTML+CSS and HTML+JS) doesn't respect
 Whitespace Mode face settings
From: Andrew T <summerfallsaway@HIDDEN>
To: GNU Emacs Bug Tracker <bug-gnu-emacs@HIDDEN>
Date: Mon, 20 May 2019 17:30:59 -0700
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.32.2 (3.32.2-1.fc30) 
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2a00:1450:4864:20::132
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

I use (Global) Whitespace Mode with trailing spaces highlighted
(foreground is bold yellow) but *normal* spaces are supposed to be
invisible (foreground color is the same as the default background).

However, MHTML Mode, within CSS or JavaScript blocks, doesn't respect
these settings. The dots representing all spaces display in the default
foreground color, or in the color of the nearest highlighted text
token.

Exact steps to duplicate:

Open an HTML file containing CSS and/or JavaScript blocks, with Emacs
reset to defaults.

  ↪ emacs -Q ./foo.html

Enable MHTML and Whitespace modes.

  M-x mhtml-mode RET
  M-x whitespace-mode RET

Set normal spaces to be invisible (foreground color same as
background).

  M-x customize-face RET
  whitespace-space RET

-- then uncheck background color, set foreground color to same as
default background (white).

Back to the HTML document now...

  M-x previous-buffer

Don't do special highlighting for space indentation.

  M-x whitespace-toggle-options RET C-i

Don't to special highlight for long lines.

  M-x whitespace-toggle-options RET l

Dots representing nontrailing spaces should no longer be visible, but
in <style> and <script> blocks, they still are.

Screenshot here: https://imgur.com/a/51pMkbN


Automatically generated debug information:

In GNU Emacs 26.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version
3.24.8)
 of 2019-04-30 built on buildvm-06.phx2.fedoraproject.org
Windowing system distributor 'Fedora Project', version 11.0.12004000
System Description:	Fedora release 30 (Thirty)

Recent messages:
Resetting customization items...done
Creating customization setup...done
You can run the command ‘customize-face’ with M-x cu-f RET
Creating customization setup...done
Making completion list... [2 times]
Quit
You can run the command ‘previous-buffer’ with <XF86Back>
 
You can run the command ‘whitespace-toggle-options’ with M-x wh-t RET
  [2 times]
whitespace-interactive-char: Quit
Configured using:
 'configure --build=x86_64-redhat-linux-gnu
 --host=x86_64-redhat-linux-gnu --program-prefix=
 --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
 --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
 --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
 --libexecdir=/usr/libexec --localstatedir=/var
 --sharedstatedir=/var/lib --mandir=/usr/share/man
 --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-
png
 --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3
 --with-gpm=no --with-xwidgets --with-modules
 build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu
 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=format-security
 -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions
 -fstack-protector-strong -grecord-gcc-switches
 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
 LDFLAGS=-Wl,-z,relro
 PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS GLIB NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: HTML+

Minor modes in effect:
  whitespace-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec password-cache epa derived epg epg-
config
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils disp-table whitespace crm
help-fns radix-tree help-mode cus-edit cus-start cus-load wid-edit
mhtml-mode css-mode smie color js advice json map imenu thingatpt
cc-mode cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs sgml-mode seq byte-opt gv bytecomp
byte-compile cconv dom cl-loaddefs cl-lib elec-pair time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset
image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-
mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-
readable
backquote threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting xwidget-internal move-toolbar
gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 156271 14035)
 (symbols 48 25619 1)
 (miscs 40 158 279)
 (strings 32 44788 1464)
 (string-bytes 1 1283979)
 (vectors 16 19871)
 (vector-slots 8 565353 11422)
 (floats 8 217 271)
 (intervals 56 4296 0)
 (buffers 992 15))





Acknowledgement sent to Andrew T <summerfallsaway@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#35815; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 May 2020 19:30:02 UTC

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