From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: `set-fontset-font' and ascii characters Date: Mon, 5 May 2003 17:33:37 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200305050833.RAA20149@etlken.m17n.org> References: <87he8kutns.fsf@ID-87814.user.dfncis.de> <200305010810.RAA15007@etlken.m17n.org> <87u1cezhlu.fsf@ID-87814.user.dfncis.de> <200305012353.IAA15973@etlken.m17n.org> <200305020105.KAA16075@etlken.m17n.org> <87isstx7le.fsf@ID-87814.user.dfncis.de> <200305030248.LAA17558@etlken.m17n.org> <87bryj8y94.fsf@ID-87814.user.dfncis.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1052124092 16906 80.91.224.249 (5 May 2003 08:41:32 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 5 May 2003 08:41:32 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon May 05 10:41:23 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19CbTb-0004BG-00 for ; Mon, 05 May 2003 10:37:35 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19CbWW-0006fx-00 for ; Mon, 05 May 2003 10:40:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19CbSG-0003md-00 for emacs-devel@quimby.gnus.org; Mon, 05 May 2003 04:36:12 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19CbQO-0002yR-00 for emacs-devel@gnu.org; Mon, 05 May 2003 04:34:16 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19CbQ1-0002Ki-00 for emacs-devel@gnu.org; Mon, 05 May 2003 04:33:55 -0400 Original-Received: from tsukuba.m17n.org ([192.47.44.130]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19CbPx-00023c-00 for emacs-devel@gnu.org; Mon, 05 May 2003 04:33:50 -0400 Original-Received: from fs.m17n.org (fs.m17n.org [192.47.44.2])h458Xco06110; Mon, 5 May 2003 17:33:38 +0900 (JST) (envelope-from handa@m17n.org) Original-Received: from etlken.m17n.org (etlken.m17n.org [192.47.44.125]) h458XbA24930; Mon, 5 May 2003 17:33:37 +0900 (JST) Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id RAA20149; Mon, 5 May 2003 17:33:37 +0900 (JST) Original-To: alkibiades@gmx.de In-reply-to: <87bryj8y94.fsf@ID-87814.user.dfncis.de> (message from Oliver Scholz on Sun, 04 May 2003 00:24:23 +0200) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.2.92 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13684 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13684 In article <87bryj8y94.fsf@ID-87814.user.dfncis.de>, Oliver Scholz writes: > I found a bug. Emacs crashes, if you evaluated the following code with > my patch applied: > (progn > (set-face-font 'default "fontset-default") > (set-fontset-font "fontset-default" > 'ascii > '("helvetica" . "iso8859-1"))) > The critical fault seems to take place in `set_lface_from_font_name' > in xfaces.c (called from `Finternal_set_lisp_face_attribute'): > if (fontset >= 0) > font_name = SDATA (fontset_ascii (fontset)); Oops. Currently, a fontset should have a font name (i.e. string, not cons of (FAMILY . REGISTRY)) for ascii. So, if (FAMILY . REGISTRY) is specified, it mast be transformed to "-FAMILY-*-REGISTRY". If FAMILY doesn't contain '-', "*-" must be prepended to FAMILY in advance. If REGISTRY doesn't contain '-', "-*" must be appended to REGISTRY in advance. One more thing to note. Currently all ascii characters should have the same font in a fontset. So, for instance, (set-fontset-font FONTSET '(?a . ?z) FONT_NAME) must be inhibited or treated as (set-fontset-font FONTSET 'ascii FONT_NAME). These are the dirty parts originating in a bad interaction between face and fontset. Clearing them out is in my todo list for a long time, but I've never had time to work on it. --- Ken'ichi HANDA handa@m17n.org