Re: Re: Callbacks?

Gregg Reynolds <[email protected]>
Newsgroups gmane.emacs.bidi
Message-ID <[email protected]>
Martin Duerst wrote:
> 
> Good to know. The following are potential problems:
> - Can the properties be set for each mode individually?
> - Can the properties change based on context? As a simple
>   example, attributes in XML can be quoted with single quotes
>   or with double quotes. In the attribute value, the 'other'
>   quote can then be used literally. So if we have something
>   like
>   <element attr1="What's up?" attr2='He cried "Help!" and ran away.' />
>                  1    2     1       1         2     2              1
>   then for the places marked 1, which are XML syntax, we want to
>   change the properties (e.g. to LTR), but for the cases marked
>   with 2, which are content, we do not want to change the properties.
>   Would such a thing be possible?
> - In our current approach, we not only change the properties of some
>   characters, but also introduce additional embedding (or occasionally
>   override) levels. Is this possible in your implementation?
> 
Have you taken a look at the source for nxml mode?  You might be able to 
hack it up do do something like this.  As I understand it, in Emacs you 
can set whatever properties you like on each character in a buffer.  See 
node 32.19, "Text Properties", of the Elisp manual.

Now the interesting possibility presents itself, which is to add 
Unicode-related "special" (ie. built-in) text properties.  In 
particular, directional class.  Then allow the user to override the 
Unicode-defined class for any particular character or set of chars in a 
buffer.  So in your example above, the nxml parser identifies weakly 
directional chars in the XML syntax, and switches their 
"unicode-directionality" property to strong LTR.  Voila!  The bidi 
reordering obeys the user-set directionality and does the right thing.

-g
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.