From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Display of characters #xa0 and #xad in unibyte buffers Date: Fri, 25 Sep 2009 10:09:26 -0400 Message-ID: References: <19131.35568.835627.216245@a1i15.kph.uni-mainz.de> <833a6bv30o.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253887790 22686 80.91.229.12 (25 Sep 2009 14:09:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Sep 2009 14:09:50 +0000 (UTC) Cc: Ulrich Mueller , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 25 16:09:43 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MrBUU-0008Pl-AP for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2009 16:09:42 +0200 Original-Received: from localhost ([127.0.0.1]:40457 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrBUT-0004Gy-No for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2009 10:09:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MrBUN-0004Gt-W7 for emacs-devel@gnu.org; Fri, 25 Sep 2009 10:09:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MrBUJ-0004Ej-KA for emacs-devel@gnu.org; Fri, 25 Sep 2009 10:09:35 -0400 Original-Received: from [199.232.76.173] (port=59809 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrBUJ-0004Eg-Hi for emacs-devel@gnu.org; Fri, 25 Sep 2009 10:09:31 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:54447) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MrBUH-0005wt-9f; Fri, 25 Sep 2009 10:09:29 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MrBUG-0008Ui-Er; Fri, 25 Sep 2009 10:09:28 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap0FABhsvEpFpYq6/2dsb2JhbACBUdYAhB4Fh30 X-IronPort-AV: E=Sophos;i="4.44,451,1249272000"; d="scan'208";a="46594667" Original-Received: from 69-165-138-186.dsl.teksavvy.com (HELO pastel.home) ([69.165.138.186]) by ironport2-out.pppoe.ca with ESMTP; 25 Sep 2009 10:09:26 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id A7F1580B1; Fri, 25 Sep 2009 10:09:26 -0400 (EDT) In-Reply-To: <833a6bv30o.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 25 Sep 2009 11:31:51 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by mx20.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115612 Archived-At: >> 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];