[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Display of characters #xa0 and #xad in unibyte buffers
From: |
Stefan Monnier |
Subject: |
Re: Display of characters #xa0 and #xad in unibyte buffers |
Date: |
Fri, 25 Sep 2009 10:09:26 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
>> Is the following a feature or a bug?
>>
>> $ emacs -Q
>> M-x toggle-enable-multibyte-characters RET C-q 240 RET C-q 255 RET
>>
>> The characters are displayed as "_-" (approximately).
>>
>> Shouldn't they be displayed as "\240\255", considering that these are
>> raw bytes with no specific meaning?
> There are no ``raw bytes'' in a unibyte buffer. Every byte there is
> interpreted as a character, and shown as such.
No, this used to be the case, but not any more. This is nowadays only
done for the deprecated unibyte sessions (well, it's really controlled
by unibyte-display-via-language-environment IIUC).
It looks like a bug in the implementation of nobreak-char-display
(thanks Andreas).
The patch below should help.
Stefan
--- xdisp.c.~1.1301.~ 2009-09-20 13:01:24.000000000 -0400
+++ xdisp.c 2009-09-25 10:02:08.000000000 -0400
@@ -5794,7 +5794,8 @@
/* Handle non-break space in the mode where it only gets
highlighting. */
- if (EQ (Vnobreak_char_display, Qt)
+ if ((it->multibyte_p || unibyte_display_via_language_environment)
+ && EQ (Vnobreak_char_display, Qt)
&& it->c == 0xA0)
{
/* Merge the no-break-space face into the current face. */
@@ -5844,6 +5845,8 @@
/* Handle soft hyphens in the mode where they only get
highlighting. */
+ if (it->multibyte_p || unibyte_display_via_language_environment)
+ {
if (EQ (Vnobreak_char_display, Qt)
&& it->c == 0xAD)
{
@@ -5864,6 +5867,7 @@
ctl_len = 2;
goto display_control;
}
+ }
{
unsigned char str[MAX_MULTIBYTE_LENGTH];
- Re: Display of characters #xa0 and #xad in unibyte buffers, (continued)
- Re: Display of characters #xa0 and #xad in unibyte buffers, Eli Zaretskii, 2009/09/28
- Re: Display of characters #xa0 and #xad in unibyte buffers, Kenichi Handa, 2009/09/28
- Re: Display of characters #xa0 and #xad in unibyte buffers, Eli Zaretskii, 2009/09/28
- Re: Display of characters #xa0 and #xad in unibyte buffers, Stefan Monnier, 2009/09/28
- Re: Display of characters #xa0 and #xad in unibyte buffers, Kenichi Handa, 2009/09/28
- Re: Display of characters #xa0 and #xad in unibyte buffers, Stefan Monnier, 2009/09/28
- Re: Display of characters #xa0 and #xad in unibyte buffers, Kenichi Handa, 2009/09/28
- Re: Display of characters #xa0 and #xad in unibyte buffers, Stefan Monnier, 2009/09/28
- Re: Display of characters #xa0 and #xad in unibyte buffers, Kenichi Handa, 2009/09/29
Re: Display of characters #xa0 and #xad in unibyte buffers, Stephen J. Turnbull, 2009/09/25
Re: Display of characters #xa0 and #xad in unibyte buffers,
Stefan Monnier <=
Re: Display of characters #xa0 and #xad in unibyte buffers, Andreas Schwab, 2009/09/25