[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-AUCTeX] 11.84; Font replacing doesn't work for unbalanced paren
From: |
Ikumi Keita |
Subject: |
Re: [Bug-AUCTeX] 11.84; Font replacing doesn't work for unbalanced parentheses. |
Date: |
Tue, 06 Mar 2007 22:49:04 +0900 |
>>>>> Ralf Angeli writes:
> That's a bug in Emacs 21 which is fixed in CVS Emacs. (See the
> comment in the defvar of `TeX-syntax-table'.) As a workaround we
> could set the syntax entries for parens to nil.
I see. Sorry for my lack of knowledge about CVS Emacs.
> The variable is not supposed to be used directly. If a syntax table
> for searching is required, the function `TeX-search-syntax-table'
> should be used. Working with only a single syntax was a deliberate
> decision because syntax tables are quite large data structures and I
> didn't want to waste memory by making that variable buffer-local or do
> something similar.
Sorry, I didn't give an example concrete enough. Here is the detail.
1. Assume that the buffer foo is in texinfo-mode and the buffer bar is
in latex-mode.
2. Go to the buffer foo and type C-c C-f C-e.
3. As expected, @emph{} is inserted.
4. Place the cursor on @emph and type C-u C-c C-f C-e.
5. At this point,
(char-to-string (with-syntax-table (TeX-search-syntax-table ?{ ?}) (char-syntax
?@)))
returns "\\". This is OK.
6. Go to the buffer bar.
7. Evaluating
(char-to-string (with-syntax-table (TeX-search-syntax-table ?{ ?}) (char-syntax
?@)))
gives "\\", which is unwanted. The char `@' should not have escape
syntax in latex-mode buffer.
The item 7 is what I tried to point out in the paragraph
>> In addition, the way the function TeX-search-syntax-table treats the
>> variable TeX-search-syntax-table does not seem good to me. The function
>> directly modifies the syntax table stored in the variable, so the
>> modified table is shared between all the buffers. For examle, the char
>> `@' is given escape syntax in texinfo-mode buffer, which should be
>> avoided in latex-mode buffer.
In other words, the function TeX-search-syntax-table should initialize
the variable every time if a single syntax table is to be shared between
all the buffers of dirrerent modes.
Regards,
----
Ikumi Keita