[Python-mode] Underscore syntax class

Tom Tromey tromey at redhat.com
Wed May 2 18:36:06 CEST 2007

>>>>> "Ian" == Ian Zimmerman <itz at madbat.mine.nu> writes:

Ian> (re-search-backward "\<while\>")

Ian> (with-syntax-table internal-python-syntax-table
Ian>         (re-search-backward "\<while\>))

FWIW in Emacs 22 you can use (re-search-backward "\\_<symbol\\_>").
>From NEWS:

    *** New regular expression operators, `\_<' and `\_>'.

    These match the beginning and end of a symbol.  A symbol is a
    non-empty sequence of either word or symbol constituent characters, as
    specified by the syntax table.


More information about the Python-mode mailing list