changeset 14491:ce77caa93022

(View-search-last-regexp-forward) (View-search-last-regexp-backward): Nice error if no prev regexp.
author Richard M. Stallman <rms@gnu.org>
date Sun, 04 Feb 1996 21:11:50 +0000
parents c463c25a6806
children 0ebde55bb21d
files lisp/view.el
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/view.el	Sun Feb 04 20:25:10 1996 +0000
+++ b/lisp/view.el	Sun Feb 04 21:11:50 1996 +0000
@@ -411,7 +411,9 @@
 The variable `view-highlight-face' controls the face that is used
 for highlighting the match that is found."
   (interactive "p")
-  (View-search-regexp-forward n view-last-regexp))
+  (if view-last-regexp
+      (View-search-regexp-forward n view-last-regexp)
+    (error "No previous View-mode search")))
 
 (defun View-search-last-regexp-backward (n)
   "Search backward from window start for Nth instance of last regexp.
@@ -421,7 +423,9 @@
 The variable `view-highlight-face' controls the face that is used
 for highlighting the match that is found."
   (interactive "p")
-  (View-search-regexp-backward n view-last-regexp))
+  (if view-last-regexp
+      (View-search-regexp-backward n view-last-regexp)
+    (error "No previous View-mode search")))
 
 (defun View-back-to-mark (&optional ignore)
   "Return to last mark set in View mode, else beginning of file.