Article View: gnu.emacs.help
Article #1828search behavior in elisp: catching a failed search
From: Lee Short
Date: Wed, 18 Nov 1992 16:31
Date: Wed, 18 Nov 1992 16:31
39 lines
1512 bytes
1512 bytes
I'm trying to write some Elisp code that searches through a mail
message for a string, and performs different actions based on whether
or not the string is found. My code looks like this:
(defun my-string-find (string-arg)
(set-mark-command nil)
(beginning-of-buffer)
(if (word-search-forward string-arg)
(progn
(set-mark-command t)
t
)
(progn
(set-mark-command t)
nil
)
)
)
But when I execute the line
(if (word-search-forward string-arg)
then my program is jumped out of. I can't seem to find the source for
word-search-forward in our source directory. Is there a
catch-and-throw signal I could catch? Is there another function to do
the search? Is there a better way to do this in the first place?
thanks in advance,
Lee
--
short@asf.com The mystery of government is not how Washington
Lee Short works, but how to make it stop. -- P.J. O'Rourke
Software Janitor I speak for none of the many steps in the food chain
Hughes Training, Inc. between myself and General Motors corporation.
Technical Details
Message-ID:
<1992Nov18.163118.1183@asf.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!wupost!uwm.edu!rpi!psinntp!psinntp!snoopy!shortShow Full Headers
Complete Article Headers
Newsgroups: gnu.emacs.help Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!uwm.edu!rpi!psinntp!psinntp!snoopy!short From: short@asf.com (Lee Short) Subject: search behavior in elisp: catching a failed search Message-ID: <1992Nov18.163118.1183@asf.com> Sender: short@asf.com (Lee Short) Organization: ASF Date: Wed, 18 Nov 1992 16:31:18 GMT Lines: 39