emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#71430: closed (Persistent Highlighting Issue with query-replace usin


From: GNU bug Tracking System
Subject: bug#71430: closed (Persistent Highlighting Issue with query-replace using "act-and-show" Option)
Date: Sat, 08 Jun 2024 10:44:02 +0000

Your message dated Sat, 08 Jun 2024 13:41:02 +0300
with message-id <865xujemyp.fsf@gnu.org>
and subject line Re: bug#71430: Persistent Highlighting Issue with 
query-replace using "act-and-show" Option
has caused the debbugs.gnu.org bug report #71430,
regarding Persistent Highlighting Issue with query-replace using "act-and-show" 
Option
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
71430: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71430
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: Persistent Highlighting Issue with query-replace using "act-and-show" Option Date: Sat, 8 Jun 2024 09:29:41 +0200 User-agent: Mozilla Thunderbird

Hi,
I’ve encountered a potential bug in Emacs when using the query-replace (via perform-replace) functions. When performing text replacements across a buffer and choosing to replace but not immediately move the point (using the , act-and-show option), the function does replace the text as expected but fails to update the highlighting to the region containing the replacement.

Steps to Reproduce:

  1. Open a buffer with the following content:

    String to be replaced. Another string.
    String to be replaced. Another string.
    End
    
  2. Run the following command:

    (query-replace "String to be replaced." "Replacement." nil (point-min) (point-max))
    
  3. When prompted to replace a match, use the , (act-and-show) option to replace the text but pause moving to the next match.

Expected Behavior:
After a replacement is made and before moving to the next match, the highlighted region of the replaced text should be “updated” to fit the replaced text.

Actual Behavior:
The highlighting remains on the matched region. This issue can be visually confirmed in the following animation:
View Animation on Imgur

Visual Evidence:

As demonstrated, the highlighted region post-replacement does not correspond to any current match, which is misleading and might affect further editing decisions.

Best regards,

Gabriele Nicolardi

Attachment: match.png
Description: PNG image

Attachment: replacement.png
Description: PNG image


--- End Message ---
--- Begin Message --- Subject: Re: bug#71430: Persistent Highlighting Issue with query-replace using "act-and-show" Option Date: Sat, 08 Jun 2024 13:41:02 +0300
> Date: Sat, 8 Jun 2024 11:05:24 +0200
> From: Gabriele Nicolardi <gabriele@medialab.sissa.it>
> 
> Il 08/06/24 10:33, Eli Zaretskii ha scritto:
> >> Date: Sat, 8 Jun 2024 09:29:41 +0200
> >> From: Gabriele Nicolardi <gabriele@medialab.sissa.it>
> >>
> >> I’ve encountered a potential bug in Emacs when using the |query-replace|
> >> (via |perform-replace|) functions. When performing text replacements
> >> across a buffer and choosing to replace but not immediately move the
> >> point (using the |,| |act-and-show| option), the function does replace
> >> the text as expected but fails to update the highlighting to the region
> >> containing the replacement.
> >>
> >> *Steps to Reproduce:*
> >>
> >>   1.
> >>
> >>      Open a buffer with the following content:
> >>
> >>      |String to be replaced. Another string. String to be replaced.
> >>      Another string. End |
> >>
> >>   2.
> >>
> >>      Run the following command:
> >>
> >>      |(query-replace "String to be replaced." "Replacement." nil
> >>      (point-min) (point-max)) |
> >>
> >>   3.
> >>
> >>      When prompted to replace a match, use the |,| (|act-and-show|)
> >>      option to replace the text but pause moving to the next match.
> >>
> >> *Expected Behavior:*
> >> After a replacement is made and before moving to the next match, the
> >> highlighted region of the replaced text should be “updated” to fit the
> >> replaced text.
> >>
> >> *Actual Behavior:*
> >> The highlighting remains on the matched region. This issue can be
> >> visually confirmed in the following animation:
> > You don't say in what version of Emacs you see the problematic
> > behavior.  I can reproduce the behavior you report in Emacs 29, but
> > not in Emacs 30 (on the master branch of the Emacs Git repository).
> > So I think this bug was already solved on the master branch, which
> > will become Emacs 30.
> 
> 
> 
> > > Cc: 71430@debbugs.gnu.org
> > > Date: Sat, 08 Jun 2024 11:33:55 +0300
> > > From: Eli Zaretskii <eliz@gnu.org>
> > > 
> > > > Date: Sat, 8 Jun 2024 09:29:41 +0200
> > > > From: Gabriele Nicolardi <gabriele@medialab.sissa.it>
> > > > 
> > > > I’ve encountered a potential bug in Emacs when using the 
> > > > |query-replace| 
> > > > (via |perform-replace|) functions. When performing text replacements 
> > > > across a buffer and choosing to replace but not immediately move the 
> > > > point (using the |,| |act-and-show| option), the function does replace 
> > > > the text as expected but fails to update the highlighting to the region 
> > > > containing the replacement.
> > > > 
> > > > *Steps to Reproduce:*
> > > > 
> > > >  1.
> > > > 
> > > >     Open a buffer with the following content:
> > > > 
> > > >     |String to be replaced. Another string. String to be replaced.
> > > >     Another string. End |
> > > > 
> > > >  2.
> > > > 
> > > >     Run the following command:
> > > > 
> > > >     |(query-replace "String to be replaced." "Replacement." nil
> > > >     (point-min) (point-max)) |
> > > > 
> > > >  3.
> > > > 
> > > >     When prompted to replace a match, use the |,| (|act-and-show|)
> > > >     option to replace the text but pause moving to the next match.
> > > > 
> > > > *Expected Behavior:*
> > > > After a replacement is made and before moving to the next match, the 
> > > > highlighted region of the replaced text should be “updated” to fit the 
> > > > replaced text.
> > > > 
> > > > *Actual Behavior:*
> > > > The highlighting remains on the matched region. This issue can be 
> > > > visually confirmed in the following animation:
> > > 
> > > You don't say in what version of Emacs you see the problematic
> > > behavior.  I can reproduce the behavior you report in Emacs 29, but
> > > not in Emacs 30 (on the master branch of the Emacs Git repository).
> > > So I think this bug was already solved on the master branch, which
> > > will become Emacs 30.
> 
> Oh, sorry! My Emacs version is 29.3.

OK, thanks, so I'm now closing this bug.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]