unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: newline doesn't have whitespace syntax?
Date: Fri, 12 May 2006 11:13:31 -0600	[thread overview]
Message-ID: <e42fp4$156$1@sea.gmane.org> (raw)
In-Reply-To: <874pzv9syp.fsf@robotron.kosmorama>

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

      reply	other threads:[~2006-05-12 17:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-12 14:22 newline doesn't have whitespace syntax? John Conrad
2006-05-12 15:13 ` David Hansen
2006-05-12 17:13   ` Kevin Rodgers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='e42fp4$156$1@sea.gmane.org' \
    --to=ihs_4664@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).