all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Ulrich Mueller <ulm@gentoo.org>, emacs-devel@gnu.org
Subject: Re: Display of characters #xa0 and #xad in unibyte buffers
Date: Fri, 25 Sep 2009 10:09:26 -0400	[thread overview]
Message-ID: <jwv4oqri1f7.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <833a6bv30o.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 25 Sep 2009 11:31:51 +0300")

>> 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];




  parent reply	other threads:[~2009-09-25 14:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-24 15:06 Display of characters #xa0 and #xad in unibyte buffers Ulrich Mueller
2009-09-25  8:31 ` Eli Zaretskii
2009-09-25  9:00   ` Ulrich Mueller
2009-09-25  9:14     ` Eli Zaretskii
2009-09-28  1:10       ` Kenichi Handa
2009-09-28  6:43         ` Eli Zaretskii
2009-09-28 11:24           ` Kenichi Handa
2009-09-28 14:10             ` Eli Zaretskii
2009-09-28 22:38             ` Stefan Monnier
2009-09-29  1:05               ` Kenichi Handa
2009-09-29  1:35                 ` Stefan Monnier
2009-09-29  2:37                   ` Kenichi Handa
2009-09-29  3:15                     ` Stefan Monnier
2009-09-29  7:52                       ` Kenichi Handa
     [not found]                         ` <831vljpm0v.fsf@gnu.org>
2009-10-05  0:49                           ` Kenichi Handa
2009-09-25  9:38   ` Stephen J. Turnbull
2009-09-25 14:09   ` Stefan Monnier [this message]
2009-09-26  8:26     ` Ulrich Mueller
2009-09-25  9:44 ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv4oqri1f7.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=ulm@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.