X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/95b6d681b1121e1be8955aa3f79dd39098edf4cf..e1ef0dac0866570df62f96fb004de896f6e82397:/lisp/isearch.el diff --git a/lisp/isearch.el b/lisp/isearch.el index 98032c29ba..7fd96df1b0 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1,7 +1,7 @@ ;;; isearch.el --- incremental search minor mode ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, -;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; Free Software Foundation, Inc. ;; Author: Daniel LaLiberte @@ -1244,9 +1244,9 @@ Use `isearch-exit' to quit without signaling." (interactive) ;; (ding) signal instead below, if quitting (discard-input) - (if isearch-success - ;; If search is successful, move back to starting point - ;; and really do quit. + (if (and isearch-success (not isearch-error)) + ;; If search is successful and has no incomplete regexp, + ;; move back to starting point and really do quit. (progn (setq isearch-success nil) (isearch-cancel)) @@ -1994,12 +1994,6 @@ Isearch mode." (setq char (unibyte-char-to-multibyte char))) (isearch-process-search-char char)))) -(defun isearch-return-char () - "Convert return into newline for incremental search." - (interactive) - (isearch-process-search-char ?\n)) -(make-obsolete 'isearch-return-char 'isearch-printing-char "19.7") - (defun isearch-printing-char () "Add this ordinary printing character to the search string and search." (interactive) @@ -2587,6 +2581,7 @@ since they have special meaning in a regexp." (defvar isearch-lazy-highlight-regexp nil) (defvar isearch-lazy-highlight-space-regexp nil) (defvar isearch-lazy-highlight-forward nil) +(defvar isearch-lazy-highlight-error nil) (defun lazy-highlight-cleanup (&optional force) "Stop lazy highlighting and remove extra highlighting from current buffer. @@ -2628,9 +2623,13 @@ by other Emacs features." (not (= (window-end) ; Window may have been split/joined. isearch-lazy-highlight-window-end)) (not (eq isearch-forward - isearch-lazy-highlight-forward)))) + isearch-lazy-highlight-forward)) + ;; In case we are recovering from an error. + (not (equal isearch-error + isearch-lazy-highlight-error)))) ;; something important did indeed change (lazy-highlight-cleanup t) ;kill old loop & remove overlays + (setq isearch-lazy-highlight-error isearch-error) (when (not isearch-error) (setq isearch-lazy-highlight-start-limit beg isearch-lazy-highlight-end-limit end) @@ -2768,5 +2767,4 @@ CASE-FOLD non-nil means the search was case-insensitive." (isearch-search) (isearch-update)) -;; arch-tag: 74850515-f7d8-43a6-8a2c-ca90a4c1e675 ;;; isearch.el ends here