From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Ehud Karni" Newsgroups: gmane.emacs.devel Subject: Change of octal prefix character crashes Emacs Date: Tue, 22 Feb 2005 00:49:30 +0200 Organization: Mivtach-Simon Insurance agencies Message-ID: <200502212249.j1LMnUQ7021852@beta.mvs.co.il> Reply-To: ehud@unix.mvs.co.il NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-8-i Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1109027090 13594 80.91.229.2 (21 Feb 2005 23:04:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 21 Feb 2005 23:04:50 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 22 00:04:49 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D3MbR-000260-8j for ged-emacs-devel@m.gmane.org; Tue, 22 Feb 2005 00:04:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D3MsT-0005I5-AE for ged-emacs-devel@m.gmane.org; Mon, 21 Feb 2005 18:22:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D3Mqu-0004nV-Lp for emacs-devel@gnu.org; Mon, 21 Feb 2005 18:20:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D3Mqe-0004hr-9i for emacs-devel@gnu.org; Mon, 21 Feb 2005 18:20:24 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D3Mqd-0004d7-CU for emacs-devel@gnu.org; Mon, 21 Feb 2005 18:20:15 -0500 Original-Received: from [193.16.147.12] (helo=unix.mvs.co.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D3MMt-0008B1-JK for emacs-devel@gnu.org; Mon, 21 Feb 2005 17:49:32 -0500 Original-Received: from beta.mvs.co.il (beta [10.253.0.3]) by unix.mvs.co.il (8.13.0/8.13.0) with ESMTP id j1LMnUTq018962 for ; Tue, 22 Feb 2005 00:49:30 +0200 Original-Received: from beta.mvs.co.il (localhost [127.0.0.1]) by beta.mvs.co.il (8.12.10/8.12.10) with ESMTP id j1LMnUrU021855 for ; Tue, 22 Feb 2005 00:49:30 +0200 Original-Received: (from root@localhost) by beta.mvs.co.il (8.12.10/8.12.10/Submit) id j1LMnUQ7021852; Tue, 22 Feb 2005 00:49:30 +0200 Original-To: emacs-devel@gnu.org X-Mailer: Emacs 21.3.1 rmail (send-msg 1.108) 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:33691 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:33691 Changing the octal prefix character by setting slot 2 of the `standard-display-table' cause Emacs to crash when trying to display a character that should be displayed in octal. How to crash Emacs: 1. Add octal displayed characters, e.g. \221 \222 \223 2. Eval the following 2 lines: (setq standard-display-table (make-display-table)) (set-display-table-slot standard-display-table 2 ?!) 3. If Emacs has not crashed yet, refresh the view by ^L. The patch below fix this bug. Ehud. --- xdisp.c.~1.983.~ 2005-02-21 11:21:45.000000000 +0200 +++ xdisp.c 2005-02-22 00:45:41.000000000 +0200 @@ -5084,11 +5084,12 @@ display. Then, set IT->dpvec to these glyphs. */ GLYPH g; int ctl_len; - int face_id, lface_id; + int face_id, lface_id = 0 ; GLYPH escape_glyph; if (it->c < 128 && it->ctl_arrow_p) { + g = '^'; /* default glyph for Control */ /* Set IT->ctl_chars[0] to the glyph for `^'. */ if (it->dp && INTEGERP (DISP_CTRL_GLYPH (it->dp)) @@ -5096,19 +5097,18 @@ { g = XINT (DISP_CTRL_GLYPH (it->dp)); lface_id = FAST_GLYPH_FACE (g); - if (lface_id) - { - g = FAST_GLYPH_CHAR (g); - face_id = merge_faces (it->f, Qt, lface_id, - it->face_id); - } + } + if (lface_id) + { + g = FAST_GLYPH_CHAR (g); + face_id = merge_faces (it->f, Qt, lface_id, + it->face_id); } else { /* Merge the escape-glyph face into the current face. */ face_id = merge_faces (it->f, Qescape_glyph, 0, it->face_id); - g = '^'; } XSETINT (it->ctl_chars[0], g); @@ -5118,25 +5118,25 @@ goto display_control; } + escape_glyph = '\\'; /* default for Octal display */ if (it->dp && INTEGERP (DISP_ESCAPE_GLYPH (it->dp)) && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp)))) { escape_glyph = XFASTINT (DISP_ESCAPE_GLYPH (it->dp)); lface_id = FAST_GLYPH_FACE (escape_glyph); - if (lface_id) - { - escape_glyph = FAST_GLYPH_CHAR (escape_glyph); - face_id = merge_faces (it->f, Qt, lface_id, - it->face_id); - } + } + if (lface_id) + { + escape_glyph = FAST_GLYPH_CHAR (escape_glyph); + face_id = merge_faces (it->f, Qt, lface_id, + it->face_id); } else { /* Merge the escape-glyph face into the current face. */ face_id = merge_faces (it->f, Qescape_glyph, 0, it->face_id); - escape_glyph = '\\'; } if (it->c == 0x8a0 || it->c == 0x8ad) -- Ehud Karni Tel: +972-3-7966-561 /"\ Mivtach - Simon Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign Insurance agencies (USA) voice mail and X Against HTML Mail http://www.mvs.co.il FAX: 1-815-5509341 / \ GnuPG: 98EA398D Better Safe Than Sorry