From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: forward-word and NamesLikeThis Date: Sun, 18 Jun 2006 23:14:31 -0500 Organization: UseNetServer.com Message-ID: <223b4$449624d1$49ede92$12358@DIALUPUSA.NET> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1150692163 22610 80.91.229.2 (19 Jun 2006 04:42:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 19 Jun 2006 04:42:43 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 19 06:42:41 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FsBau-0005Vs-C6 for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Jun 2006 06:42:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FsBat-0006Zi-Tq for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Jun 2006 00:42:35 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!atl-c08.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!DIALUPUSA.NET!not-for-mail Original-Newsgroups: gnu.emacs.help X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Original-X-Complaints-To: abuse@usenetserver.com Original-Lines: 34 Original-X-Trace: 223b4449624d1a13b7b3712358 Original-Xref: shelby.stanford.edu gnu.emacs.help:139913 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35537 Archived-At: "Drew Adams" wrote in message news:mailman.3013.1150683192.9609.help-gnu-emacs@gnu.org... > (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 case > characters. I have never used the \| before so I suppose something is > 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 be" (interactive) (forward-char) (while (not (looking-at " \\|[A-Z]")) (forward-char)) (while (looking-at " ") (forward-char)) (while (looking-at ";") (foward-line)) (while (eolp) (forward-char)) )