From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Newsgroups: gmane.emacs.bugs Subject: bug#11541: Possible fix Date: Thu, 8 Nov 2012 20:53:32 +0100 Message-ID: References: <4fbb6a82.d491cc0a.42d6.3965@mx.google.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1352404446 22357 80.91.229.3 (8 Nov 2012 19:54:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 Nov 2012 19:54:06 +0000 (UTC) Cc: "11541-done@debbugs.gnu.org" <11541-done@debbugs.gnu.org> To: Thomas Kappler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 08 20:54:16 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 1TWYB4-0005zH-9E for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Nov 2012 20:54:14 +0100 Original-Received: from localhost ([::1]:48523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWYAv-0000Nb-7X for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Nov 2012 14:54:05 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWYAr-0000NO-1l for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2012 14:54:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TWYAp-0000lF-L2 for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2012 14:54:00 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TWYAp-0000l6-HV for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2012 14:53:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TWYAs-0007xU-BO for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2012 14:54:02 -0500 Resent-From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Nov 2012 19:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 11541 X-GNU-PR-Package: emacs,ns X-GNU-PR-Keywords: Mail-Followup-To: 11541@debbugs.gnu.org, jan.h.d@swipnet.se, florian.ebeling@gmail.com Original-Received: via spool by 11541-done@debbugs.gnu.org id=D11541.135240441930555 (code D ref 11541); Thu, 08 Nov 2012 19:54:02 +0000 Original-Received: (at 11541-done) by debbugs.gnu.org; 8 Nov 2012 19:53:39 +0000 Original-Received: from localhost ([127.0.0.1]:56504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TWYAU-0007wl-1N for submit@debbugs.gnu.org; Thu, 08 Nov 2012 14:53:38 -0500 Original-Received: from mailout.melmac.se ([62.20.26.67]:44938) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TWYAR-0007wd-KX for 11541-done@debbugs.gnu.org; Thu, 08 Nov 2012 14:53:36 -0500 Original-Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.melmac.se (Postfix) with ESMTP id 81FE39077 for <11541-done@debbugs.gnu.org>; Thu, 8 Nov 2012 20:53:31 +0100 (CET) Original-Received: (qmail 1224 invoked by uid 89); 8 Nov 2012 19:53:31 -0000 Original-Received: from h-46-59-42-18.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.18) by mail01.melmac.se with ESMTPA; 8 Nov 2012 19:53:31 -0000 Original-Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id DE6B57FA05E; Thu, 8 Nov 2012 20:53:30 +0100 (CET) In-Reply-To: X-Mailer: Apple Mail (2.1499) 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:66652 Archived-At: Hello. If it works, that is good. I installed it in the trunk. Thanks, Jan D. 6 nov 2012 kl. 12:01 skrev Thomas Kappler : > I investigated this a bit further and have a patch that fixes the = right-arrow test file for me, I can open it and the arrow displays = without problems. >=20 > Note that this is my very first foray into the Emacs source as well as = into Objective-C. >=20 > The problem is that ns_findfonts is being passed an empty font_spec. = (Why, I have no idea.) This crashes "[fdesc = matchingFontDescriptorsWithMandatoryKeys: fkeys]". The fix is to check = for this case and, if there are no keys in the font_spec, simply = initialize matchingDescs to an empty array. >=20 > Cheers, > Thomas >=20 >=20 > $ bzr diff >=20 > =3D=3D=3D modified file 'src/nsfont.m' > --- src/nsfont.m 2012-10-21 18:48:11 +0000 > +++ src/nsfont.m 2012-11-06 10:55:25 +0000 > @@ -43,7 +43,7 @@ > #import > #endif > =20 > -#define NSFONT_TRACE 0 > +#define NSFONT_TRACE 1 > =20 > extern Lisp_Object Qns; > extern Lisp_Object Qnormal, Qbold, Qitalic, Qcondensed, Qexpanded; > @@ -556,10 +556,17 @@ > =20 > fdesc =3D ns_spec_to_descriptor (font_spec); > fkeys =3D [NSMutableSet setWithArray: [[fdesc fontAttributes] = allKeys]]; > + if (NSFONT_TRACE) > + NSLog(@"Got %d fkeys: %@ ", [fkeys count], fkeys); > + =20 > if (isMatch) > [fkeys removeObject: NSFontFamilyAttribute]; > =20 > - matchingDescs =3D [fdesc = matchingFontDescriptorsWithMandatoryKeys: fkeys]; > + if ([fkeys count] > 0) { > + matchingDescs =3D [fdesc = matchingFontDescriptorsWithMandatoryKeys: fkeys]; > + } else { > + matchingDescs =3D [NSMutableArray array]; > + } > if (NSFONT_TRACE) > NSLog(@"Got desc %@ and found %d matching fonts from it: ", = fdesc, > [matchingDescs count]); >=20