]> git.eshelyaron.com Git - emacs.git/commitdiff
(nonincremental-repeat-search-forward)
authorRichard M. Stallman <rms@gnu.org>
Sat, 28 Jun 1997 03:15:16 +0000 (03:15 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 28 Jun 1997 03:15:16 +0000 (03:15 +0000)
(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

index 0103d82c43a5d73ad45840a60156204f037c29a0..2828481d2ddb76adc94983aae18f8a02a1aa474b 100644 (file)
@@ -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]