GNU bug report logs - #1990
23.0.60; Emacs trying too hard to find fonts that don't exist

Previous Next

Package: emacs;

Reported by: Jason Rumney <jasonr <at> gnu.org>

Date: Thu, 22 Jan 2009 13:30:04 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #65 received at 1990 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Kenichi Handa <handa <at> m17n.org>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: jasonr <at> gnu.org, 1990 <at> debbugs.gnu.org
Subject: Re: 23.0.60; Emacs trying too hard to find fonts that don't exist
Date: Mon, 26 Jan 2009 17:00:09 +0900
In article <87d4ec1o6z.fsf <at> cyd.mit.edu>, Chong Yidong <cyd <at> stupidchicken.com> writes:

> Jason Rumney <jasonr <at> gnu.org> writes:
>>> However, there are several other places in that function that return
>>> with a Qnil, without doing this FONTSET_SET.  Do matters improve if
>>> we do the same FONTSET_SET call before returning?
> >
> > It doesn't seem to help much, if at all.

> How about something like this?  Does it improve performance noticeably?

> *** trunk/src/fontset.c.~1.150.~	2009-01-08 06:46:23.000000000 -0500
> --- trunk/src/fontset.c	2009-01-24 14:44:09.000000000 -0500
> ***************
> *** 660,665 ****
> --- 660,668 ----
>     Lisp_Object rfont_def;
>     Lisp_Object base_fontset;
  
> +   if (EQ (Fchar_table_range (fontset, make_number (c)), Qt))
> +     return Qnil;
> + 
>     /* Try a font-group of FONTSET. */
>     rfont_def = fontset_find_font (fontset, c, face, id, 0);
>     if (VECTORP (rfont_def))

I found a bug in fontset_find_font in handling non-cons
return value of fontset_get_font_group (it seems that I
embugged it when I modified fontset.c largely last time).

Your change surely fixes the bug, but it does unnecessary
char-table lookup for the normal case (i.e. a font is
found).  So, I think the following patch is better.

If you agree, please install it.  I, at the moment, can't do
cvs commit.

2009-01-26  Kenichi Handa  <handa <at> m17n.org>

	* fontset.c (fontset_find_font): Fix handling of non-cons return
	value of fontset_get_font_group.
	(fontset_font): Cancel previous change.

*** fontset.c.~1.151.~	2009-01-26 16:52:57.000000000 +0900
--- fontset.c	2009-01-26 16:53:14.000000000 +0900
***************
*** 521,527 ****
  
    font_group = fontset_get_font_group (fontset, fallback ? -1 : c);
    if (! CONSP (font_group))
!     return Qnil;
    vec = XCDR (font_group);
    if (ASIZE (vec) == 0)
      return Qnil;
--- 521,527 ----
  
    font_group = fontset_get_font_group (fontset, fallback ? -1 : c);
    if (! CONSP (font_group))
!     return font_group;
    vec = XCDR (font_group);
    if (ASIZE (vec) == 0)
      return Qnil;
***************
*** 660,669 ****
    Lisp_Object rfont_def;
    Lisp_Object base_fontset;
  
-   /* If we know there is no font of C, don't do any work.  */
-   if (EQ (fontset_ref (fontset, c), Qt))
-     return Qnil;
- 
    /* Try a font-group of FONTSET. */
    rfont_def = fontset_find_font (fontset, c, face, id, 0);
    if (VECTORP (rfont_def))
--- 660,665 ----
---
Kenichi Handa
handa <at> m17n.org




This bug report was last modified 16 years and 177 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.