[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 23:14:31 -0500

"Drew Adams" <> wrote in message
>     (defun forward-stud ()
>      (interactive)
>      (while (not (looking-at " \|[A-Z]")) (forward-char))
>      (forward-char))
>     why doesn't it stop at all characters following spaces and at upper
>     characters. I have never used the \| before so I suppose something
>     wrong with the regexp, but what?
> Use two backslashes to insert a backslash in a Lisp string: \\|.

Of course. Thanks. Now that it sort of works I can see that the approach
is hopelessly naive. If I needed such a thing I would use the
SubWordMinorMode suggested by Johan.  The latest cut, such as it is:

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

reply via email to

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