From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.bugs Subject: bug#12823: Invalid font name Date: Fri, 09 Nov 2012 23:07:44 +0900 Message-ID: <87ip9euaxb.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1352470210 21317 80.91.229.3 (9 Nov 2012 14:10:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 9 Nov 2012 14:10:10 +0000 (UTC) Cc: 12823@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 09 15:10:18 2012 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 1TWpHj-0000Ex-Ju for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Nov 2012 15:10:15 +0100 Original-Received: from localhost ([::1]:44384 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWpHZ-0000Cu-PY for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Nov 2012 09:10:05 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWpHS-000085-GL for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2012 09:10:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TWpHO-0007fW-F7 for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2012 09:09:58 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47075) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWpHO-0007fS-Bj for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2012 09:09:54 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TWpHV-0001He-J7 for bug-gnu-emacs@gnu.org; Fri, 09 Nov 2012 09:10:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kenichi Handa Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Nov 2012 14:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12823 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12823-submit@debbugs.gnu.org id=B12823.13524701904913 (code B ref 12823); Fri, 09 Nov 2012 14:10:01 +0000 Original-Received: (at 12823) by debbugs.gnu.org; 9 Nov 2012 14:09:50 +0000 Original-Received: from localhost ([127.0.0.1]:57326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TWpHJ-0001HC-Rk for submit@debbugs.gnu.org; Fri, 09 Nov 2012 09:09:50 -0500 Original-Received: from fencepost.gnu.org ([208.118.235.10]:56147) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TWpHH-0001H5-Va for 12823@debbugs.gnu.org; Fri, 09 Nov 2012 09:09:48 -0500 Original-Received: from 253.240.accsnet.ne.jp ([202.220.240.253]:62371 helo=mongkok) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TWpH9-00075H-FW; Fri, 09 Nov 2012 09:09:40 -0500 In-Reply-To: (message from Stefan Monnier on Wed, 07 Nov 2012 10:15:10 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:66684 Archived-At: In article , Stefan Monnier writes: > Now, this invalid name was built by Emacs, probably in > font_unparse_xlfd. The appended patch fixes my problem. > So now the question is: should we reorder all the entries in the > width_table, slant_table, and weight_table so that the first entry of > every line is a non-dashed name? Or could this have undesirable effects? Yes. The first elements in those table should match the face attribute values for :weight, :width, and :slant (see set-face-attribute). I should have wrote that in the comment. Could you please try this patch instead? --- Kenichi Handa handa@gnu.org === modified file 'src/font.c' --- src/font.c 2012-11-03 05:11:34 +0000 +++ src/font.c 2012-11-09 14:05:15 +0000 @@ -1234,8 +1234,19 @@ f[j] = "*"; else { + int c, k, l; + val = SYMBOL_NAME (val); - f[j] = SSDATA (val); + len = SBYTES (val); + f[j] = alloca (len + 1); + /* Copy the name while excluding '-', '?', ',', and '"'. */ + for (k = l = 0; k < len; k++) + { + c = SREF (val, k); + if (c != '-' && c != '?' && c != ',' && c != '"') + f[l++] = c; + } + f[l] = '\0'; } }