aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2006-12-07 00:45:18 +0000
committerKenichi Handa2006-12-07 00:45:18 +0000
commit2f80c0a2194c6cd319a9af99789146a9d49beaad (patch)
treeec5a21d02a72a667a324dc6c679ada66a7833e39 /src
parent1bd45ea15d11e529231ea3777272148cde581c4c (diff)
downloademacs-2f80c0a2194c6cd319a9af99789146a9d49beaad.tar.gz
emacs-2f80c0a2194c6cd319a9af99789146a9d49beaad.zip
(Finternal_char_font): Fix for the case of POSITION
being nil.
Diffstat (limited to 'src')
-rw-r--r--src/fontset.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/fontset.c b/src/fontset.c
index b34b7a31faa..614d271e9e1 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -2031,7 +2031,7 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
2031 struct frame *f; 2031 struct frame *f;
2032 struct face *face; 2032 struct face *face;
2033 Lisp_Object charset, rfont_def; 2033 Lisp_Object charset, rfont_def;
2034 int id; 2034 int charset_id;
2035 2035
2036 if (NILP (position)) 2036 if (NILP (position))
2037 { 2037 {
@@ -2040,10 +2040,11 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
2040 f = XFRAME (selected_frame); 2040 f = XFRAME (selected_frame);
2041 face_id = DEFAULT_FACE_ID; 2041 face_id = DEFAULT_FACE_ID;
2042 pos = -1; 2042 pos = -1;
2043 charset_id = -1;
2043 } 2044 }
2044 else 2045 else
2045 { 2046 {
2046 Lisp_Object window; 2047 Lisp_Object window, charset;
2047 struct window *w; 2048 struct window *w;
2048 2049
2049 CHECK_NUMBER_COERCE_MARKER (position); 2050 CHECK_NUMBER_COERCE_MARKER (position);
@@ -2064,20 +2065,21 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
2064 w = XWINDOW (window); 2065 w = XWINDOW (window);
2065 f = XFRAME (w->frame); 2066 f = XFRAME (w->frame);
2066 face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0); 2067 face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0);
2068 charset = Fget_char_property (position, Qcharset, Qnil);
2069 if (CHARSETP (charset))
2070 charset_id = XINT (CHARSET_SYMBOL_ID (charset));
2071 else
2072 charset_id = -1;
2067 } 2073 }
2068 if (! CHAR_VALID_P (c, 0)) 2074 if (! CHAR_VALID_P (c, 0))
2069 return Qnil; 2075 return Qnil;
2070 face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil); 2076 face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil);
2071 face = FACE_FROM_ID (f, face_id); 2077 face = FACE_FROM_ID (f, face_id);
2072 charset = Fget_char_property (position, Qcharset, Qnil); 2078 rfont_def = fontset_font (FONTSET_FROM_ID (face->fontset), c, face,
2073 if (CHARSETP (charset)) 2079 charset_id);
2074 id = XINT (CHARSET_SYMBOL_ID (charset));
2075 else
2076 id = -1;
2077#ifdef USE_FONT_BACKEND 2080#ifdef USE_FONT_BACKEND
2078 if (enable_font_backend) 2081 if (enable_font_backend)
2079 { 2082 {
2080 rfont_def = fontset_font (FONTSET_FROM_ID (face->fontset), c, face, id);
2081 if (VECTORP (rfont_def) && ! NILP (AREF (rfont_def, 4))) 2083 if (VECTORP (rfont_def) && ! NILP (AREF (rfont_def, 4)))
2082 { 2084 {
2083 Lisp_Object font_object = AREF (rfont_def, 4); 2085 Lisp_Object font_object = AREF (rfont_def, 4);
@@ -2095,7 +2097,6 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
2095 return Qnil; 2097 return Qnil;
2096 } 2098 }
2097#endif /* USE_FONT_BACKEND */ 2099#endif /* USE_FONT_BACKEND */
2098 rfont_def = fontset_font (FONTSET_FROM_ID (face->fontset), c, face, id);
2099 if (VECTORP (rfont_def) && STRINGP (AREF (rfont_def, 3))) 2100 if (VECTORP (rfont_def) && STRINGP (AREF (rfont_def, 3)))
2100 { 2101 {
2101 Lisp_Object font_def; 2102 Lisp_Object font_def;