emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111762: * font.c (font_range): Add p


From: Dmitry Antipov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111762: * font.c (font_range): Add pos_byte argument. Adjust comment
Date: Wed, 13 Feb 2013 11:14:38 +0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111762
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Wed 2013-02-13 11:14:38 +0400
message:
  * 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.
modified:
  src/ChangeLog
  src/composite.c
  src/font.c
  src/font.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-02-13 04:31:09 +0000
+++ b/src/ChangeLog     2013-02-13 07:14:38 +0000
@@ -1,3 +1,11 @@
+2013-02-13  Dmitry Antipov  <address@hidden>
+
+       * 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.
+
 2013-02-13  Glenn Morris  <address@hidden>
 
        * keyboard.c (input-decode-map, key-translation-map): Doc fixes.

=== modified file 'src/composite.c'
--- a/src/composite.c   2013-02-08 05:28:52 +0000
+++ b/src/composite.c   2013-02-13 07:14:38 +0000
@@ -642,13 +642,7 @@
                       Qcomposition, prop, string);
 }
 
-
-static Lisp_Object autocmp_chars (Lisp_Object, ptrdiff_t, ptrdiff_t,
-                                  ptrdiff_t, struct window *,
-                                  struct face *, Lisp_Object);
-
-
-/* Lisp glyph-string handlers */
+/* Lisp glyph-string handlers.  */
 
 /* Hash table for automatic composition.  The key is a header of a
    lgstring (Lispy glyph-string), and the value is a body of a
@@ -905,7 +899,9 @@
    object.  Otherwise return nil.  */
 
 static Lisp_Object
-autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, 
ptrdiff_t limit, struct window *win, struct face *face, Lisp_Object string)
+autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos,
+              ptrdiff_t limit, struct window *win, struct face *face,
+              Lisp_Object string)
 {
   ptrdiff_t count = SPECPDL_INDEX ();
   FRAME_PTR f = XFRAME (win->frame);
@@ -935,7 +931,7 @@
 #ifdef HAVE_WINDOW_SYSTEM
   if (FRAME_WINDOW_P (f))
     {
-      font_object = font_range (charpos, &to, win, face, string);
+      font_object = font_range (charpos, bytepos, &to, win, face, string);
       if (! FONT_OBJECT_P (font_object)
          || (! NILP (re)
              && to < limit

=== modified file 'src/font.c'
--- a/src/font.c        2013-02-13 04:31:09 +0000
+++ b/src/font.c        2013-02-13 07:14:38 +0000
@@ -3689,11 +3689,11 @@
 
 #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 @@
    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 @@
        }
     }
   else
-    {
-      eassert (face);
-      pos_byte = string_char_to_byte (string, pos);
-    }
+    eassert (face);
 
   while (pos < *limit)
     {

=== modified file 'src/font.h'
--- a/src/font.h        2013-01-01 09:11:05 +0000
+++ b/src/font.h        2013-02-13 07:14:38 +0000
@@ -781,7 +781,7 @@
 extern void register_font_driver (struct font_driver *driver, FRAME_PTR f);
 extern void free_font_driver_list (FRAME_PTR f);
 extern Lisp_Object font_update_drivers (FRAME_PTR f, Lisp_Object list);
-extern Lisp_Object font_range (ptrdiff_t, ptrdiff_t *,
+extern Lisp_Object font_range (ptrdiff_t, ptrdiff_t, ptrdiff_t *,
                               struct window *, struct face *,
                               Lisp_Object);
 extern void font_fill_lglyph_metrics (Lisp_Object, Lisp_Object);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]