auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Problem with quotation marks


From: Ralf Angeli
Subject: Re: [AUCTeX] Problem with quotation marks
Date: Thu, 30 Jun 2005 13:42:41 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

* José Carlos Santos (2005-06-30) writes:

> Ok. I've tried to do it, but I found out that the default value is
> "french" anyway, which is what I need.

Okay, so I was on the wrong track.

> When I see it, the syntax highlighting if the correct one. But if I
> replace the line
>
> "<Something">. $a^\pi$
>
> by
>
> «Something». $a^\pi$
>
> I have again the problems described at my original post. Furthermore, as
> I said in my original post, I *do not* have these problems when I use
> Emacs without auctex. Therefore, this really looks like an auctex bug.

I think I tracked it down to problems with file encoding or the coding
system in general.  I am not an expert here and maybe somebody can
correct me if I am babbling nonsense.

I suspect you are inserting Unicode characters into a buffer with a
Latin1 encoding.  At least that's what I get when copying guillemets
from Windows' character table to Emacs.  When typing `C-u C-x =' on
such an opening guillemet I get the following result:

,----
|   character: « (0253, 171, 0xab)
|     charset: eight-bit-graphic (8-bit graphic char (0xA0..0xFF))
|  code point: 171
|      syntax:          which means: whitespace
| buffer code: 0xAB
|   file code: 0xAB (encoded by coding system raw-text-dos)
|     display: by display table entry [?«] (see below)
| 
| The display table entry is displayed by these fonts (glyph codes):
| «: -raster-Courier-normal-r-normal-normal-20-120-120-120-c-120-iso8859-1 
(0xAB)
|  
| There are text properties here:
|   fontified            t
`----

Now if I add a `%%% coding: utf-8' to the local variables, save the
file, and open it again, I can see control codes like \253 instead of
the guillemets.  (Don't try this yourself unless you know what you are
doing. ) Such a control code is actually used for comparison when
trying to pick a matching closing guillemet for the opening one.  And
that's why the comparison fails.

In contrast, if I insert guillemets in a file with UTF-8 encoding and
type `C-u C-x =' on the opening guillemet, I get this:

,----
|   character: « (04253, 2219, 0x8ab, U+00AB)
|     charset: latin-iso8859-1
|            (Right-Hand Part of Latin Alphabet 1 (ISO/IEC 8859-1): ISO-IR-100.)
|  code point: 43
|      syntax: .        which means: punctuation
|    category: l:Latin  
| buffer code: 0x81 0xAB
|   file code: 0xC2 0xAB (encoded by coding system mule-utf-8-dos)
|     display: by this font (glyph code)
|      -raster-Courier-normal-r-normal-normal-20-120-120-120-c-120-iso8859-1 
(0xAB)
| 
| There are text properties here:
|   face                 [font-latex-string-face]
|   fontified            t
`----

In this case there is no problem with fontification of quotation
marks.

As far as I understand it would be advisable to set the coding system
to UTF-8 if you insert Unicode characters.  But as I wrote before, I
am not an expert here and am a bit at loss if this is a problem of
Emacs not choosing the correct coding system itself and if there might
be a way for AUCTeX to normalize strings before comparing them.  Any
hints greatly appreciated.

-- 
Ralf




reply via email to

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