[Top][All Lists]

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

Re: modify-syntax-entry and UTF8?

From: Stefan Monnier
Subject: Re: modify-syntax-entry and UTF8?
Date: Tue, 22 May 2007 05:48:43 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

Hi Geoffrey,

> As far as I can tell, modify-syntax-entry does not interact properly with
> UTF8 in the CVS snapshot of emacs that I am currently using.  Is this the
> intended behavior and there is some other mechanism I should be using?
> Specifically I would like to do something like the following

> (modify-syntax-entry ?〈 "(〉")
> (modify-syntax-entry ?〉 ")〈")

> Which is happily accepted but does not correctly interpret matching pairs of
> angle brackets in a buffer.  I searched the documentation but could not seem
> to find information on how "char" parameters to modify-syntax-entry relate
> to Unicode characters.

It should work, but there are several potential problems you may be
bumping into.  One is that there are several syntax-tables, so you want to
be careful to modify the one you actually use.  The two calls above modify
the "current syntax table", i.e. the one currently active in the current
buffer, so if you then try it in some other buffer it probably won't do what
you wanted.

The other one is that Emacs's internal representation of characters is not
unified so there may be several different chars equivalent to 〈, in which
case setting the syntax of one will not have any influence on the other.

Yet another is that maybe the syntax-table is set right, but the way you use
to test that Emacs "correctly interpret matching pairs of angle brackets in
a buffer" hits a bug (or misfeature).

Note also that those two chars should already by default have the syntax
you're trying to set, so most likely the problem is not the first one.

So, in the buffer of interest, go to the 〈 and 〉 chars and check them with
C-u C-x =.  If the *Help* buffer says these are part of the
mule-unicode-... charset and that their syntax is (〉 (resp )〈), then tell us
what makes you think that they are not properly matched (which operation
fails and in precisely which circumstance).


reply via email to

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