🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #87755

highlighting bug in query-replace-regexp

#87755
From: Tom Tromey
Date: Tue, 30 Aug 1994 04:27
51 lines
2903 bytes
Emacs 19.25.  I set query-replace-highlight to t (which IMHO should be
the default).  I've noticed that if I do query-replace-regexp, then
the highlighting for a match is off by one character.  The
highlighting for query-replace is correct.  I've fixed this bug.  The
problem was that the saved match data was being restored too late.
Here is a ChangeLog entry:

Mon Aug 29 22:20:43 1994  Tom Tromey  (tromey@creche.colorado.edu)

	* replace.el (perform-replace): Restore match data before
	highlighting.

Note that your line numbers might be different from mine; I have been
making other changes to replace.el.

Tom
---
tromey@busco.lanl.gov             Member, League for Programming Freedom

diff -c /home/syzygy/tromey/projects/emacs-hacks/replace.el.\~1\~ /home/syzygy/tromey/projects/emacs-hacks/replace.el
*** /home/syzygy/tromey/projects/emacs-hacks/replace.el.~1~	Mon Aug 29 21:57:36 1994
--- /home/syzygy/tromey/projects/emacs-hacks/replace.el	Mon Aug 29 22:21:17 1994
***************
*** 528,540 ****
  	      ;; Loop reading commands until one of them sets done,
  	      ;; which means it has finished handling this occurrence.
  	      (while (not done)
  		(replace-highlight (match-beginning 0) (match-end 0))
  		(message message from-string next-replacement)
  		(setq key (read-event))
  		(setq key (vector key))
  		(setq def (lookup-key map key))
  		;; Restore the match data while we process the command.
- 		(store-match-data real-match-data)
  		(cond ((eq def 'help)
  		       (with-output-to-temp-buffer "*Help*"
  			 (princ
--- 536,548 ----
  	      ;; Loop reading commands until one of them sets done,
  	      ;; which means it has finished handling this occurrence.
  	      (while (not done)
+ 		(store-match-data real-match-data)
  		(replace-highlight (match-beginning 0) (match-end 0))
  		(message message from-string next-replacement)
  		(setq key (read-event))
  		(setq key (vector key))
  		(setq def (lookup-key map key))
  		;; Restore the match data while we process the command.
  		(cond ((eq def 'help)
  		       (with-output-to-temp-buffer "*Help*"
  			 (princ
Technical Details
Message-ID: <9408300424.AA09801@busco.lanl.gov>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!news.kei.com!uhog.mit.edu!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!busco.lanl.gov!tromey

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,57fecc8822048c85,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-08-29 21:32:50 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!news.kei.com!uhog.mit.edu!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!busco.lanl.gov!tromey
From: tromey@busco.lanl.gov (Tom Tromey)
Newsgroups: gnu.emacs.bug
Subject: highlighting bug in query-replace-regexp
Date: 30 Aug 1994 00:27:47 -0400
Organization: GNUs Not Usenet
Lines: 51
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <9408300424.AA09801@busco.lanl.gov>