From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: Integer & glyph (trunk and emacs_unicode) Date: Thu, 15 Nov 2007 19:39:55 -0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1195184498 4754 80.91.229.12 (16 Nov 2007 03:41:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Nov 2007 03:41:38 +0000 (UTC) Cc: "GNU Emacs \(devel\)" To: "Stefan Monnier" , "Vinicius Jose Latorre" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 16 04:41:41 2007 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 1Iss5K-0002lv-Tz for ged-emacs-devel@m.gmane.org; Fri, 16 Nov 2007 04:41:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iss57-0000Aa-Vh for ged-emacs-devel@m.gmane.org; Thu, 15 Nov 2007 22:41:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iss54-00006l-7X for emacs-devel@gnu.org; Thu, 15 Nov 2007 22:41:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iss52-000054-Oa for emacs-devel@gnu.org; Thu, 15 Nov 2007 22:41:21 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iss52-000051-KJ for emacs-devel@gnu.org; Thu, 15 Nov 2007 22:41:20 -0500 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Iss52-0002mf-67 for emacs-devel@gnu.org; Thu, 15 Nov 2007 22:41:20 -0500 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id lAG3fADh029118; Thu, 15 Nov 2007 20:41:10 -0700 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id lAG3f9ve014269; Thu, 15 Nov 2007 20:41:09 -0700 Original-Received: from dhcp-amer-csvpn-gw2-141-144-72-73.vpn.oracle.com by acsmt350.oracle.com with ESMTP id 3369196511195184378; Thu, 15 Nov 2007 19:39:38 -0800 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-reply-to: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:83306 Archived-At: > > (defun make-glyph-code (char &optional face) > > "Return a glyph code representing char CHAR with face FACE." > > ;; Due to limitations on Emacs integer values, faces with > > ;; face id greater that 4091 are silently ignored. > > (if (and face (<= (face-id face) #xfff)) > > (logior char (lsh (face-id face) 19)) > > char)) > > > So, it assumes 12 bits for face id and 19 bits for char code, > > the result is an integer of 31 bits. > > I suspect that the "19" used to be something else (e.g. 16 when > integers were 28bits, so 16+12=28). > > In any case, the test should be made more robust by not assuming > anything about the available range of integers (which has changed over > the years and can change depending on your config). > How 'bout > > (let ((id (and face (face-id face))) > (if (and (numberp id) > ;; Due to limitations on Emacs integer values, only > ;; face ids below a certain limit can be used. > (= id (lsh (lsh id 19) -19))) > (logior char (lsh id 19)) > char)) I'm not really following this, but is this about the change from `19' to `22' in this code (this is my own version, to accommodate both the old and new)? (defun make-glyph-code (char &optional face) "Return a glyph code representing char CHAR with face FACE." (if face (logior char (lsh (face-id face) (if (<= emacs-major-version 22) 19 22))) char)) That is, is this related to thread "bug of display-table & make-glyph-code, 2007-09-10?