emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/replace.el


From: Juri Linkov
Subject: [Emacs-diffs] Changes to emacs/lisp/replace.el
Date: Fri, 18 Mar 2005 04:59:45 -0500

Index: emacs/lisp/replace.el
diff -c emacs/lisp/replace.el:1.207 emacs/lisp/replace.el:1.208
*** emacs/lisp/replace.el:1.207 Fri Feb 25 11:44:11 2005
--- emacs/lisp/replace.el       Fri Mar 18 09:59:45 2005
***************
*** 1344,1352 ****
        ;; (match-data); otherwise it is t if a match is possible at point.
        (match-again t)
  
-       (isearch-string isearch-string)
-       (isearch-regexp isearch-regexp)
-       (isearch-case-fold-search isearch-case-fold-search)
        (message
         (if query-flag
             (substitute-command-keys
--- 1344,1349 ----
***************
*** 1380,1389 ****
                                      (regexp-quote from-string))
                                    "\\b")))
      (when query-replace-lazy-highlight
!       (setq isearch-string search-string
!           isearch-regexp (or delimited-flag regexp-flag)
!           isearch-case-fold-search case-fold-search
!           isearch-lazy-highlight-last-string nil))
  
      (push-mark)
      (undo-boundary)
--- 1377,1383 ----
                                      (regexp-quote from-string))
                                    "\\b")))
      (when query-replace-lazy-highlight
!       (setq isearch-lazy-highlight-last-string nil))
  
      (push-mark)
      (undo-boundary)
***************
*** 1453,1461 ****
                (let ((inhibit-read-only
                       query-replace-skip-read-only))
                  (unless (or literal noedit)
!                   (replace-highlight (nth 0 real-match-data)
!                                      (nth 1 real-match-data)
!                                      start end))
                  (setq noedit
                        (replace-match-maybe-edit
                         next-replacement nocasify literal
--- 1447,1456 ----
                (let ((inhibit-read-only
                       query-replace-skip-read-only))
                  (unless (or literal noedit)
!                   (replace-highlight
!                    (nth 0 real-match-data) (nth 1 real-match-data)
!                    start end search-string
!                    (or delimited-flag regexp-flag) case-fold-search))
                  (setq noedit
                        (replace-match-maybe-edit
                         next-replacement nocasify literal
***************
*** 1471,1478 ****
                ;; `real-match-data'.
                (while (not done)
                  (set-match-data real-match-data)
!                 (replace-highlight (match-beginning 0) (match-end 0)
!                                    start end)
                  ;; Bind message-log-max so we don't fill up the message log
                  ;; with a bunch of identical messages.
                  (let ((message-log-max nil))
--- 1466,1475 ----
                ;; `real-match-data'.
                (while (not done)
                  (set-match-data real-match-data)
!                 (replace-highlight
!                  (match-beginning 0) (match-end 0)
!                  start end search-string
!                  (or delimited-flag regexp-flag) case-fold-search)
                  ;; Bind message-log-max so we don't fill up the message log
                  ;; with a bunch of identical messages.
                  (let ((message-log-max nil))
***************
*** 1604,1614 ****
                                       unread-command-events))
                         (setq done t)))
                  (when query-replace-lazy-highlight
-                   ;; Restore isearch data for lazy highlighting
-                   ;; in case of isearching during recursive edit
-                   (setq isearch-string search-string
-                         isearch-regexp (or delimited-flag regexp-flag)
-                         isearch-case-fold-search case-fold-search)
                    ;; Force lazy rehighlighting only after replacements
                    (if (not (memq def '(skip backup)))
                        (setq isearch-lazy-highlight-last-string nil))))
--- 1601,1606 ----
***************
*** 1648,1668 ****
  
  (defvar replace-overlay nil)
  
! (defun replace-highlight (match-beg match-end range-beg range-end)
    (if query-replace-highlight
        (if replace-overlay
          (move-overlay replace-overlay match-beg match-end (current-buffer))
        (setq replace-overlay (make-overlay match-beg match-end))
        (overlay-put replace-overlay 'priority 1) ;higher than lazy overlays
        (overlay-put replace-overlay 'face 'query-replace)))
!   (when query-replace-lazy-highlight
!     (isearch-lazy-highlight-new-loop range-beg range-end)))
  
  (defun replace-dehighlight ()
    (when replace-overlay
      (delete-overlay replace-overlay))
    (when query-replace-lazy-highlight
!     (isearch-lazy-highlight-cleanup lazy-highlight-cleanup)
      (setq isearch-lazy-highlight-last-string nil)))
  
  ;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4
--- 1640,1664 ----
  
  (defvar replace-overlay nil)
  
! (defun replace-highlight (match-beg match-end range-beg range-end
!                         string regexp case-fold)
    (if query-replace-highlight
        (if replace-overlay
          (move-overlay replace-overlay match-beg match-end (current-buffer))
        (setq replace-overlay (make-overlay match-beg match-end))
        (overlay-put replace-overlay 'priority 1) ;higher than lazy overlays
        (overlay-put replace-overlay 'face 'query-replace)))
!   (if query-replace-lazy-highlight
!       (let ((isearch-string string)
!           (isearch-regexp regexp)
!           (isearch-case-fold-search case-fold))
!       (isearch-lazy-highlight-new-loop range-beg range-end))))
  
  (defun replace-dehighlight ()
    (when replace-overlay
      (delete-overlay replace-overlay))
    (when query-replace-lazy-highlight
!     (lazy-highlight-cleanup lazy-highlight-cleanup)
      (setq isearch-lazy-highlight-last-string nil)))
  
  ;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4




reply via email to

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