From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#19117: 25.0.50; emacs on x11 chooses different fonts for the same face sometimes Date: Sat, 06 Dec 2014 23:28:34 -0800 Message-ID: <87a92zrj4b.fsf@secretsauce.net> References: <878uj674zh.fsf@secretsauce.net> <831tox7t03.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1417938864 24873 80.91.229.3 (7 Dec 2014 07:54:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Dec 2014 07:54:24 +0000 (UTC) To: 19117@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 07 08:54:18 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XxWfY-0006QA-6h for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Dec 2014 08:54:16 +0100 Original-Received: from localhost ([::1]:57257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxWfX-0004Cv-SR for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Dec 2014 02:54:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxWfQ-0004Cn-5c for bug-gnu-emacs@gnu.org; Sun, 07 Dec 2014 02:54:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XxWfL-0002hA-1N for bug-gnu-emacs@gnu.org; Sun, 07 Dec 2014 02:54:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxWfK-0002h4-QF for bug-gnu-emacs@gnu.org; Sun, 07 Dec 2014 02:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XxWfK-0003TD-Fs for bug-gnu-emacs@gnu.org; Sun, 07 Dec 2014 02:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Dec 2014 07:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19117 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19117-submit@debbugs.gnu.org id=B19117.141793880913297 (code B ref 19117); Sun, 07 Dec 2014 07:54:02 +0000 Original-Received: (at 19117) by debbugs.gnu.org; 7 Dec 2014 07:53:29 +0000 Original-Received: from localhost ([127.0.0.1]:55978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XxWen-0003SM-1n for submit@debbugs.gnu.org; Sun, 07 Dec 2014 02:53:29 -0500 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:43708) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XxWel-0003SC-1h for 19117@debbugs.gnu.org; Sun, 07 Dec 2014 02:53:28 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 9410820542 for <19117@debbugs.gnu.org>; Sun, 7 Dec 2014 02:53:26 -0500 (EST) Original-Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sun, 07 Dec 2014 02:53:26 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:references:from:to:subject:date:in-reply-to :message-id:mime-version:content-type; s=mesmtp; bh=BbnLWfM3cVm/ fuqH+fFbY+5OGBY=; b=i9oTwXMJTWkPJljHmJDmfVg/Lc1+/wCe3F9stihFWdij TpiwpdSY+j7lMo4Bo8H4GkoTfxNgqBzureJkIkeXQOz955FlBtWtzxYaI/l2ku51 ndKdbxUYd+rABWZKepIQJ8grNdvffz6iT0hHYlC00VczI1DWC5T30hz0KFr3BX4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:references:from:to:subject :date:in-reply-to:message-id:mime-version:content-type; s= smtpout; bh=BbnLWfM3cVm/fuqH+fFbY+5OGBY=; b=WkwJdjqxg3mNx44B4ANr OQvtuk45b0cJGDlgZnYKii1G8qCqTlNQaa4JH0ga3MYDcEB3HAfhb8PeF0aNZC62 YKZbDi24XnwIheFVzTcEjDsIP/tNVt0Ym+WlwuTOUvlxB/c3EVMns+r3vdTNqo0R qJXLEGmDyKARHMuEFKY1WKo= X-Sasl-enc: ZnlppGR8lgU8fzf+9HDYH9w8mz6jqshYU7yMqYvdJnFT 1417938806 Original-Received: from shorty.local (unknown [76.91.145.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 4EE9AC0027E for <19117@debbugs.gnu.org>; Sun, 7 Dec 2014 02:53:26 -0500 (EST) Original-Received: from dima by shorty.local with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1XxWei-0002hm-UP for 19117@debbugs.gnu.org; Sat, 06 Dec 2014 23:53:24 -0800 In-reply-to: <831tox7t03.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:96932 Archived-At: Eli Zaretskii writes: >> Starting a few months ago (this is a regression) I'm seeing that >> sometimes Emacs renders some faces with an unrequested (and ugly) font. > > "Sometimes"? Can it be that it happens when Emacs needs to display > some character not available in the "non-ugly" font? No, it's independent of displaying any particular characters, as far as I can tell. On my machine I can start emacs (with all my .emacs stuff sadly) and issue (face-font "italic") and it reports the wrong font. Moving windows around fixes it, and makes it report the correct font. >> I can usually make it do the right thing by moving Emacs windows around >> or resizing them, or maybe opening a new Emacs frame. > > ??? Incredible. You mean, you do all that magic, and the font used > for some text suddenly changes? Without killing the buffer with that > text? Not 100% sure. The exact sequence to make it recover eludes me, so I'm not sure if buffers need to be killed or refreshed in any way. Once it recovers, things look good and (face-font "italic") reports the right thing. >> Can somebody give me some pointers on how to debug this to make this bug >> report useful? I see the breakage many times a day every day. > > Put a breakpoint where Emacs loads new fonts, and see who calls that > code. I'm digging through the code. It's slow going so far, but I'm getting more familiar with it. In my init.el I have in my default-frame-alist (font . "-adobe-courier-medium-r-*-*-*-80-*-*-m-*-iso8859-1") I'm looking at realize_x_face() in xfaces.c. When I create a new frame by pressing C-x 5 2, all the faces get re-realized, and I can see which fonts are chosen. That function takes in a list of face attributes, and associates a font with each face. I'm looking at attrs[LFACE_FONT_INDEX] on input and face->font on output. For most faces, these two values are # "-adobe-courier-medium-r-normal--11-80-100-100-m-60-iso8859-1" which is correct: we're asking for a particular font and we're getting it. For many faces, however these values are # "-urw-nimbus mono l-regular-o-normal--11-79-100-100-p-70-iso8859-1" or # "-adobe-courier-medium-o-normal--11-80-100-100-m-60-iso8859-1" Here we're requesting a slanted version of the default font. Sometimes emacs picks the right one (-adobe-courier-medium-o-...), but at other times it picks the wrong one (-urw-....). The exact set of faces that get the wrong font varies with each invocation of realize_x_face(), but there's always at least one wrong one. That's the only conclusive evidence I have so far, but I'm still looking into it. Any suggestions welcome.