[Top][All Lists]

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

Re: syntax-after

From: Stefan
Subject: Re: syntax-after
Date: Sat, 13 Nov 2004 18:55:47 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (darwin)

> It is not new.  My change makes it compatible with char-syntax, which
> is why I did it.

But the code you used is not compatible with `char-syntax'.  To be
compatible with `char-syntax' you'd have to drop the "matching paren"
(i.e. the cdr of the data) as well as the flags.
I don't think that hiding this "side" info would be a good idea either.

I.e. I think syntax-after should return the "raw" data as before (after all
that's why I wrote it like that originally).  If you find this raw data to
be intimidating, we should provide another function `syntax-class' such that

   (syntax-class (syntax-after)) == (char-syntax (char-after))

or something along these lines.

> It is also more comparible with the way modify-syntax-entry works, since
> the same character is used now by both.

> This change reduces the number of representations of the syntax by
> one, as far as I know.  Or is there some other function that uses the
> old representation of syntax-after?  If so, perhaps it should be
> changed too.

The raw representation (i.e. the cons cell representation used inside the
chartables used as syntax-tables) does appear at various places (it appears
if you do (aref <syntax-table> ?\[) or if you lookup the `syntax-table'
text-property, it is used in font-lock-syntactic-keywords for code that
needs to work on Emacs-20, ...) and it seems difficult to get rid of it now;
so no, you haven't reduced the number of representations.


reply via email to

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