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

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

Re: problems with query-replace, replace-string


From: Spencer Thiel
Subject: Re: problems with query-replace, replace-string
Date: Thu, 15 Nov 2001 10:21:35 -0800

I can only replicate the problem when using ange-ftp, although I feel like it's 
happened in local files as well.

Did the following to get the bug:
1) # emacs -q --no-site-file
2) connected to remote server using ange-ftp, e.g.: C-x C-f 
/username@foobar.com:/~
3) created a new file in remote directory named test.txt: C-x C-f 
/username@foobar.com:/home/username/test.txt
4) added the string "Software Manager</h2>" (w/o quotes) to the file
5) C-x C-s (the bug won't happen if you don't save the file first)
6) M-x replace-string "Software Manager" "Update Assistant"
7) This replaces "Software Manager</h2>" with "Update Assistanth2>"

This will occur if you use replace-regexp, query-replace, or 
query-replace-regexp.

If the file is filled with multiple occurences of the string, the greedy 
replacement will only happen to the first occurence of the string.  Thereafter, 
the behavior is as expected.

This behavior seems to be mode independent; I have seen it using 
fundamental-mode, text-mode, sgml-mode, html-helper-mode, cperl-mode, and 
c++-mode.


   Date: Thu, 15 Nov 2001 10:18:22 +0200 (IST)
   From: Eli Zaretskii <eliz@is.elta.co.il>
   X-Sender: eliz@is
   cc: bug-gnu-emacs@gnu.org
   X-Fetchmail-Warning: ; SMTP listener rejected local recipient addresses: 
sthiel


   On Wed, 14 Nov 2001, Spencer Thiel wrote:

   > This sometimes replaced "Software Manager</h2>" with "Update
   > Assistanth2>", and "Software Manager</a>" with "Update Assistanta>"
   > clipping the </.  It seems that the replacement is happening to
   > characters that aren't included inside the search string.  Above is
   > just an example.  The bug isn't specific to the search string above,
   > or to the clipped characters.  I've encountered the problem with a
   > variety of different search strings and replacement strings.  I've
   > had the problem on builds on both windows and linux, and while using
   > html-helper-mode, cperl-mode, and c++-mode.  The behavior isn't
   > consistent -- I can do the same search and replace on multiple files
   > and some will experience the bug while others don't.

   To be able to debug this, we need a recipe to reproduce the problem.
   Ideally, the recipe should start with "emacs -q --no-site-file", to
   avoid complications with user and site-wide customizations.

   Could you please try to find such a recipe?  It would be a great help;
   without such a recipe, the only person who could debug this problem is
   you.

   TIA




reply via email to

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