Xref: utzoo gnu.emacs.help:263 comp.emacs:9459 Path: utzoo!utgpu!watserv1!watmath!uunet!tut.cis.ohio-state.edu!ALEXANDER.BBN.COM!gildea From: gildea@ALEXANDER.BBN.COM (Stephen Gildea) Newsgroups: gnu.emacs.help,comp.emacs Subject: Re: Aborting a search nicely Message-ID: <9011081616.AA19317@life.ai.mit.edu> Date: 8 Nov 90 16:15:11 GMT Sender: daemon@tut.cis.ohio-state.edu Followup-To: gnu.emacs.help Organization: GNUs Not Usenet Lines: 19 (re-search-forward "String") If "String" does not exist in my buffer then the search-forward command bombs out. There must be a way to stop the search-forward from bombing out and to do something if the string is not found. RTFM: a quick look at "C-h f re-search-forward" shows you how to supply the extra arguments to do this: (if (re-search-forward "String" nil t) (progn success commands here...) not found commands here...) < Stephen Bolt Beranek and Newman Inc. gildea@bbn.com Cambridge, Massachusetts