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

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

Re: query-replace-regexp whitespace handling


From: Michael Mauger
Subject: Re: query-replace-regexp whitespace handling
Date: Wed, 2 Mar 2005 17:05:55 -0800 (PST)

--- Eli Zaretskii <address@hidden> wrote:

> > Date: Wed, 9 Feb 2005 08:54:59 -0800 (PST)
> > From: Michael Mauger <address@hidden>
> > 
> > I am in W32 but it doesn't appear to be system dependent.  I did some
> > more research and determined that the problem is not specific to
> > `query-replace-regexp', it also occurs in `query-replace'; and it is
> > not related to whitespace handling.  
> > 
> > The problem appears in the handling of history when the default is
> > processed.  
> > 
> > ...
> >
> > The following patch seems to correct the problem:
> 
> Thanks, I installed this.
> 

I found a problem in the patch I had provided.  The following corrects
the problem (essentially the order was backwards so the wrong value was
being returned):

Index: emacs/lisp/replace.el
===================================================================
RCS file: /c/cvsroot/emacs/emacs/lisp/replace.el,v
retrieving revision 1.206
diff -u -r1.206 replace.el
--- emacs/lisp/replace.el       19 Feb 2005 21:08:43 -0000      1.206
+++ emacs/lisp/replace.el       3 Mar 2005 00:55:03 -0000
@@ -116,10 +116,10 @@
               nil t t))))
       (if (and (zerop (length from)) lastto lastfrom)
          (progn
-           (cons lastfrom
-                 (query-replace-compile-replacement lastto regexp-flag))
            (set query-replace-from-history-variable
-                (cdr (symbol-value
query-replace-from-history-variable))))
+                (cdr (symbol-value
query-replace-from-history-variable)))
+           (cons lastfrom
+                 (query-replace-compile-replacement lastto
regexp-flag)))
        ;; Warn if user types \n or \t, but don't reject the input.
        (and regexp-flag
             (string-match
"\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from)

Thanks.




reply via email to

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