From 008c84933e6cb14b75d5c3b67e60e084978174b4 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 28 Jun 1997 03:15:16 +0000 Subject: [PATCH] (nonincremental-repeat-search-forward) (nonincremental-repeat-search-backward) (nonincremental-repeat-re-search-forward) (nonincremental-repeat-re-search-backward): Special error check for no previous search. --- lisp/menu-bar.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 0103d82c43a..2828481d2dd 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -183,21 +183,29 @@ A large number or nil slows down menu responsiveness." (defun nonincremental-repeat-search-forward () "Search forward for the previous search string." (interactive) + (if (null search-ring) + (error "No previous search")) (search-forward (car search-ring))) (defun nonincremental-repeat-search-backward () "Search backward for the previous search string." (interactive) + (if (null search-ring) + (error "No previous search")) (search-backward (car search-ring))) (defun nonincremental-repeat-re-search-forward () "Search forward for the previous regular expression." (interactive) + (if (null regex-search-ring) + (error "No previous search")) (re-search-forward (car regexp-search-ring))) (defun nonincremental-repeat-re-search-backward () "Search backward for the previous regular expression." (interactive) + (if (null regex-search-ring) + (error "No previous search")) (re-search-backward (car regexp-search-ring))) (define-key menu-bar-search-menu [query-replace-regexp] -- 2.39.2