summaryrefslogtreecommitdiff
path: root/src/font.c
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2013-02-13 11:14:38 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2013-02-13 11:14:38 +0400
commit5a655b9f0d19703aad9331378c02e9c782412386 (patch)
treea6ce6b855a4014cdedc903ee8c69d0b415fd9d3c /src/font.c
parenteeb468daa1a5c8b64b939c1b3c4144c21a38f281 (diff)
downloademacs-5a655b9f0d19703aad9331378c02e9c782412386.tar.gz
* font.c (font_range): Add pos_byte argument. Adjust comment
and break long line. * font.h (font_range): Adjust prototype. * composite.c (autocmp_chars): Pass byte position to font_range. Break long line. Remove useless prototype and format comment.
Diffstat (limited to 'src/font.c')
-rw-r--r--src/font.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/font.c b/src/font.c
index 5cfac07de72..e2ea7262397 100644
--- a/src/font.c
+++ b/src/font.c
@@ -3689,11 +3689,11 @@ font_at (int c, ptrdiff_t pos, struct face *face, struct window *w,
#ifdef HAVE_WINDOW_SYSTEM
-/* Check how many characters after POS (at most to *LIMIT) can be
- displayed by the same font in the window W. FACE, if non-NULL, is
- the face selected for the character at POS. If STRING is not nil,
- it is the string to check instead of the current buffer. In that
- case, FACE must be not NULL.
+/* Check how many characters after character/byte position POS/POS_BYTE
+ (at most to *LIMIT) can be displayed by the same font in the window W.
+ FACE, if non-NULL, is the face selected for the character at POS.
+ If STRING is not nil, it is the string to check instead of the current
+ buffer. In that case, FACE must be not NULL.
The return value is the font-object for the character at POS.
*LIMIT is set to the position where that font can't be used.
@@ -3701,15 +3701,15 @@ font_at (int c, ptrdiff_t pos, struct face *face, struct window *w,
It is assured that the current buffer (or STRING) is multibyte. */
Lisp_Object
-font_range (ptrdiff_t pos, ptrdiff_t *limit, struct window *w, struct face *face, Lisp_Object string)
+font_range (ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t *limit,
+ struct window *w, struct face *face, Lisp_Object string)
{
- ptrdiff_t pos_byte, ignore;
+ ptrdiff_t ignore;
int c;
Lisp_Object font_object = Qnil;
if (NILP (string))
{
- pos_byte = CHAR_TO_BYTE (pos);
if (! face)
{
int face_id;
@@ -3720,10 +3720,7 @@ font_range (ptrdiff_t pos, ptrdiff_t *limit, struct window *w, struct face *face
}
}
else
- {
- eassert (face);
- pos_byte = string_char_to_byte (string, pos);
- }
+ eassert (face);
while (pos < *limit)
{