GNU bug report logs - #25841
25.2; Highlighting not being updated in some modes.

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: Paul Whittaker <emacs@HIDDEN>; Keywords: notabug; dated Wed, 22 Feb 2017 21:46:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 25841) by debbugs.gnu.org; 23 Feb 2017 12:21:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 23 07:21:48 2017
Received: from localhost ([127.0.0.1]:52028 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cgsP6-0004UU-0s
	for submit <at> 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 <paul.whittaker@HIDDEN>) id 1cgsP3-0004UG-Pc
 for 25841 <at> 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 <paul.whittaker@HIDDEN>)
 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 <rgm@HIDDEN>
References: <231f3b41-7ba1-58d9-a1d4-2e0af37d0ac7@HIDDEN>
 <gwpoi9q3y0.fsf@HIDDEN>
From: Paul Whittaker <emacs@HIDDEN>
X-Enigmail-Draft-Status: N1110
Message-ID: <8297e47c-d156-615a-8443-9332165d95c0@HIDDEN>
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: <gwpoi9q3y0.fsf@HIDDEN>
Content-Type: multipart/alternative;
 boundary="------------0EAA60E63FD9EC5E7B1560EE"
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 25841
Cc: 25841 <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.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

<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <tt>On 22/02/17 22:02, Glenn Morris wrote:</tt><tt><br>
    </tt><tt>&gt; This is the documented way highlight-regexp behaves:</tt><tt><br>
    </tt><tt>&gt;</tt><tt><br>
    </tt><tt>&gt;     Use Font lock mode, if enabled, to highlight
      REGEXP.  Otherwise,</tt><tt><br>
    </tt><tt>&gt;     use overlays for highlighting.  If overlays are
      used, the</tt><tt><br>
    </tt><tt>&gt;     highlighting will not update as you type.</tt><tt><br>
    </tt><tt><br>
    </tt><tt>Thanks, I'd missed that.</tt><tt><br>
    </tt><tt><br>
    </tt><tt>I'm trying to get dynamic (non-overlay) highlighting
      working in a plain</tt><tt><br>
    </tt><tt>text mode.  That documentation makes me think that I just
      need to enable</tt><tt><br>
    </tt><tt>font-lock mode, but doing that doesn't appear to make any
      difference.</tt><tt><br>
    </tt><tt><br>
    </tt><tt>  emacs -Q</tt><tt><br>
    </tt><tt>  M-x fundamental-mode RET</tt><tt><br>
    </tt><tt>  M-1 M-x font-lock-mode RET</tt><tt><br>
    </tt><tt>  M-x highlight-regexp RET foo RET hi-yellow RET</tt><tt><br>
    </tt><tt><br>
    </tt><tt>  f o o SPC b a r  ;; Not highlighted, as before.</tt><tt><br>
    </tt><tt><br>
    </tt><tt>Would you expect that to work, or is there something else
      that I'm<br>
      missing here?  Apologies if this is a stupid question: I suspect
      I'm not<br>
      seeing all of the picture.<br>
    </tt><tt><br>
    </tt><tt>Thanks in advance,</tt><tt><br>
    </tt><tt><br>
    </tt><tt>Paul.</tt><tt><br>
    </tt><br>
    <pre class="moz-signature" cols="72">-- 
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: <a class="moz-txt-link-abbreviated" href="http://www.drisq.com">www.drisq.com</a>

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.</pre>
  </body>
</html>

--------------0EAA60E63FD9EC5E7B1560EE--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25841; Package emacs. Full text available.

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


Received: (at 25841) by debbugs.gnu.org; 22 Feb 2017 22:02:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 22 17:02:59 2017
Received: from localhost ([127.0.0.1]:51650 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cgezz-0004W3-AY
	for submit <at> 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 <rgm@HIDDEN>) id 1cgezy-0004Vp-1w
 for 25841 <at> 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 <rgm@HIDDEN>) id 1cgezr-0001XI-RJ
 for 25841 <at> 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 <rgm@HIDDEN>)
 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 <rgm@HIDDEN>)
 id 1cgezn-0005iM-M1; Wed, 22 Feb 2017 17:02:47 -0500
From: Glenn Morris <rgm@HIDDEN>
To: Paul Whittaker <emacs@HIDDEN>
Subject: Re: bug#25841: 25.2; Highlighting not being updated in some modes.
References: <231f3b41-7ba1-58d9-a1d4-2e0af37d0ac7@HIDDEN>
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@HIDDEN> (Paul
 Whittaker's message of "Wed, 22 Feb 2017 21:39:53 +0000")
Message-ID: <gwpoi9q3y0.fsf@HIDDEN>
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 <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: -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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25841; Package emacs. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 22 Feb 2017 21:45:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 22 16:45:36 2017
Received: from localhost ([127.0.0.1]:51643 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cgej9-00047J-Bw
	for submit <at> 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 <paul.whittaker@HIDDEN>) id 1cgedv-0003zP-Im
 for submit <at> 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 <paul.whittaker@HIDDEN>) id 1cgedo-000471-AQ
 for submit <at> 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 <paul.whittaker@HIDDEN>)
 id 1cgedo-00046m-7W
 for submit <at> 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 <paul.whittaker@HIDDEN>) id 1cgedl-0005vi-SG
 for bug-gnu-emacs@HIDDEN; Wed, 22 Feb 2017 16:40:03 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <paul.whittaker@HIDDEN>) id 1cgedi-00043p-N9
 for bug-gnu-emacs@HIDDEN; 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 <paul.whittaker@HIDDEN>)
 id 1cgedi-00042c-CR
 for bug-gnu-emacs@HIDDEN; 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 <paul.whittaker@HIDDEN>)
 id 1cgede-0001ZY-8u; Wed, 22 Feb 2017 21:39:54 +0000
To: bug-gnu-emacs@HIDDEN
From: Paul Whittaker <emacs@HIDDEN>
Subject: 25.2; Highlighting not being updated in some modes.
X-Enigmail-Draft-Status: N1110
Message-ID: <231f3b41-7ba1-58d9-a1d4-2e0af37d0ac7@HIDDEN>
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 <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: -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

<html>
  <head>

    <meta http-equiv=3D"content-type" content=3D"text/html; charset=3Dutf=
-8">
  </head>
  <body text=3D"#000000" bgcolor=3D"#FFFFFF">
    <tt>Hi,</tt><tt><br>
    </tt><tt><br>
    </tt><tt>I'm finding some problems using highlight-regexp to
      highlight words in</tt><tt><br>
    </tt><tt>text that I'm editing.</tt><tt><br>
    </tt><tt><br>
    </tt><tt>In major modes that do not use syntax highlighting, the
      highlighting</tt><tt><br>
    </tt><tt>from highlight-regexp is not updated when the buffer
      content is changed.</tt><tt><br>
    </tt><tt>The highlighting appears to be static, based only on what
      was visible at</tt><tt><br>
    </tt><tt>the time that highlight-regexp was called.</tt><tt><br>
    </tt><tt><br>
    </tt><tt>New text containing matches is not being highlighted when
      it is entered,</tt><tt><br>
    </tt><tt>and existing highlighted text retains its highlighting even
      if it is</tt><tt><br>
    </tt><tt>altered to no longer match the regexp.</tt><tt><br>
    </tt><tt><br>
    </tt><tt>These problems do not occur when calling highlight-regexp
      in major modes</tt><tt><br>
    </tt><tt>that include syntax highlighting: in those modes, the
      correct behaviour</tt><tt><br>
    </tt><tt>is observed, and highlighting is updated properly as the
      buffer content</tt><tt><br>
    </tt><tt>is changed.</tt><tt><br>
    </tt><tt><br>
    </tt><tt>Although I'm using M-x report-emacs-bug in Emacs 24.5.1
      (Ubuntu 16.04.2)</tt><tt><br>
    </tt><tt>to report this, I've also reproduced it with the latest Git
      sources</tt><tt><br>
    </tt><tt>(Emacs 25.2.1, built from commit fe91ff2), as well as with
      a much older</tt><tt><br>
    </tt><tt>build (Emacs 23.3.1, Ubuntu 12.04.5).=C2=A0 It appears to be=
 a
      long-standing</tt><tt><br>
    </tt><tt>problem.</tt><tt><br>
    </tt><tt><br>
    </tt><tt><br>
    </tt><tt>To reproduce:</tt><tt><br>
    </tt><tt>=C2=A0- Launch Emacs with `emacs -Q'.=C2=A0 The `*scratch*' =
buffer is
      displayed.</tt><tt><br>
    </tt><tt>=C2=A0- Enter the following:</tt><tt><br>
    </tt><tt><br>
    </tt><tt>=C2=A0=C2=A0=C2=A0=C2=A0 M-x fundamental-mode RET</tt><tt><b=
r>
    </tt><tt>=C2=A0=C2=A0=C2=A0=C2=A0 M-x highlight-regexp RET foo RET hi=
-yellow RET</tt><tt><br>
    </tt><tt>=C2=A0=C2=A0=C2=A0=C2=A0 f o o SPC b a r SPC f o o SPC b a r=
</tt><tt><br>
    </tt><tt><br>
    </tt><tt>=C2=A0- First bug: the `foo' words should be highlighted, bu=
t
      aren't.=C2=A0 The</tt><tt><br>
    </tt><tt>=C2=A0=C2=A0 modeline shows `(Fundamental Hi)' at this point=
=2E</tt><tt><br>
    </tt><tt><br>
    </tt><tt>=C2=A0- Correct the highlighting, so that the two `foo' word=
s do
      get</tt><tt><br>
    </tt><tt>=C2=A0=C2=A0 highlighted:</tt><tt><br>
    </tt><tt><br>
    </tt><tt>=C2=A0=C2=A0=C2=A0=C2=A0 M-x unhighlight-regexp RET foo RET<=
/tt><tt><br>
    </tt><tt>=C2=A0=C2=A0=C2=A0=C2=A0 M-x highlight-regexp RET foo RET hi=
-yellow RET</tt><tt><br>
    </tt><tt><br>
    </tt><tt>=C2=A0- Move the cursor into a `foo' and change the text:</t=
t><tt><br>
    </tt><tt><br>
    </tt><tt>=C2=A0=C2=A0=C2=A0=C2=A0 C-a C-f C-f=C2=A0 x</tt><tt><br>
    </tt><tt><br>
    </tt><tt>=C2=A0- Second bug: `foxo' does not match the regexp, but th=
e
      highlighting</tt><tt><br>
    </tt><tt>=C2=A0=C2=A0 has not been removed and the whole `foxo' word =
is now
      highlighted.</tt><tt><br>
    </tt><tt><br>
    </tt><tt>The bugs are also present if I replace `M-x
      fundamental-mode RET' with</tt><tt><br>
    </tt><tt>`M-x text-mode RET' as the first command given inside
      Emacs.</tt><tt><br>
    </tt><tt><br>
    </tt><tt><br>
    </tt><tt>If instead of Text or Fundamental modes I use a major mode
      that includes</tt><tt><br>
    </tt><tt>syntax highlighting, I do not see these bugs.=C2=A0 For exam=
ple,
      staying in</tt><tt><br>
    </tt><tt>the `*scratch*' buffer's Lisp Interaction mode lets the
      highlighting</tt><tt><br>
    </tt><tt>work correctly.=C2=A0 Other modes, such Java mode or C mode,=

      also give the</tt><tt><br>
    </tt><tt>correct behaviour:</tt><tt><br>
    </tt><tt><br>
    </tt><tt>Demonstrate correct highlighting behaviour:</tt><tt><br>
    </tt><tt>=C2=A0 - Launch Emacs with `emacs -Q'.</tt><tt><br>
    </tt><tt>=C2=A0 - Enter the following in the `*scratch*' buffer:</tt>=
<tt><br>
    </tt><tt><br>
    </tt><tt>=C2=A0=C2=A0=C2=A0=C2=A0 M-x c-mode RET</tt><tt><br>
    </tt><tt>=C2=A0=C2=A0=C2=A0=C2=A0 M-x highlight-regexp RET foo RET hi=
-yellow RET</tt><tt><br>
    </tt><tt>=C2=A0=C2=A0=C2=A0=C2=A0 f o o SPC b a r SPC f o o SPC b a r=
</tt><tt><br>
    </tt><tt><br>
    </tt><tt>=C2=A0 - First bug is not present: the `foo' are correctly
      highlighted as</tt><tt><br>
    </tt><tt>=C2=A0=C2=A0=C2=A0 soon as they are typed in.</tt><tt><br>
    </tt><tt><br>
    </tt><tt>=C2=A0 - Now move the cursor into a `foo' and type other
      letters:</tt><tt><br>
    </tt><tt><br>
    </tt><tt>=C2=A0=C2=A0=C2=A0=C2=A0 C-a C-f C-f=C2=A0 x</tt><tt><br>
    </tt><tt><br>
    </tt><tt>=C2=A0 - Second bug is not present: `foxo' immediately loses=
 its</tt><tt><br>
    </tt><tt>=C2=A0=C2=A0=C2=A0 highlighting.</tt><tt><br>
    </tt><tt><br>
    </tt><tt><br>
    </tt><tt>Apologies if this problem is already known; I have seen
      various mentions</tt><tt><br>
    </tt><tt>of highlight-regexp on the list, but none appears to cover
      the problems</tt><tt><br>
    </tt><tt>above.</tt><tt><br>
    </tt><tt><br>
    </tt><tt><br>
    </tt><tt><br>
    </tt><tt><br>
    </tt><tt><br>
    </tt><tt>In GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version
      3.18.9)</tt><tt><br>
    </tt><tt>=C2=A0of 2016-04-17 on lgw01-04, modified by Debian</tt><tt>=
<br>
    </tt><tt>Windowing system distributor `The X.Org Foundation',
      version 11.0.11804000</tt><tt><br>
    </tt><tt>System Description:=C2=A0=C2=A0 =C2=A0Ubuntu 16.04.2 LTS</tt=
><tt><br>
    </tt><tt><br>
    </tt><tt>Configured using:</tt><tt><br>
    </tt><tt>=C2=A0`configure --build x86_64-linux-gnu --prefix=3D/usr</t=
t><tt><br>
    </tt><tt>=C2=A0--sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib</t=
t><tt><br>
    </tt><tt>=C2=A0--localstatedir=3D/var/lib --infodir=3D/usr/share/info=
</tt><tt><br>
    </tt><tt>=C2=A0--mandir=3D/usr/share/man --with-pop=3Dyes</tt><tt><br=
>
    </tt><tt>=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</tt><tt><br>
    </tt><tt>=C2=A0--build x86_64-linux-gnu --prefix=3D/usr
      --sharedstatedir=3D/var/lib</tt><tt><br>
    </tt><tt>=C2=A0--libexecdir=3D/usr/lib --localstatedir=3D/var/lib</tt=
><tt><br>
    </tt><tt>=C2=A0--infodir=3D/usr/share/info --mandir=3D/usr/share/man
      --with-pop=3Dyes</tt><tt><br>
    </tt><tt>=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</tt><tt><br>
    </tt><tt>=C2=A0--with-x=3Dyes --with-x-toolkit=3Dgtk3
      --with-toolkit-scroll-bars</tt><tt><br>
    </tt><tt>=C2=A0'CFLAGS=3D-g -O2 -fstack-protector-strong -Wformat</tt=
><tt><br>
    </tt><tt>=C2=A0-Werror=3Dformat-security -Wall' 'CPPFLAGS=3D-Wdate-ti=
me</tt><tt><br>
    </tt><tt>=C2=A0-D_FORTIFY_SOURCE=3D2' 'LDFLAGS=3D-Wl,-Bsymbolic-funct=
ions
      -Wl,-z,relro''</tt><tt><br>
    </tt><tt><br>
    </tt><tt>Important settings:</tt><tt><br>
    </tt><tt>=C2=A0 value of $LANG: en_GB.UTF-8</tt><tt><br>
    </tt><tt>=C2=A0 value of $XMODIFIERS: @im=3Dibus</tt><tt><br>
    </tt><tt>=C2=A0 locale-coding-system: utf-8-unix</tt><tt><br>
    </tt><tt><br>
    </tt><tt>Major mode: Fundamental</tt><tt><br>
    </tt><tt><br>
    </tt><tt>Minor modes in effect:</tt><tt><br>
    </tt><tt>=C2=A0 hi-lock-mode: t</tt><tt><br>
    </tt><tt>=C2=A0 tooltip-mode: t</tt><tt><br>
    </tt><tt>=C2=A0 electric-indent-mode: t</tt><tt><br>
    </tt><tt>=C2=A0 mouse-wheel-mode: t</tt><tt><br>
    </tt><tt>=C2=A0 tool-bar-mode: t</tt><tt><br>
    </tt><tt>=C2=A0 menu-bar-mode: t</tt><tt><br>
    </tt><tt>=C2=A0 file-name-shadow-mode: t</tt><tt><br>
    </tt><tt>=C2=A0 global-font-lock-mode: t</tt><tt><br>
    </tt><tt>=C2=A0 font-lock-mode: t</tt><tt><br>
    </tt><tt>=C2=A0 blink-cursor-mode: t</tt><tt><br>
    </tt><tt>=C2=A0 auto-composition-mode: t</tt><tt><br>
    </tt><tt>=C2=A0 auto-encryption-mode: t</tt><tt><br>
    </tt><tt>=C2=A0 auto-compression-mode: t</tt><tt><br>
    </tt><tt>=C2=A0 line-number-mode: t</tt><tt><br>
    </tt><tt>=C2=A0 transient-mark-mode: t</tt><tt><br>
    </tt><tt><br>
    </tt><tt>Recent messages:</tt><tt><br>
    </tt><tt>For information about GNU Emacs and the GNU system, type
      C-h C-a.</tt><tt><br>
    </tt><tt>You can run the command `highlight-regexp' with M-s h r</tt>=
<tt><br>
    </tt><tt>You can run the command `unhighlight-regexp' with C-x w r</t=
t><tt><br>
    </tt><tt>You can run the command `highlight-regexp' with C-x w h</tt>=
<tt><br>
    </tt><tt><br>
    </tt><tt>Load-path shadows:</tt><tt><br>
    </tt><tt>None found.</tt><tt><br>
    </tt><tt><br>
    </tt><tt>Features:</tt><tt><br>
    </tt><tt>(shadow sort gnus-util mail-extr emacsbug message
      format-spec rfc822 mml</tt><tt><br>
    </tt><tt>easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse
      rfc2231</tt><tt><br>
    </tt><tt>mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
      ietf-drums</tt><tt><br>
    </tt><tt>mm-util help-fns mail-prsvr mail-utils hi-lock time-date
      tooltip</tt><tt><br>
    </tt><tt>electric uniquify ediff-hook vc-hooks lisp-float-type
      mwheel x-win x-dnd</tt><tt><br>
    </tt><tt>tool-bar dnd fontset image regexp-opt fringe tabulated-list
      newcomment</tt><tt><br>
    </tt><tt>lisp-mode prog-mode register page menu-bar rfn-eshadow
      timer select</tt><tt><br>
    </tt><tt>scroll-bar mouse jit-lock font-lock syntax facemenu
      font-core frame cham</tt><tt><br>
    </tt><tt>georgian utf-8-lang misc-lang vietnamese tibetan thai
      tai-viet lao</tt><tt><br>
    </tt><tt>korean japanese hebrew greek romanian slovak czech european
      ethiopic</tt><tt><br>
    </tt><tt>indian cyrillic chinese case-table epa-hook jka-cmpr-hook
      help simple</tt><tt><br>
    </tt><tt>abbrev minibuffer nadvice loaddefs button faces cus-face
      macroexp files</tt><tt><br>
    </tt><tt>text-properties overlay sha1 md5 base64 format env
      code-pages mule</tt><tt><br>
    </tt><tt>custom widget hashtable-print-readable backquote
      make-network-process</tt><tt><br>
    </tt><tt>dbusbind gfilenotify dynamic-setting system-font-setting</tt=
><tt><br>
    </tt><tt>font-render-setting move-toolbar gtk x-toolkit x multi-tty
      emacs)</tt><tt><br>
    </tt><tt><br>
    </tt><tt>Memory information:</tt><tt><br>
    </tt><tt>((conses 16 71992 5923)</tt><tt><br>
    </tt><tt>=C2=A0(symbols 48 17620 0)</tt><tt><br>
    </tt><tt>=C2=A0(miscs 40 35 113)</tt><tt><br>
    </tt><tt>=C2=A0(strings 32 9289 4289)</tt><tt><br>
    </tt><tt>=C2=A0(string-bytes 1 255622)</tt><tt><br>
    </tt><tt>=C2=A0(vectors 16 9010)</tt><tt><br>
    </tt><tt>=C2=A0(vector-slots 8 384424 16510)</tt><tt><br>
    </tt><tt>=C2=A0(floats 8 66 318)</tt><tt><br>
    </tt><tt>=C2=A0(intervals 56 217 22)</tt><tt><br>
    </tt><tt>=C2=A0(buffers 960 11)</tt><tt><br>
    </tt><tt>=C2=A0(heap 1024 31760 1029))</tt><tt><br>
    </tt><tt><br>
    </tt>
  </body>
</html>

--------------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--




Acknowledgement sent to Paul Whittaker <emacs@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#25841; 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: Thu, 23 Feb 2017 12:30:02 UTC

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