all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Cc: kasahara@nc.kyushu-u.ac.jp, emacs-devel@gnu.org
Subject: Re: set-fontset-font and preferred charset?
Date: Wed, 08 Jul 2009 20:29:38 +0900	[thread overview]
Message-ID: <tl78wizh0pp.fsf@m17n.org> (raw)
In-Reply-To: <wlocrvtva5.wl%mituharu@math.s.chiba-u.ac.jp> (message from YAMAMOTO Mitsuharu on Wed, 08 Jul 2009 17:48:34 +0900)

In article <wlocrvtva5.wl%mituharu@math.s.chiba-u.ac.jp>, YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:

>>>>>> On Wed, 08 Jul 2009 17:09:35 +0900, YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> said:
>>>>>> On Wed, 08 Jul 2009 16:44:50 +0900, Kenichi Handa <handa@m17n.org> said:
>>>> 3. When I open "HELLO" file, some (not all) Japanese characters in
>>>> other buffers start to be rendered using xft backend.  When I open
>>>> another X frame, the font suddenly change to X font (both old and
>>>> new frames).

>>> There was a silly bug in handling a preferred charset in
>>> fontset_find_font.  I've installed a fix for the trunk.

> > Could you try compiling it with -DENABLE_CHECKING?  I got

> > .../src/fontset.c:618: Emacs fatal error: assertion failed:
> > VECTORLIKEP((rfont_def))

> > with the current trunk code when I tried C-h h.  It doesn't happen
> > with the EMACS_23_1_RC branch.

I can't reproduce that bug but perhaps that is because we
have different font setting.

> When the assertion failure happened, found_index == -1,
> charset_matched == -1, and i == 0.  The negative found_index is
> problematic because it is used as an index for AREF.

I think I found what is wrong.  Could you please try this
patch?

---
Kenichi Handa
handa@m17n.org


--- fontset.c.~1.177.~	2009-07-07 20:27:15.000000000 +0900
+++ fontset.c	2009-07-08 20:26:45.000000000 +0900
@@ -575,25 +575,25 @@
       Lisp_Object font_def;
       Lisp_Object font_entity, font_object;
 
+      found_index = i;
       if (i == 0)
 	{
-	  /* Try the element matching with the charset ID at first.  */
-	  found_index = charset_matched;
 	  if (charset_matched > 0)
 	    {
+	      /* Try the element matching with the charset ID at first.  */
+	      found_index = charset_matched;
+	      /* Make this negative so that we don't come here in the
+		 next loop.  */
 	      charset_matched = - charset_matched;
+	      /* We must try the first element in the next loop.  */
 	      i--;
 	    }
 	}
-      else if (i != - charset_matched)
-	{
-	  found_index = i;
-	}
-      else
+      else if (i == - charset_matched)
 	{
 	  /* We have already tried this element and the followings
-	     that have the same font specifications.  So, skip them
-	     all.  */
+	     that have the same font specifications in the first
+	     iteration.  So, skip them all.  */
 	  rfont_def = AREF (vec, i);
 	  font_def = RFONT_DEF_FONT_DEF (rfont_def);
 	  for (; i + 1 < ASIZE (vec); i++)
@@ -610,7 +610,7 @@
       rfont_def = AREF (vec, found_index);
       if (NILP (rfont_def))
 	{
-	  if (charset_matched < 0)
+	  if (i < 0)
 	    continue;
 	  /* This is a sign of not to try the other fonts.  */
 	  return Qt;




  reply	other threads:[~2009-07-08 11:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-03  5:15 set-fontset-font and preferred charset? Yoshiaki Kasahara
2009-07-03  5:53 ` Kenichi Handa
2009-07-03  6:24   ` Werner LEMBERG
2009-07-03  7:21     ` Kenichi Handa
2009-07-03  8:09       ` YAMAMOTO Mitsuharu
2009-07-06 12:17         ` Kenichi Handa
2009-07-03  9:05       ` Yoshiaki Kasahara
2009-07-08  7:44         ` Kenichi Handa
2009-07-08  8:09           ` YAMAMOTO Mitsuharu
2009-07-08  8:48             ` YAMAMOTO Mitsuharu
2009-07-08 11:29               ` Kenichi Handa [this message]
2009-07-09  0:00                 ` YAMAMOTO Mitsuharu
2009-07-09  1:06                   ` Kenichi Handa
2009-07-08  8:13           ` Yoshiaki Kasahara
2009-07-09  1:21             ` Kenichi Handa
2009-07-09  2:40               ` Yoshiaki Kasahara
2009-07-09  3:55                 ` Kenichi Handa
2009-07-09  4:32                   ` Yoshiaki Kasahara
2009-07-09  4:50                     ` Kenichi Handa
2009-07-09  5:06                       ` Yoshiaki Kasahara
2009-07-09 12:00                         ` Kenichi Handa
2009-07-10  2:52                           ` Yoshiaki Kasahara
2009-07-10  4:05                             ` Kenichi Handa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tl78wizh0pp.fsf@m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    --cc=kasahara@nc.kyushu-u.ac.jp \
    --cc=mituharu@math.s.chiba-u.ac.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.