From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: make-glyph-code incompatibility Date: Tue, 04 Mar 2008 01:08:22 +0100 Message-ID: <873ar773m1.fsf@kfs-lx.rd.rdm> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1204589346 14391 80.91.229.12 (4 Mar 2008 00:09:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Mar 2008 00:09:06 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 04 01:09:32 2008 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 1JWKil-0003gv-5u for ged-emacs-devel@m.gmane.org; Tue, 04 Mar 2008 01:09:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWKiB-00037f-U1 for ged-emacs-devel@m.gmane.org; Mon, 03 Mar 2008 19:08:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JWKi7-00033T-2z for emacs-devel@gnu.org; Mon, 03 Mar 2008 19:08:47 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JWKi0-0002ph-I1 for emacs-devel@gnu.org; Mon, 03 Mar 2008 19:08:46 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWKi0-0002pS-EV for emacs-devel@gnu.org; Mon, 03 Mar 2008 19:08:40 -0500 Original-Received: from mail-relay.sonofon.dk ([212.88.64.25]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JWKhz-0002YM-FU for emacs-devel@gnu.org; Mon, 03 Mar 2008 19:08:40 -0500 Original-Received: (qmail 36755 invoked from network); 4 Mar 2008 00:08:25 -0000 Original-Received: from unknown (HELO kfs-lx.rd.rdm.cua.dk) (213.83.150.21) by 0 with SMTP; 4 Mar 2008 00:08:25 -0000 In-Reply-To: (Stefan Monnier's message of "Mon\, 03 Mar 2008 16\:16\:45 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:91260 Archived-At: Stefan Monnier writes: > The new make-glyph-code is a good change, but it introduces > an incompatibility. It seems that it makes previously working code > fail silently. Can we make it fail with an informative message? The new encoding still merges a face id and char code into an integer if the face id is < 64. So an integer value may still carry a face id in the upper bits. Of course, I could make it always use a cons cell for non-default face. Then we could check (and warn) if an integer value is >= 1^22, but even if we do that, it can fail: For example, how do you differentiate 1 << 19 + ?a (emacs 22 glyph code for 'a' in mode-line face) and the unicode character with the same numeric value in emacs 23 ? Also, issuing warnings during redisplay is a mess! We introduced make-glyph-code in 22.1 in preparation for the unicode merge in 23.1 - to give people time to adjust their code. Perhaps emacs 23 NEWS file should repeat the description of make-glyph-code from NEWS.22 - this time saying it is the only way to do it: Maybe write something like (incompatible lisp changes): ** The functions `make-glyph-code', `glyph-char', and `glyph-face' must be used to create and decode glyph codes in display tables. The old method of creating a display table element by combining a face number and a character code into a numeric glyph code is no longer supported; using it may cause arbitrary characters and faces to be displayed. -- Kim F. Storm http://www.cua.dk