HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge from trunk.
[bpt/emacs.git]
/
src
/
fontset.c
diff --git
a/src/fontset.c
b/src/fontset.c
index
46637b5
..
74a25a1
100644
(file)
--- a/
src/fontset.c
+++ b/
src/fontset.c
@@
-447,7
+447,7
@@
reorder_font_vector (Lisp_Object font_group, struct font *font)
/* Return a font-group (actually a cons (-1 . FONT-GROUP-VECTOR)) for
character C in FONTSET. If C is -1, return a fallback font-group.
If C is not -1, the value may be Qt (FONTSET doesn't have a font
/* Return a font-group (actually a cons (-1 . FONT-GROUP-VECTOR)) for
character C in FONTSET. If C is -1, return a fallback font-group.
If C is not -1, the value may be Qt (FONTSET doesn't have a font
- for C even in the fallback group, or 0 (a font for C may be found
+ for C even in the fallback group
)
, or 0 (a font for C may be found
only in the fallback group). */
static Lisp_Object
only in the fallback group). */
static Lisp_Object
@@
-465,7
+465,9
@@
fontset_get_font_group (Lisp_Object fontset, int c)
if (! NILP (font_group))
return font_group;
base_fontset = FONTSET_BASE (fontset);
if (! NILP (font_group))
return font_group;
base_fontset = FONTSET_BASE (fontset);
- if (c >= 0)
+ if (NILP (base_fontset))
+ font_group = Qnil;
+ else if (c >= 0)
font_group = char_table_ref_and_range (base_fontset, c, &from, &to);
else
font_group = FONTSET_FALLBACK (base_fontset);
font_group = char_table_ref_and_range (base_fontset, c, &from, &to);
else
font_group = FONTSET_FALLBACK (base_fontset);
@@
-476,6
+478,8
@@
fontset_get_font_group (Lisp_Object fontset, int c)
char_table_set_range (fontset, from, to, font_group);
return font_group;
}
char_table_set_range (fontset, from, to, font_group);
return font_group;
}
+ if (!VECTORP (font_group))
+ return font_group;
font_group = Fcopy_sequence (font_group);
for (i = 0; i < ASIZE (font_group); i++)
if (! NILP (AREF (font_group, i)))
font_group = Fcopy_sequence (font_group);
for (i = 0; i < ASIZE (font_group); i++)
if (! NILP (AREF (font_group, i)))
@@
-1696,7
+1700,7
@@
FONT-SPEC is a vector, a cons, or a string. See the documentation of
static Lisp_Object auto_fontset_alist;
/* Number of automatically created fontsets. */
static Lisp_Object auto_fontset_alist;
/* Number of automatically created fontsets. */
-static
in
t num_auto_fontsets;
+static
printmax_
t num_auto_fontsets;
/* Retun a fontset synthesized from FONT-OBJECT. This is called from
x_new_font when FONT-OBJECT is used for the default ASCII font of a
/* Retun a fontset synthesized from FONT-OBJECT. This is called from
x_new_font when FONT-OBJECT is used for the default ASCII font of a
@@
-1723,9
+1727,9
@@
fontset_from_font (Lisp_Object font_object)
alias = intern ("fontset-startup");
else
{
alias = intern ("fontset-startup");
else
{
- char temp[
32
];
+ char temp[
sizeof "fontset-auto" + INT_STRLEN_BOUND (printmax_t)
];
- sprintf (temp, "fontset-auto%
d"
, num_auto_fontsets - 1);
+ sprintf (temp, "fontset-auto%
"pMd
, num_auto_fontsets - 1);
alias = intern (temp);
}
fontset_spec = copy_font_spec (font_spec);
alias = intern (temp);
}
fontset_spec = copy_font_spec (font_spec);
@@
-1851,7
+1855,7
@@
DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
face_id = face_at_buffer_position (w, pos, -1, -1, &dummy,
pos + 100, 0, -1);
}
face_id = face_at_buffer_position (w, pos, -1, -1, &dummy,
pos + 100, 0, -1);
}
- if (! CHAR_VALID_P (c
, 0
))
+ if (! CHAR_VALID_P (c))
return Qnil;
face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil);
face = FACE_FROM_ID (f, face_id);
return Qnil;
face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil);
face = FACE_FROM_ID (f, face_id);
@@
-1859,17
+1863,11
@@
DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
{
unsigned code = face->font->driver->encode_char (face->font, c);
Lisp_Object font_object;
{
unsigned code = face->font->driver->encode_char (face->font, c);
Lisp_Object font_object;
- /* Assignment to EMACS_INT stops GCC whining about limited range
- of data type. */
- EMACS_INT cod = code;
if (code == FONT_INVALID_CODE)
return Qnil;
XSETFONT (font_object, face->font);
if (code == FONT_INVALID_CODE)
return Qnil;
XSETFONT (font_object, face->font);
- if (cod <= MOST_POSITIVE_FIXNUM)
- return Fcons (font_object, make_number (code));
- return Fcons (font_object, Fcons (make_number (code >> 16),
- make_number (code & 0xFFFF)));
+ return Fcons (font_object, INTEGER_TO_CONS (code));
}
return Qnil;
}
}
return Qnil;
}
@@
-2106,6
+2104,8
@@
DEFUN ("fontset-list", Ffontset_list, Sfontset_list, 0, 0, 0,
#ifdef FONTSET_DEBUG
#ifdef FONTSET_DEBUG
+Lisp_Object dump_fontset (Lisp_Object) EXTERNALLY_VISIBLE;
+
Lisp_Object
dump_fontset (Lisp_Object fontset)
{
Lisp_Object
dump_fontset (Lisp_Object fontset)
{