[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: forward-word and NamesLikeThis

From: B. T. Raven
Subject: Re: forward-word and NamesLikeThis
Date: Sun, 18 Jun 2006 19:07:35 -0500

"Drew Adams" <> wrote in message
>     For a while I've wanted to make forward-word stop at each word in
>     NamesLikeThis in programming modes.  That is, forward-word would
>     at the L and the T.
> This doesn't speak to your question about syntax tables, but why not
> define your own replacement for `forward-word', for use in buffers where
> want this behavior?

I thought that would be easy too, so I quickly typed out the following:

(defun forward-stud ()
 "Move point forward to next word or upper case character as the case may
 (while (not (looking-at " \|[A-Z]"))

This immediately moves point to the end of the buffer and dings. I know
that it dings because it tries to forward-char at the end of buffer but
why doesn't it stop at all characters following spaces and at upper case
characters. I have never used the \| before so I suppose something is
wrong with the regexp, but what?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]