From unknown Tue Aug 19 07:11:20 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#25841 <25841@debbugs.gnu.org> To: bug#25841 <25841@debbugs.gnu.org> Subject: Status: 25.2; Highlighting not being updated in some modes. Reply-To: bug#25841 <25841@debbugs.gnu.org> Date: Tue, 19 Aug 2025 14:11:20 +0000 retitle 25841 25.2; Highlighting not being updated in some modes. reassign 25841 emacs submitter 25841 Paul Whittaker severity 25841 minor tag 25841 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 22 16:45:36 2017 Received: (at submit) by debbugs.gnu.org; 22 Feb 2017 21:45:36 +0000 Received: from localhost ([127.0.0.1]:51643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgej9-00047J-Bw for submit@debbugs.gnu.org; Wed, 22 Feb 2017 16:45:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgedv-0003zP-Im for submit@debbugs.gnu.org; Wed, 22 Feb 2017 16:40:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgedo-000471-AQ for submit@debbugs.gnu.org; Wed, 22 Feb 2017 16:40:06 -0500 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,HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49817) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgedo-00046m-7W for submit@debbugs.gnu.org; Wed, 22 Feb 2017 16:40:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgedl-0005vi-SG for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2017 16:40:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgedi-00043p-N9 for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2017 16:40:01 -0500 Received: from smtp.hosts.co.uk ([85.233.160.19]:61912) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgedi-00042c-CR for bug-gnu-emacs@gnu.org; Wed, 22 Feb 2017 16:39:58 -0500 Received: from [82.69.137.27] (helo=[10.60.6.99]) by smtp.hosts.co.uk with esmtpa (Exim 4.87_1) (envelope-from ) id 1cgede-0001ZY-8u; Wed, 22 Feb 2017 21:39:54 +0000 To: bug-gnu-emacs@gnu.org From: Paul Whittaker Subject: 25.2; Highlighting not being updated in some modes. X-Enigmail-Draft-Status: N1110 Message-ID: <231f3b41-7ba1-58d9-a1d4-2e0af37d0ac7@drisq.com> Date: Wed, 22 Feb 2017 21:39:53 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hV5BEe9ptx2aTEaVBcwWW92nvv4Ig3QCu" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 22 Feb 2017 16:45:34 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hV5BEe9ptx2aTEaVBcwWW92nvv4Ig3QCu Content-Type: multipart/alternative; boundary="------------2A5C06A70FBCE6110DA6ED92" This is a multi-part message in MIME format. --------------2A5C06A70FBCE6110DA6ED92 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, I'm finding some problems using highlight-regexp to highlight words in text that I'm editing. In major modes that do not use syntax highlighting, the highlighting from highlight-regexp is not updated when the buffer content is changed. The highlighting appears to be static, based only on what was visible at the time that highlight-regexp was called. New text containing matches is not being highlighted when it is entered, and existing highlighted text retains its highlighting even if it is altered to no longer match the regexp. These problems do not occur when calling highlight-regexp in major modes that include syntax highlighting: in those modes, the correct behaviour is observed, and highlighting is updated properly as the buffer content is changed. Although I'm using M-x report-emacs-bug in Emacs 24.5.1 (Ubuntu 16.04.2) to report this, I've also reproduced it with the latest Git sources (Emacs 25.2.1, built from commit fe91ff2), as well as with a much older build (Emacs 23.3.1, Ubuntu 12.04.5). It appears to be a long-standing problem. To reproduce: - Launch Emacs with `emacs -Q'. The `*scratch*' buffer is displayed. - Enter the following: M-x fundamental-mode RET M-x highlight-regexp RET foo RET hi-yellow RET f o o SPC b a r SPC f o o SPC b a r - First bug: the `foo' words should be highlighted, but aren't. The modeline shows `(Fundamental Hi)' at this point. - Correct the highlighting, so that the two `foo' words do get highlighted: M-x unhighlight-regexp RET foo RET M-x highlight-regexp RET foo RET hi-yellow RET - Move the cursor into a `foo' and change the text: C-a C-f C-f x - Second bug: `foxo' does not match the regexp, but the highlighting has not been removed and the whole `foxo' word is now highlighted. The bugs are also present if I replace `M-x fundamental-mode RET' with `M-x text-mode RET' as the first command given inside Emacs. If instead of Text or Fundamental modes I use a major mode that includes syntax highlighting, I do not see these bugs. For example, staying in the `*scratch*' buffer's Lisp Interaction mode lets the highlighting work correctly. Other modes, such Java mode or C mode, also give the correct behaviour: Demonstrate correct highlighting behaviour: - Launch Emacs with `emacs -Q'. - Enter the following in the `*scratch*' buffer: M-x c-mode RET M-x highlight-regexp RET foo RET hi-yellow RET f o o SPC b a r SPC f o o SPC b a r - First bug is not present: the `foo' are correctly highlighted as soon as they are typed in. - Now move the cursor into a `foo' and type other letters: C-a C-f C-f x - Second bug is not present: `foxo' immediately loses its highlighting. Apologies if this problem is already known; I have seen various mentions of highlight-regexp on the list, but none appears to cover the problems above. In GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.1180400= 0 System Description: Ubuntu 16.04.2 LTS Configured using: `configure --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs24:/etc/emacs:/usr/local/share/emacs/= 24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/sit= e-lisp:/usr/share/emacs/site-lisp --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs24:/etc/emacs:/usr/local/share/emacs/= 24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/sit= e-lisp:/usr/share/emacs/site-lisp --with-x=3Dyes --with-x-toolkit=3Dgtk3 --with-toolkit-scroll-bars 'CFLAGS=3D-g -O2 -fstack-protector-strong -Wformat -Werror=3Dformat-security -Wall' 'CPPFLAGS=3D-Wdate-time -D_FORTIFY_SOURCE=3D2' 'LDFLAGS=3D-Wl,-Bsymbolic-functions -Wl,-z,relro'= ' Important settings: value of $LANG: en_GB.UTF-8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: hi-lock-mode: t tooltip-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 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. You can run the command `highlight-regexp' with M-s h r You can run the command `unhighlight-regexp' with C-x w r You can run the command `highlight-regexp' with C-x w h Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils hi-lock time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer 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 make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 71992 5923) (symbols 48 17620 0) (miscs 40 35 113) (strings 32 9289 4289) (string-bytes 1 255622) (vectors 16 9010) (vector-slots 8 384424 16510) (floats 8 66 318) (intervals 56 217 22) (buffers 960 11) (heap 1024 31760 1029)) --------------2A5C06A70FBCE6110DA6ED92 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi,

I'm finding some problems using highlight-regexp to highlight words in
text that I'm editing.

In major modes that do not use syntax highlighting, the highlighting
from highlight-regexp is not updated when the buffer content is changed.
The highlighting appears to be static, based only on what was visible at
the time that highlight-regexp was called.

New text containing matches is not being highlighted when it is entered,
and existing highlighted text retains its highlighting even if it is
altered to no longer match the regexp.

These problems do not occur when calling highlight-regexp in major modes
that include syntax highlighting: in those modes, the correct behaviour
is observed, and highlighting is updated properly as the buffer content
is changed.

Although I'm using M-x report-emacs-bug in Emacs 24.5.1 (Ubuntu 16.04.2)
to report this, I've also reproduced it with the latest Git sources
(Emacs 25.2.1, built from commit fe91ff2), as well as with a much older
build (Emacs 23.3.1, Ubuntu 12.04.5).=C2=A0 It appears to be= a long-standing
problem.


To reproduce:
=C2=A0- Launch Emacs with `emacs -Q'.=C2=A0 The `*scratch*' = buffer is displayed.
=C2=A0- Enter the following:

=C2=A0=C2=A0=C2=A0=C2=A0 M-x fundamental-mode RET =C2=A0=C2=A0=C2=A0=C2=A0 M-x highlight-regexp RET foo RET hi= -yellow RET
=C2=A0=C2=A0=C2=A0=C2=A0 f o o SPC b a r SPC f o o SPC b a r=

=C2=A0- First bug: the `foo' words should be highlighted, bu= t aren't.=C2=A0 The
=C2=A0=C2=A0 modeline shows `(Fundamental Hi)' at this point= =2E

=C2=A0- Correct the highlighting, so that the two `foo' word= s do get
=C2=A0=C2=A0 highlighted:

=C2=A0=C2=A0=C2=A0=C2=A0 M-x unhighlight-regexp RET foo RET<= /tt>
=C2=A0=C2=A0=C2=A0=C2=A0 M-x highlight-regexp RET foo RET hi= -yellow RET

=C2=A0- Move the cursor into a `foo' and change the text:

=C2=A0=C2=A0=C2=A0=C2=A0 C-a C-f C-f=C2=A0 x

=C2=A0- Second bug: `foxo' does not match the regexp, but th= e highlighting
=C2=A0=C2=A0 has not been removed and the whole `foxo' word = is now highlighted.

The bugs are also present if I replace `M-x fundamental-mode RET' with
`M-x text-mode RET' as the first command given inside Emacs.


If instead of Text or Fundamental modes I use a major mode that includes
syntax highlighting, I do not see these bugs.=C2=A0 For exam= ple, staying in
the `*scratch*' buffer's Lisp Interaction mode lets the highlighting
work correctly.=C2=A0 Other modes, such Java mode or C mode,= also give the
correct behaviour:

Demonstrate correct highlighting behaviour:
=C2=A0 - Launch Emacs with `emacs -Q'.
=C2=A0 - Enter the following in the `*scratch*' buffer:=

=C2=A0=C2=A0=C2=A0=C2=A0 M-x c-mode RET
=C2=A0=C2=A0=C2=A0=C2=A0 M-x highlight-regexp RET foo RET hi= -yellow RET
=C2=A0=C2=A0=C2=A0=C2=A0 f o o SPC b a r SPC f o o SPC b a r=

=C2=A0 - First bug is not present: the `foo' are correctly highlighted as
=C2=A0=C2=A0=C2=A0 soon as they are typed in.

=C2=A0 - Now move the cursor into a `foo' and type other letters:

=C2=A0=C2=A0=C2=A0=C2=A0 C-a C-f C-f=C2=A0 x

=C2=A0 - Second bug is not present: `foxo' immediately loses= its
=C2=A0=C2=A0=C2=A0 highlighting.


Apologies if this problem is already known; I have seen various mentions
of highlight-regexp on the list, but none appears to cover the problems
above.





In GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
=C2=A0of 2016-04-17 on lgw01-04, modified by Debian=
Windowing system distributor `The X.Org Foundation', version 11.0.11804000
System Description:=C2=A0=C2=A0 =C2=A0Ubuntu 16.04.2 LTS

Configured using:
=C2=A0`configure --build x86_64-linux-gnu --prefix=3D/usr
=C2=A0--sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib
=C2=A0--localstatedir=3D/var/lib --infodir=3D/usr/share/info=
=C2=A0--mandir=3D/usr/share/man --with-pop=3Dyes =C2=A0--enable-locallisppath=3D/etc/emacs24:/etc/emacs:/usr/= local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/sh= are/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp
=C2=A0--build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib
=C2=A0--libexecdir=3D/usr/lib --localstatedir=3D/var/lib
=C2=A0--infodir=3D/usr/share/info --mandir=3D/usr/share/man --with-pop=3Dyes
=C2=A0--enable-locallisppath=3D/etc/emacs24:/etc/emacs:/usr/= local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/sh= are/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp
=C2=A0--with-x=3Dyes --with-x-toolkit=3Dgtk3 --with-toolkit-scroll-bars
=C2=A0'CFLAGS=3D-g -O2 -fstack-protector-strong -Wformat
=C2=A0-Werror=3Dformat-security -Wall' 'CPPFLAGS=3D-Wdate-ti= me
=C2=A0-D_FORTIFY_SOURCE=3D2' 'LDFLAGS=3D-Wl,-Bsymbolic-funct= ions -Wl,-z,relro''

Important settings:
=C2=A0 value of $LANG: en_GB.UTF-8
=C2=A0 value of $XMODIFIERS: @im=3Dibus
=C2=A0 locale-coding-system: utf-8-unix

Major mode: Fundamental

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

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
You can run the command `highlight-regexp' with M-s h r=
You can run the command `unhighlight-regexp' with C-x w r
You can run the command `highlight-regexp' with C-x w h=

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils hi-lock time-date tooltip
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer 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 make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 71992 5923)
=C2=A0(symbols 48 17620 0)
=C2=A0(miscs 40 35 113)
=C2=A0(strings 32 9289 4289)
=C2=A0(string-bytes 1 255622)
=C2=A0(vectors 16 9010)
=C2=A0(vector-slots 8 384424 16510)
=C2=A0(floats 8 66 318)
=C2=A0(intervals 56 217 22)
=C2=A0(buffers 960 11)
=C2=A0(heap 1024 31760 1029))

--------------2A5C06A70FBCE6110DA6ED92-- --hV5BEe9ptx2aTEaVBcwWW92nvv4Ig3QCu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAEBAgAGBQJYrgUpAAoJEDS8uHE6ibHdq/UP/iukHyQECYvr0641vJBlSi1g 3T3Gk0FMTcT/D5SXwEU1MViFfKGbd2N/nKxCz2Wp7ygkOH1pDxH/aCsGd1D1aD5I 6YTaVb0veF9nmKUWdXwMSl5yf76G/Ej0+Z1mGQ0QhRMHE29eb6Vl7IJC3efz/BAA orGlfQ8qmHt5NX3oBD/rKxLyKbO9hk+Xr/O6UmX8rD6zWo53jjtuZ8m/RQX2QAXl fQ64tObs3eo9yGNcdWTBXcuEziobzJ6yswL3ycQI75JMJNtOHDiUp0wYPzF0YdRv mV/hKMsw578kFk6Anj9waTPvQ2f/VauSdIdurNpswbayx7FQFbMVSOlpDRkFJJSj dWDHCPJfbOBHFzh6d5IqMbTbr3bYgoXb1mkT+ONlRWtH7sLRBlihf39P4rmN5UyK 2FhbKNKwU6RvUxcf2wS4D2R96W5y5yJBBDZ+zT30qabfKXOeCLBw287OwULT0cpI zxPwzhUN+4zdkIne8h+qimNsTheE/ks29EXvuA0/+vPIidzWQp5LOqxHf2PwkIlc 6HpQ+7Y34MDSPb5GgRXSq4YA4B7NY/wvHXKaGcGCRNqaSh+pvWgirWeJ9r96NU4z 9CbG+NhNmB9peB5izDKoh4yc+8ChO0J+aWlTFBX1/BLrKuK1kykNX1UdGop33ZRw G1zRTmung+nNJr7yE8/O =4R8g -----END PGP SIGNATURE----- --hV5BEe9ptx2aTEaVBcwWW92nvv4Ig3QCu-- From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 22 17:02:59 2017 Received: (at 25841) by debbugs.gnu.org; 22 Feb 2017 22:02:59 +0000 Received: from localhost ([127.0.0.1]:51650 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgezz-0004W3-AY for submit@debbugs.gnu.org; Wed, 22 Feb 2017 17:02:59 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgezy-0004Vp-1w for 25841@debbugs.gnu.org; Wed, 22 Feb 2017 17:02:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgezr-0001XI-RJ for 25841@debbugs.gnu.org; Wed, 22 Feb 2017 17:02:52 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgezo-0001Wy-F5; Wed, 22 Feb 2017 17:02:48 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cgezn-0005iM-M1; Wed, 22 Feb 2017 17:02:47 -0500 From: Glenn Morris To: Paul Whittaker Subject: Re: bug#25841: 25.2; Highlighting not being updated in some modes. References: <231f3b41-7ba1-58d9-a1d4-2e0af37d0ac7@drisq.com> X-Spook: M-14 IDEA Aldergrove Avalanche Mossad ammunition keyhole X-Ran: "{"RTz'/WNkr[c\cA{U|ff^}vA4tHHd(dvcaPe0]0ba>Fyvk]#khq}E)>jFJ>1%g3C0+1^ X-Hue: cyan X-Debbugs-No-Ack: yes X-Attribution: GM Date: Wed, 22 Feb 2017 17:02:47 -0500 In-Reply-To: <231f3b41-7ba1-58d9-a1d4-2e0af37d0ac7@drisq.com> (Paul Whittaker's message of "Wed, 22 Feb 2017 21:39:53 +0000") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 25841 Cc: 25841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Paul Whittaker wrote: > In major modes that do not use syntax highlighting, the highlighting > from highlight-regexp is not updated when the buffer content is changed. > The highlighting appears to be static, based only on what was visible at > the time that highlight-regexp was called. This is the documented way highlight-regexp behaves: Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, use overlays for highlighting. If overlays are used, the highlighting will not update as you type. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 23 07:21:48 2017 Received: (at 25841) by debbugs.gnu.org; 23 Feb 2017 12:21:48 +0000 Received: from localhost ([127.0.0.1]:52028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgsP6-0004UU-0s for submit@debbugs.gnu.org; Thu, 23 Feb 2017 07:21:48 -0500 Received: from smtp.hosts.co.uk ([85.233.160.19]:37768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgsP3-0004UG-Pc for 25841@debbugs.gnu.org; Thu, 23 Feb 2017 07:21:46 -0500 Received: from [82.69.137.27] (helo=[10.60.6.99]) by smtp.hosts.co.uk with esmtpa (Exim 4.87_1) (envelope-from ) id 1cgsOy-0006LI-3U; Thu, 23 Feb 2017 12:21:40 +0000 Subject: Re: bug#25841: 25.2; Highlighting not being updated in some modes. To: Glenn Morris References: <231f3b41-7ba1-58d9-a1d4-2e0af37d0ac7@drisq.com> From: Paul Whittaker X-Enigmail-Draft-Status: N1110 Message-ID: <8297e47c-d156-615a-8443-9332165d95c0@drisq.com> Date: Thu, 23 Feb 2017 12:21:38 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------0EAA60E63FD9EC5E7B1560EE" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 25841 Cc: 25841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) This is a multi-part message in MIME format. --------------0EAA60E63FD9EC5E7B1560EE Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 22/02/17 22:02, Glenn Morris wrote: > This is the documented way highlight-regexp behaves: > > Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, > use overlays for highlighting. If overlays are used, the > highlighting will not update as you type. Thanks, I'd missed that. I'm trying to get dynamic (non-overlay) highlighting working in a plain text mode. That documentation makes me think that I just need to enable font-lock mode, but doing that doesn't appear to make any difference. emacs -Q M-x fundamental-mode RET M-1 M-x font-lock-mode RET M-x highlight-regexp RET foo RET hi-yellow RET f o o SPC b a r ;; Not highlighted, as before. Would you expect that to work, or is there something else that I'm missing here? Apologies if this is a stupid question: I suspect I'm not seeing all of the picture. Thanks in advance, Paul. --=20 Paul Whittaker DRisQ Ltd. Company number 7754903, registered in England and Wales. Registered office: Malvern Hills Science Park, Malvern, UK, WR14 3SZ. Tel: +44(0)1684 252452 Web: www.drisq.com CONFIDENTIALITY NOTICE: This email and any attachments are confidential a= nd may be privileged. If you are not the intended recipient, please notify us immediately. Please note that in th= ese circumstances, you should not copy or use this information for any purpose, nor disclose its contents to any ot= her person. Although we have scanned this email and any attachments for viruses, it is your responsibility to ensur= e that they are actually virus free. --------------0EAA60E63FD9EC5E7B1560EE Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 22/02/17 22:02, Glenn Morris wrote:
> This is the documented way highlight-regexp behaves:
>
>     Use Font lock mode, if enabled, to highlight REGEXP.  Otherwise,
>     use overlays for highlighting.  If overlays are used, the
>     highlighting will not update as you type.

Thanks, I'd missed that.

I'm trying to get dynamic (non-overlay) highlighting working in a plain
text mode.  That documentation makes me think that I just need to enable
font-lock mode, but doing that doesn't appear to make any difference.

  emacs -Q
  M-x fundamental-mode RET
  M-1 M-x font-lock-mode RET
  M-x highlight-regexp RET foo RET hi-yellow RET

  f o o SPC b a r  ;; Not highlighted, as before.

Would you expect that to work, or is there something else that I'm
missing here?  Apologies if this is a stupid question: I suspect I'm not
seeing all of the picture.

Thanks in advance,

Paul.

-- 
Paul Whittaker
DRisQ Ltd. Company number 7754903, registered in England and Wales.
Registered office: Malvern Hills Science Park, Malvern, UK, WR14 3SZ.
Tel: +44(0)1684 252452  Web: www.drisq.com

CONFIDENTIALITY NOTICE: This email and any attachments are confidential and may be privileged.  If you are not the
intended recipient, please notify us immediately.  Please note that in these circumstances, you should not copy or
use this information for any purpose, nor disclose its contents to any other person.  Although we have scanned this
email and any attachments for viruses, it is your responsibility to ensure that they are actually virus free.
--------------0EAA60E63FD9EC5E7B1560EE-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 23 10:00:18 2017 Received: (at 25841) by debbugs.gnu.org; 23 Feb 2017 15:00:18 +0000 Received: from localhost ([127.0.0.1]:53127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgusU-0001Ze-4t for submit@debbugs.gnu.org; Thu, 23 Feb 2017 10:00:18 -0500 Received: from mout.gmx.net ([212.227.15.19]:54951) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgusP-0001ZM-GK for 25841@debbugs.gnu.org; Thu, 23 Feb 2017 10:00:14 -0500 Received: from rosalinde ([83.135.24.210]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LvlTo-1cHM413MBI-017VEO; Thu, 23 Feb 2017 16:00:05 +0100 From: Stephen Berman To: Paul Whittaker Subject: Re: bug#25841: 25.2; Highlighting not being updated in some modes. References: <231f3b41-7ba1-58d9-a1d4-2e0af37d0ac7@drisq.com> <8297e47c-d156-615a-8443-9332165d95c0@drisq.com> Date: Thu, 23 Feb 2017 16:00:04 +0100 Message-ID: <87ino1osuj.fsf@rosalinde> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:TsQyqGyYUuIqpIocyWOzpLYXYBbrOiyTvj6b/s3Msmxi+ptz1tR bLlA0hDOLU6ljIrtCgZMss0IcgIzdatOb0mKLiNVOqPXhDbiLtSb37AFzkWrXHlIS6TKQKK Nl5xlHUpAea5TjqNpftMAQ5u7G5mNRpnzEaHtm9zV4hrYHQn9K4QoY/13V0dwyUPgGsbhVg dBZuGdSwnRrL7xS11PduA== X-UI-Out-Filterresults: notjunk:1;V01:K0:GdhOrgLSBVQ=:4EunOZN8C19j2FRnrTSF4E EBZwS3qq+yjFmrz33f2prk6K9qK+RK/Z9nlpmZlqDQ6oBKOGza0KZoIv/ftCaD5QRx8HDUxtc iEjF+fN3XcEls3ASSIJOb6eqG1/RI197SHLT9/2pALvrLkP8bn9uCcmgu95lUjft/38rkTxU7 VpocPDnXSQK78aAZfIsF2BPp08KQ2T6Mvg3Qh3pteWegO8Lw22FhG4xFPmXtwV6US7sn6e3Sr BSGbPoPJ8TJ805a71P4ytFJkdaX7P4+nKOf+6gmWBbL2HGwItx73Z9E8LFMJxrnENAlOVKSiE axsedTj6huUUnCqsreu8hx2saP5bnEtD1ER/WTlTKXHLSpRuhAUrP6upl0EePSMTnjOJGXWUZ H+th8mDSODppEyTH0RBddhKbrG8eji0g94uCDuL7aixk4VORK8YyO0C9JXooX/tTIdccphUKZ K3QaY+A1pO+sqeuzzQ5ZvpQakxBR306BxzV6G266ixKfdeAA/csXhkLjtOpgXicqUscEUj0IS R6pRwnqzWOp4/6bnQVMjfdy55fl9V/Hv4CKoTwFFco48x/KLNP5fUXLjIc6T49q8dJ5z4tOaq Nu/ceAFlOjKkrPwM9QYweHJlEyKbl/5lves0jN0rpeIDJ1TxtkqPMGuaToWiL0e7OyshQA1+9 VGFR/85jzHd3ATMdKMimPobWPAGn7sqq2uUNZeDAeo3kpeYdlUoA3kqI/ZNwBxs2czHk5rhPW vkgqX9+C2wgfM91UA8UVhcxPQrM9ut39mlAmCnZryclqR+VObixvlLGFxjBQv04rQqhrcsehp yxgJFSQ X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 25841 Cc: Glenn Morris , 25841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) On Thu, 23 Feb 2017 12:21:38 +0000 Paul Whittaker wrote: > On 22/02/17 22:02, Glenn Morris wrote: >> This is the documented way highlight-regexp behaves: >> >> Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, >> use overlays for highlighting. If overlays are used, the >> highlighting will not update as you type. > > Thanks, I'd missed that. > > I'm trying to get dynamic (non-overlay) highlighting working in a plain > text mode. That documentation makes me think that I just need to enable > font-lock mode, but doing that doesn't appear to make any difference. > > emacs -Q > M-x fundamental-mode RET > M-1 M-x font-lock-mode RET > M-x highlight-regexp RET foo RET hi-yellow RET > > f o o SPC b a r ;; Not highlighted, as before. > > Would you expect that to work, or is there something else that I'm > missing here? Apologies if this is a stupid question: I suspect I'm not > seeing all of the picture. I can't explain how font-lock works, but by experimenting it appears you have to set font-lock-defaults to a non-nil value in the buffer (it seems before enabling font-lock-mode, though there's an interaction I don't understand). Here's a recipe: 0. emacs -Q 1. C-x b a RET ; Switch to new buffer "a". 2. Enter some text, e.g. "foo". 3. M-x font-lock-mode RET ; Disable font-lock-mode in the buffer -- ; by default it's enabled globally . 4. M-: (setq-local font-lock-defaults (list 'bla)) RET 5. M-x font-lock-mode RET ; Re-enable font-lock-mode. On one test I ; thought this was sufficient, but on ; subsequent repetition I've consistently ; gotten a void variable error and had to ; disable and then re-enable font-lock-mode ; again. 6. M-x highlight-regexp (or M-s h r) RET foo RET hi-yellow RET => Now "foo" is highlighted, and deleting a letter from it unhighlights it. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 20 22:09:59 2019 Received: (at 25841-done) by debbugs.gnu.org; 21 Aug 2019 02:09:59 +0000 Received: from localhost ([127.0.0.1]:34322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0G4U-0000dU-A1 for submit@debbugs.gnu.org; Tue, 20 Aug 2019 22:09:59 -0400 Received: from mail-pg1-f172.google.com ([209.85.215.172]:40308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0G4R-0000dF-Qg for 25841-done@debbugs.gnu.org; Tue, 20 Aug 2019 22:09:56 -0400 Received: by mail-pg1-f172.google.com with SMTP id w10so371887pgj.7 for <25841-done@debbugs.gnu.org>; Tue, 20 Aug 2019 19:09:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=J1+hSaFaZJYsCerVB8rphgBMqO2QkBrRpKx4IGbswyg=; b=ktqSpv91ocA+s96WpIdWTok9AiDvetUTfZKGTySumBi95b7Z8GJsNsDSc81BwcQWE8 NHc0MK2b3GSi4esxSeyrggvzdRrJn9Z483PooquKpaKsEnvQRb0LCQ9G0yiXKgPhA3vn 3YpYfO8OKG3x5LxFShs2ozHogt5dWG10RPNf0Q5OU5iEor1NcFJRtBb08IR52f1mcS72 l+qGujP1yJUmjdFva2WOVf6deCkCLQxkp6RlKdQ3QIL3k5LokTLPfj0n7JsIt6WR+i3X S2GVT3zZp6/bD8+60E+qebcbs0Qq3DQnRisA5YT0rNoptwaQf2/CpRZE0PHaIpWqoolz 704A== X-Gm-Message-State: APjAAAUckjGJ4QUDLQwaFVtg2bJGlcCKBiB2ZJQE+aSFP0fRggu44KAV 7r8ZqfEVM+a3fCnHD72V4ilKm2065rFldw7EcXw= X-Google-Smtp-Source: APXvYqxt3JqufYnOeEbA0joXBEFnQ7nZ1U/N88hSI7HD50a1DWB5i2OhDSWG2Uu/wwuPCmkeIL5DkYXb1svYzIwuwIk= X-Received: by 2002:a17:90a:17ab:: with SMTP id q40mr3047240pja.106.1566353390100; Tue, 20 Aug 2019 19:09:50 -0700 (PDT) MIME-Version: 1.0 From: Stefan Kangas Date: Wed, 21 Aug 2019 04:09:38 +0200 Message-ID: Subject: Re: bug#25841: 25.2; Highlighting not being updated in some modes. To: Stephen Berman Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25841-done Cc: Glenn Morris , Paul Whittaker , 25841-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Stephen Berman writes: > On Thu, 23 Feb 2017 12:21:38 +0000 Paul Whittaker wrote: > >> On 22/02/17 22:02, Glenn Morris wrote: >>> This is the documented way highlight-regexp behaves: >>> >>> Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, >>> use overlays for highlighting. If overlays are used, the >>> highlighting will not update as you type. >> >> Thanks, I'd missed that. >> >> I'm trying to get dynamic (non-overlay) highlighting working in a plain >> text mode. That documentation makes me think that I just need to enable >> font-lock mode, but doing that doesn't appear to make any difference. >> >> emacs -Q >> M-x fundamental-mode RET >> M-1 M-x font-lock-mode RET >> M-x highlight-regexp RET foo RET hi-yellow RET >> >> f o o SPC b a r ;; Not highlighted, as before. >> >> Would you expect that to work, or is there something else that I'm >> missing here? Apologies if this is a stupid question: I suspect I'm not >> seeing all of the picture. > > I can't explain how font-lock works, but by experimenting it appears you > have to set font-lock-defaults to a non-nil value in the buffer (it > seems before enabling font-lock-mode, though there's an interaction I > don't understand). Here's a recipe: > > 0. emacs -Q > 1. C-x b a RET ; Switch to new buffer "a". > 2. Enter some text, e.g. "foo". > 3. M-x font-lock-mode RET ; Disable font-lock-mode in the buffer -- > ; by default it's enabled globally . > 4. M-: (setq-local font-lock-defaults (list 'bla)) RET > 5. M-x font-lock-mode RET ; Re-enable font-lock-mode. On one test I > ; thought this was sufficient, but on > ; subsequent repetition I've consistently > ; gotten a void variable error and had to > ; disable and then re-enable font-lock-mode > ; again. > 6. M-x highlight-regexp (or M-s h r) RET foo RET hi-yellow RET > => Now "foo" is highlighted, and deleting a letter from it unhighlights > it. This seems to be the documented behaviour for highlight-regexp. Since there's nothing more to do here, and it was already tagged notabug, I'm closing this bug report. If anyone disagrees, feel free to re-open. Thanks, Stefan Kangas From unknown Tue Aug 19 07:11:20 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 18 Sep 2019 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator