 <p>The second argument to <a href="http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/search_002dforward.html" rel="nofollow"><code>search-forward</code></a> bounds the search, so to search for a string on the current line, go to the start of the line, and use the end of the line as your bound:</p> <pre><code>(beginning-of-line) (search-forward myword (line-end-position)) </code></pre> <p>If you don't want to move point, then use <a href="http://www.gnu.org/software/emacs/elisp/html_node/Excursions.html" rel="nofollow"><code>save-excursion</code></a> to preserve it:</p> <pre><code>(save-excursion (beginning-of-line) (search-forward myword (line-end-position))) </code></pre>