emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/extend_face_id cf7a63e: Added parameter attr_filte


From: Jimmy Aguilar Mena
Subject: [Emacs-diffs] scratch/extend_face_id cf7a63e: Added parameter attr_filter to face_at_string_position.
Date: Mon, 16 Sep 2019 06:49:50 -0400 (EDT)

branch: scratch/extend_face_id
commit cf7a63ec8deb3b996a9d7d4824579bc40c0ad5dc
Author: Jimmy Aguilar Mena <address@hidden>
Commit: Jimmy Aguilar Mena <address@hidden>

    Added parameter attr_filter to face_at_string_position.
    
    Update all the occurrences in src/xdisp.c and src/xfaces.c
---
 src/dispextern.h |  3 ++-
 src/font.c       |  4 ++--
 src/xdisp.c      | 37 ++++++++++++++++++-------------------
 src/xfaces.c     |  9 +++++----
 4 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/src/dispextern.h b/src/dispextern.h
index de438e0..7e0da64 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3464,7 +3464,8 @@ int face_at_buffer_position (struct window *, ptrdiff_t, 
ptrdiff_t *,
 int face_for_overlay_string (struct window *, ptrdiff_t, ptrdiff_t *, 
ptrdiff_t,
                              bool, Lisp_Object);
 int face_at_string_position (struct window *, Lisp_Object, ptrdiff_t, 
ptrdiff_t,
-                             ptrdiff_t *, enum face_id, bool);
+                             ptrdiff_t *, enum face_id, bool,
+                             enum lface_attribute_index);
 int merge_faces (struct window *, Lisp_Object, int, int);
 int compute_char_face (struct frame *, int, Lisp_Object);
 void free_all_realized_faces (Lisp_Object);
diff --git a/src/font.c b/src/font.c
index 2b16839..bbd2b9b 100644
--- a/src/font.c
+++ b/src/font.c
@@ -3781,7 +3781,7 @@ font_at (int c, ptrdiff_t pos, struct face *face, struct 
window *w,
 
       if (STRINGP (string))
        face_id = face_at_string_position (w, string, pos, 0, &endptr,
-                                          DEFAULT_FACE_ID, 0);
+                                          DEFAULT_FACE_ID, false, 0);
       else
        face_id = face_at_buffer_position (w, pos, &endptr,
                                           pos + 100, false, -1, 0);
@@ -3837,7 +3837,7 @@ font_range (ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t 
*limit,
            : lookup_basic_face (w, f, DEFAULT_FACE_ID);
 
          face_id = face_at_string_position (w, string, pos, 0, &ignore,
-                                            face_id, false);
+                                            face_id, false, 0);
        }
       face = FACE_FROM_ID (f, face_id);
     }
diff --git a/src/xdisp.c b/src/xdisp.c
index afb1c83..23db697 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4130,7 +4130,8 @@ handle_face_prop_general (struct it *it, int 
initial_face_id,
                                   &next_stop,
                                   (IT_CHARPOS (*it)
                                    + TEXT_PROP_DISTANCE_LIMIT),
-                                  false, it->base_face_id, attr_filter);
+                                  false, it->base_face_id,
+                                  attr_filter);
      }
   else
     {
@@ -4175,7 +4176,7 @@ handle_face_prop_general (struct it *it, int 
initial_face_id,
                                       (IT_CHARPOS (*it)
                                        + TEXT_PROP_DISTANCE_LIMIT),
                                       false,
-                                      from_overlay);
+                                      from_overlay);
        }
       else
        {
@@ -4209,7 +4210,8 @@ handle_face_prop_general (struct it *it, int 
initial_face_id,
                                             IT_STRING_CHARPOS (*it),
                                             bufpos,
                                             &next_stop,
-                                            base_face_id, false);
+                                             base_face_id, false,
+                                            attr_filter);
     } /* !is_string.  */
 
   /* Is this a start of a run of characters with box face?
@@ -4374,12 +4376,9 @@ face_before_or_after_it_pos (struct it *it, bool 
before_p)
       base_face_id = underlying_face_id (it);
 
       /* Get the face for ASCII, or unibyte.  */
-      face_id = face_at_string_position (it->w,
-                                        it->string,
-                                        charpos,
-                                        bufpos,
-                                        &next_check_charpos,
-                                        base_face_id, false);
+      face_id = face_at_string_position (it->w, it->string, charpos,
+                                         bufpos, &next_check_charpos,
+                                         base_face_id, false, 0);
 
       /* Correct the face for charsets different from ASCII.  Do it
         for the multibyte case only.  The face returned above is
@@ -7584,7 +7583,8 @@ get_next_display_element (struct it *it)
                          next_face_id
                            = face_at_string_position (it->w, base_string,
                                                       CHARPOS (pos), 0,
-                                                      &ignore, face_id, false);
+                                                      &ignore, face_id,
+                                                      false, 0);
                          it->end_of_box_run_p
                            = (FACE_FROM_ID (it->f, next_face_id)->box
                               == FACE_NO_BOX);
@@ -25424,8 +25424,8 @@ display_string (const char *string, Lisp_Object 
lisp_string, Lisp_Object face_st
 
   /* Initialize the iterator IT for iteration over STRING beginning
      with index START.  */
-  reseat_to_string (it, NILP (lisp_string) ? string : NULL, lisp_string, start,
-                   precision, field_width, multibyte);
+  reseat_to_string (it, NILP (lisp_string) ? string : NULL, lisp_string,
+                    start, precision, field_width, multibyte);
   if (string && STRINGP (lisp_string))
     /* LISP_STRING is the one returned by decode_mode_spec.  We should
        ignore its text properties.  */
@@ -25440,7 +25440,7 @@ display_string (const char *string, Lisp_Object 
lisp_string, Lisp_Object face_st
 
       it->face_id
        = face_at_string_position (it->w, face_string, face_string_pos,
-                                  0, &endptr, it->base_face_id, false);
+                                  0, &endptr, it->base_face_id, false, 0);
       face = FACE_FROM_ID (it->f, it->face_id);
       it->face_box_p = face->box != FACE_NO_BOX;
     }
@@ -31590,11 +31590,10 @@ note_mode_line_or_margin_highlight (Lisp_Object 
window, int x, int y,
          hlinfo->mouse_face_past_end = false;
          hlinfo->mouse_face_window   = window;
 
-         hlinfo->mouse_face_face_id = face_at_string_position (w, string,
-                                                               charpos,
-                                                               0, &ignore,
-                                                               glyph->face_id,
-                                                               true);
+         hlinfo->mouse_face_face_id =
+           face_at_string_position (w, string, charpos, 0, &ignore,
+                                    glyph->face_id, true, 0);
+
          show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
          mouse_face_shown = true;
 
@@ -31987,7 +31986,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
              hlinfo->mouse_face_window = window;
              hlinfo->mouse_face_face_id
                = face_at_string_position (w, object, pos, 0, &ignore,
-                                          glyph->face_id, true);
+                                          glyph->face_id, true, 0);
              show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
              cursor = No_Cursor;
            }
diff --git a/src/xfaces.c b/src/xfaces.c
index 4b3f2b2..9a19154 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6271,9 +6271,10 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
 
 int
 face_at_string_position (struct window *w, Lisp_Object string,
-                        ptrdiff_t pos, ptrdiff_t bufpos,
-                        ptrdiff_t *endptr, enum face_id base_face_id,
-                         bool mouse_p)
+                         ptrdiff_t pos, ptrdiff_t bufpos,
+                         ptrdiff_t *endptr, enum face_id base_face_id,
+                         bool mouse_p,
+                         enum lface_attribute_index attr_filter)
 {
   Lisp_Object prop, position, end, limit;
   struct frame *f = XFRAME (WINDOW_FRAME (w));
@@ -6317,7 +6318,7 @@ face_at_string_position (struct window *w, Lisp_Object 
string,
 
   /* Merge in attributes specified via text properties.  */
   if (!NILP (prop))
-    merge_face_ref (w, f, prop, attrs, true, NULL, 0);
+    merge_face_ref (w, f, prop, attrs, true, NULL, attr_filter);
 
   /* Look up a realized face with the given face attributes,
      or realize a new one for ASCII characters.  */



reply via email to

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