From ece75c05d6861bb49faec4a5f1de4951410f54a9 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 24 Nov 2005 09:59:37 +0000 Subject: [PATCH] (isearch-repeat): With empty search ring set `isearch-error' to the error string instead of signaling error with the function `error'. --- lisp/ChangeLog | 6 ++++++ lisp/isearch.el | 19 ++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 728ba2b4def..9af92d5a362 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2005-11-24 Juri Linkov + + * isearch.el (isearch-repeat): With empty search ring + set `isearch-error' to the error string instead of signaling + error with the function `error'. + 2005-11-24 YAMAMOTO Mitsuharu * term/mac-win.el: Make modifier `ctrl' an alias of `control'. diff --git a/lisp/isearch.el b/lisp/isearch.el index cdddd47cbaf..5f80cdc6f2a 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1138,15 +1138,16 @@ Use `isearch-exit' to quit without signaling." ;; C-s in forward or C-r in reverse. (if (equal isearch-string "") ;; If search string is empty, use last one. - (setq isearch-string - (or (if isearch-regexp - (car regexp-search-ring) - (car search-ring)) - (error "No previous search string")) - isearch-message - (mapconcat 'isearch-text-char-description - isearch-string "") - isearch-case-fold-search isearch-last-case-fold-search) + (if (null (if isearch-regexp regexp-search-ring search-ring)) + (setq isearch-error "No previous search string") + (setq isearch-string + (if isearch-regexp + (car regexp-search-ring) + (car search-ring)) + isearch-message + (mapconcat 'isearch-text-char-description + isearch-string "") + isearch-case-fold-search isearch-last-case-fold-search)) ;; If already have what to search for, repeat it. (or isearch-success (progn -- 2.11.4.GIT