[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" <drew.adams@oracle.com> wrote in message
news:mailman.3010.1150667368.9609.help-gnu-emacs@gnu.org...
> For a while I've wanted to make forward-word stop at each word in
> NamesLikeThis in programming modes. That is, forward-word would
stop
> at the L and the T.
>
> This doesn't speak to your question about syntax tables, but why not
just
> define your own replacement for `forward-word', for use in buffers where
you
> 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
be"
(interactive)
(while (not (looking-at " \|[A-Z]"))
(forward-char))
(forward-char)
)
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?
Thanks,
Ed.