From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: Default face problem Date: Wed, 10 May 2006 13:17:56 +0900 Message-ID: References: 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: sea.gmane.org 1147234790 29394 80.91.229.2 (10 May 2006 04:19:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 May 2006 04:19:50 +0000 (UTC) Cc: wilde@sha-bang.de, jyavner@member.fsf.org, emacs-devel@gnu.org, rms@gnu.org, monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 10 06:19:46 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FdgAq-000500-UG for ged-emacs-devel@m.gmane.org; Wed, 10 May 2006 06:19:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FdgAq-00007R-ER for ged-emacs-devel@m.gmane.org; Wed, 10 May 2006 00:19:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FdgAe-000075-Vi for emacs-devel@gnu.org; Wed, 10 May 2006 00:19:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FdgAd-00006Y-8v for emacs-devel@gnu.org; Wed, 10 May 2006 00:19:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FdgAd-00006V-6j for emacs-devel@gnu.org; Wed, 10 May 2006 00:19:31 -0400 Original-Received: from [192.47.44.130] (helo=tsukuba.m17n.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FdgBo-0005xw-14; Wed, 10 May 2006 00:20:44 -0400 Original-Received: from nfs.m17n.org (nfs.m17n.org [192.47.44.7]) by tsukuba.m17n.org (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k4A4JCFT013220; Wed, 10 May 2006 13:19:12 +0900 Original-Received: from etlken (etlken.m17n.org [192.47.44.125]) by nfs.m17n.org (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k4A4J9mJ012176; Wed, 10 May 2006 13:19:10 +0900 Original-Received: from handa by etlken with local (Exim 3.36 #1 (Debian)) id 1Fdg96-0004PL-00; Wed, 10 May 2006 13:17:56 +0900 Original-To: storm@cua.dk (Kim F. Storm) In-reply-to: (storm@cua.dk) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) 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:54169 Archived-At: In article , storm@cua.dk (Kim F. Storm) writes: > Kenichi Handa writes: >> When a font-related attribute of the default face is >> changed, set_font_frame_param (xfaces.c) is called. So, >> perhaps calling it or simulating what it does is the right >> thing. > Well, the Fmodify_frame_parameters call in that function > will cause a call to x_set_font. > x_set_font calls recompute_basic_faces which calls > realize_basic_faces, which calls realize_default_face. Ummm. > To me, it sound like realize_default_face would be a good > place to fix this, but I'm not an expert on this. It seems that there's no expert other than Gerd. Anyway, I've just tried this patch along your idea. *** xfaces.c 13 Apr 2006 09:46:44 +0900 1.345 --- xfaces.c 10 May 2006 13:06:28 +0900 *************** *** 7072,7077 **** --- 7072,7087 ---- check_lface (lface); bcopy (XVECTOR (lface)->contents, attrs, sizeof attrs); face = realize_face (c, attrs, 0, NULL, DEFAULT_FACE_ID); + + #ifdef HAVE_WINDOW_SYSTEM + #ifdef HAVE_X_WINDOWS + if (face->font != FRAME_FONT (f)) + /* As the font specified for the frame was not acceptable as a + font for the default face (perhaps because auto-scaled fonts + are rejected), we must adjust the frame font. */ + x_set_font (f, build_string (face->font_name), Qnil); + #endif /* HAVE_X_WINDOWS */ + #endif /* HAVE_WINDOW_SYSTEM */ return 1; } It seems that it works well. I tried: % emacs -fn -*-terminus-medium-r-*-*-17-*-*-*-*-*-iso8859-1 and did M-x ses-mode. Column alignment seems to be correct now. But, I really don't know if it's ok to call recompute_basic_faces recursively. Could you also test and verify it? --- Kenichi Handa handa@m17n.org