[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100161: Backport fix for Bug#6287
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100161: Backport fix for Bug#6287 from trunk. |
Date: |
Thu, 04 Nov 2010 15:47:27 -0400 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 100161 [merge]
author: Kenichi Handa <address@hidden>
committer: Chong Yidong <address@hidden>
branch nick: emacs-23
timestamp: Thu 2010-11-04 15:47:27 -0400
message:
Backport fix for Bug#6287 from trunk.
* font.c (font_delete_unmatched): Check Vface_ignored_fonts.
Don't sheck SPEC if it is nil.
(font_list_entities): Call font_delete_unmatched if
Vface_ignored_fonts is non-nil.
modified:
src/ChangeLog
src/font.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2010-11-04 19:39:47 +0000
+++ b/src/ChangeLog 2010-11-04 19:46:30 +0000
@@ -1,3 +1,10 @@
+2010-11-04 Kenichi Handa <address@hidden>
+
+ * font.c (font_delete_unmatched): Check Vface_ignored_fonts.
+ Don't sheck SPEC if it is nil.
+ (font_list_entities): Call font_delete_unmatched if
+ Vface_ignored_fonts is non-nil.
+
2010-11-04 YAMAMOTO Mitsuharu <address@hidden>
* dispextern.h (TRY_WINDOW_CHECK_MARGINS)
=== modified file 'src/font.c'
--- a/src/font.c 2010-10-13 14:07:28 +0000
+++ b/src/font.c 2010-11-04 19:46:30 +0000
@@ -2821,6 +2821,14 @@
static Lisp_Object scratch_font_spec, scratch_font_prefer;
+/* Check each font-entity in VEC, and return a list of font-entities
+ that satisfy this condition:
+ (1) matches with SPEC and SIZE if SPEC is not nil, and
+ (2) doesn't match with any regexps in Vface_ignored_fonts (if non-nil).
+*/
+
+extern Lisp_Object Vface_ignored_fonts;
+
Lisp_Object
font_delete_unmatched (vec, spec, size)
Lisp_Object vec, spec;
@@ -2833,6 +2841,29 @@
for (val = Qnil, i = ASIZE (vec) - 1; i >= 0; i--)
{
entity = AREF (vec, i);
+ if (! NILP (Vface_ignored_fonts))
+ {
+ char name[256];
+ Lisp_Object tail, regexp;
+
+ if (font_unparse_xlfd (entity, 0, name, 256) >= 0)
+ {
+ for (tail = Vface_ignored_fonts; CONSP (tail); tail = XCDR (tail))
+ {
+ regexp = XCAR (tail);
+ if (STRINGP (regexp)
+ && fast_c_string_match_ignore_case (regexp, name) >= 0)
+ break;
+ }
+ if (CONSP (tail))
+ continue;
+ }
+ }
+ if (NILP (spec))
+ {
+ val = Fcons (entity, val);
+ continue;
+ }
for (prop = FONT_WEIGHT_INDEX; prop < FONT_SIZE_INDEX; prop++)
if (INTEGERP (AREF (spec, prop))
&& ((XINT (AREF (spec, prop)) >> 8)
@@ -2932,8 +2963,10 @@
ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache)));
}
- if (ASIZE (val) > 0 && need_filtering)
- val = font_delete_unmatched (val, spec, size);
+ if (ASIZE (val) > 0
+ && (need_filtering
+ || ! NILP (Vface_ignored_fonts)))
+ val = font_delete_unmatched (val, need_filtering ? spec : Qnil, size);
if (ASIZE (val) > 0)
list = Fcons (val, list);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100161: Backport fix for Bug#6287 from trunk.,
Chong Yidong <=