From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: newline doesn't have whitespace syntax? Date: Fri, 12 May 2006 11:13:31 -0600 Organization: IHS Message-ID: References: <7f270cb80605120722i7fb1ca0ap6472229c335c8a@mail.gmail.com> <874pzv9syp.fsf@robotron.kosmorama> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1147454100 1335 80.91.229.2 (12 May 2006 17:15:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 12 May 2006 17:15:00 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 12 19:14:58 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 1FebE8-0005AJ-OR for geh-help-gnu-emacs@m.gmane.org; Fri, 12 May 2006 19:14:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FebE8-0005DN-6F for geh-help-gnu-emacs@m.gmane.org; Fri, 12 May 2006 13:14:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FebDw-0005A4-0q for help-gnu-emacs@gnu.org; Fri, 12 May 2006 13:14:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FebDu-00057B-8m for help-gnu-emacs@gnu.org; Fri, 12 May 2006 13:14:43 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FebDu-000574-3A for help-gnu-emacs@gnu.org; Fri, 12 May 2006 13:14:42 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FebFg-0002q2-4n for help-gnu-emacs@gnu.org; Fri, 12 May 2006 13:16:32 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FebDg-00055T-BI for help-gnu-emacs@gnu.org; Fri, 12 May 2006 19:14:28 +0200 Original-Received: from 207.167.42.206 ([207.167.42.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 May 2006 19:14:28 +0200 Original-Received: from ihs_4664 by 207.167.42.206 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 May 2006 19:14:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 41 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.206 User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) In-Reply-To: <874pzv9syp.fsf@robotron.kosmorama> 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:35002 Archived-At: David Hansen wrote: > On Fri, 12 May 2006 10:22:37 -0400 John Conrad wrote: > >> When I read this in the elisp manual: >> >> "Space, tab, newline and formfeed are classified as whitespace in >> almost all major modes." >> (35.2.1 Table of Syntax Classes) >> >> I assumed that this re-search-forward expression would match the line >> following it, but no dice. >> >> (re-search-forward "abcd[[:space:]]") >> abcd >> >> I've tried several different modes, including fundamental mode. Am I >> missing something? > > Sounds like an Emacs bug to me "\\s " is working (in > fundamental-mode). Anyway newline isn't whitespace in > "most" modes. In quite a lot of languages a newline ends a > comment. Right! But in Fundamental and Text modes, newline should have whitespace syntax (unless there is a syntax-table text property on it that specifies some other class). > To make your regexp reliable i would use something > like "abcd\\(\\s \\|$\\)" (note that this will match "abcd" > at the end of the buffer too w/o a final newline). "abcd\\>" or "abcd\\b" might be closer to what John wants, although the trailing whitespace (if any) would not be included in the match. > BTW: M-: (syntax-after (point)) RET may be useful. C-u C-x = -- Kevin