diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-01-02 17:43:16 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-01-02 17:43:16 +0000 |
commit | df20641947a1d2c410adbb9401b0ed859f03a2db (patch) | |
tree | 74c4fb2aa78c73f047bc7d2b27b4669852419d3f /lisp/isearch.el | |
parent | 1620eed201b9d81e4610f319620d31496380f57c (diff) | |
download | emacs-df20641947a1d2c410adbb9401b0ed859f03a2db.tar.gz |
(isearch-repeat): If we matched a null string and there's
no place to advance to, fail instead.
Diffstat (limited to 'lisp/isearch.el')
-rw-r--r-- | lisp/isearch.el | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index ba24618d1a6..c157f51ecd2 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -4,7 +4,7 @@ ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu> -;; |$Date: 1993/12/24 03:30:11 $|$Revision: 1.57 $ +;; |$Date: 1993/12/25 00:50:10 $|$Revision: 1.58 $ ;; This file is part of GNU Emacs. @@ -838,14 +838,21 @@ Use `isearch-exit' to quit without signalling." (setq isearch-forward (not isearch-forward))) (setq isearch-barrier (point)) ; For subsequent \| if regexp. - (setq isearch-success t) - (or (equal isearch-string "") - (progn + + (if (equal isearch-string "") + (setq isearch-success t) + (if (and isearch-success (equal (match-end 0) (match-beginning 0))) ;; If repeating a search that found ;; an empty string, ensure we advance. - (if (equal (match-end 0) (match-beginning 0)) - (forward-char (if isearch-forward 1 -1))) - (isearch-search))) + (if (if isearch-forward (eobp) (bobp)) + ;; If there's nowhere to advance to, fail (and wrap next time). + (progn + (setq isearch-success nil) + (ding)) + (forward-char (if isearch-forward 1 -1)) + (isearch-search)) + (isearch-search))) + (isearch-push-state) (isearch-update)) |