emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matching programming language identifiers, not "words"


From: Luc Teirlinck
Subject: Re: Matching programming language identifiers, not "words"
Date: Wed, 25 Aug 2004 20:09:55 -0500 (CDT)

Stefan Monnier wrote:

   >     I think we should distinguish betwen the idea of a character that is
   >     "symbol constituent" and a character that has "symbol syntax".

   > A priori that sounds like a useful solution.
   > Could you write proposed diffs to the manual to implement this
   > distinction clearly?

   I'm not sure what you're thinking of.  Within search.texi (the
   scope of the original discussion), it could look like the text below.

I somehow could not find the messages that this was a response to.

   +matches the empty string, but only at the beginning of a symbol.
   +A symbol is a sequence of one or more symbol-constituent characters.
   +A symbol-constituent character is a character whose syntax is either
   address@hidden or @samp{_}.  @samp{\_<} matches at the beginning of the
   +buffer only if a symbol-constituent character follows.

This is intended for the _Emacs_ manual and "syntax @vsamp{w} or
@samp{_}" seems to be nowhere explained in there.  I guess that @vsamp
is a typo.

I did not see any reactions to this message, but _something_ in
man/search.texi and lispref/searching.texi needs to be changed, as the
current text is ambiguous at best.  What about the following minimal
changes that would take away the ambiguity?

===File ~/man-search.texi-diff==============================
*** search.texi 23 Aug 2004 22:24:09 -0500      1.52
--- search.texi 25 Aug 2004 15:26:45 -0500      
***************
*** 745,756 ****
  matches the empty string, but only at the beginning of a symbol.  A
  symbol is a sequence of one or more word or symbol constituent
  characters.  @samp{\_<} matches at the beginning of the buffer only if
! a symbol-constituent character follows.
  
  @item \_>
  matches the empty string, but only at the end of a symbol.  @samp{\_>}
  matches at the end of the buffer only if the contents end with a
! symbol-constituent character.
  
  @item address@hidden
  matches any character whose syntax is @var{c}.  Here @var{c} is a
--- 745,756 ----
  matches the empty string, but only at the beginning of a symbol.  A
  symbol is a sequence of one or more word or symbol constituent
  characters.  @samp{\_<} matches at the beginning of the buffer only if
! a word or symbol constituent character follows.
  
  @item \_>
  matches the empty string, but only at the end of a symbol.  @samp{\_>}
  matches at the end of the buffer only if the contents end with a
! word or symbol constituent character.
  
  @item address@hidden
  matches any character whose syntax is @var{c}.  Here @var{c} is a
============================================================

===File ~/searching.texi-diff===============================
*** searching.texi      16 Jul 2004 12:47:02 -0500      1.51
--- searching.texi      25 Aug 2004 15:28:23 -0500      
***************
*** 1,6 ****
  @c -*-texinfo-*-
  @c This is part of the GNU Emacs Lisp Reference Manual.
! @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999
  @c   Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
  @setfilename ../info/searching
--- 1,6 ----
  @c -*-texinfo-*-
  @c This is part of the GNU Emacs Lisp Reference Manual.
! @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2004
  @c   Free Software Foundation, Inc.
  @c See the file elisp.texi for copying conditions.
  @setfilename ../info/searching
***************
*** 672,684 ****
  matches the empty string, but only at the beginning of a symbol.  A
  symbol is a sequence of one or more word or symbol constituent
  characters.  @samp{\_<} matches at the beginning of the buffer (or
! string) only if a symbol-constituent character follows.
  
  @item \_>
  @cindex @samp{\_>} in regexp
  matches the empty string, but only at the end of a symbol.  @samp{\_>}
  matches at the end of the buffer (or string) only if the contents end
! with a symbol-constituent character.
  @end table
  
  @kindex invalid-regexp
--- 672,684 ----
  matches the empty string, but only at the beginning of a symbol.  A
  symbol is a sequence of one or more word or symbol constituent
  characters.  @samp{\_<} matches at the beginning of the buffer (or
! string) only if a word or symbol constituent character follows.
  
  @item \_>
  @cindex @samp{\_>} in regexp
  matches the empty string, but only at the end of a symbol.  @samp{\_>}
  matches at the end of the buffer (or string) only if the contents end
! with a word or symbol constituent character.
  @end table
  
  @kindex invalid-regexp
============================================================




reply via email to

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