emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp ChangeLog replace.el


From: Juri Linkov
Subject: [Emacs-diffs] emacs/lisp ChangeLog replace.el
Date: Mon, 30 Nov 2009 16:05:51 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Juri Linkov <jurta>     09/11/30 16:05:51

Modified files:
        lisp           : ChangeLog replace.el 

Log message:
        (perform-replace): Let-bind recenter-last-op to nil.
        For def=recenter, replace `recenter' with `recenter-top-bottom'
        that is called with `this-command' and `last-command' let-bound
        to `recenter-top-bottom'.  When the last `def' was not `recenter',
        set `recenter-last-op' to nil.  (Bug#4981)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16768&r2=1.16769
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/replace.el?cvsroot=emacs&r1=1.287&r2=1.288

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16768
retrieving revision 1.16769
diff -u -b -r1.16768 -r1.16769
--- ChangeLog   30 Nov 2009 13:49:13 -0000      1.16768
+++ ChangeLog   30 Nov 2009 16:05:47 -0000      1.16769
@@ -1,3 +1,11 @@
+2009-11-30  Juri Linkov  <address@hidden>
+
+       * replace.el (perform-replace): Let-bind recenter-last-op to nil.
+       For def=recenter, replace `recenter' with `recenter-top-bottom'
+       that is called with `this-command' and `last-command' let-bound
+       to `recenter-top-bottom'.  When the last `def' was not `recenter',
+       set `recenter-last-op' to nil.  (Bug#4981)
+
 2009-11-30  Stefan Monnier  <address@hidden>
 
        Minor cleanup and simplification.

Index: replace.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/replace.el,v
retrieving revision 1.287
retrieving revision 1.288
diff -u -b -r1.287 -r1.288
--- replace.el  12 Nov 2009 06:55:43 -0000      1.287
+++ replace.el  30 Nov 2009 16:05:50 -0000      1.288
@@ -1549,6 +1549,7 @@
          (replace-count 0)
          (nonempty-match nil)
         (multi-buffer nil)
+        (recenter-last-op nil) ; Start cycling order with initial position.
 
          ;; If non-nil, it is marker saying where in the buffer to stop.
          (limit nil)
@@ -1785,7 +1786,12 @@
                        ((eq def 'skip)
                         (setq done t))
                        ((eq def 'recenter)
-                        (recenter nil))
+                        ;; `this-command' has the value `query-replace',
+                        ;; so we need to bind it to `recenter-top-bottom'
+                        ;; to allow it to detect a sequence of `C-l'.
+                        (let ((this-command 'recenter-top-bottom)
+                              (last-command 'recenter-top-bottom))
+                          (recenter-top-bottom)))
                        ((eq def 'edit)
                         (let ((opos (point-marker)))
                           (setq real-match-data (replace-match-data
@@ -1839,9 +1845,12 @@
                                       unread-command-events))
                         (setq done t)))
                  (when query-replace-lazy-highlight
-                   ;; Force lazy rehighlighting only after replacements
+                   ;; Force lazy rehighlighting only after replacements.
                    (if (not (memq def '(skip backup)))
-                       (setq isearch-lazy-highlight-last-string nil))))
+                       (setq isearch-lazy-highlight-last-string nil)))
+                 (unless (eq def 'recenter)
+                   ;; Reset recenter cycling order to initial position.
+                   (setq recenter-last-op nil)))
                ;; Record previous position for ^ when we move on.
                ;; Change markers to numbers in the match data
                ;; since lots of markers slow down editing.




reply via email to

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