* xfaces.c (face_at_buffer_position): New arg base_face_id.
* xdisp.c (handle_face_prop): Pass base_face_id of iterator to face_at_buffer_position. (face_before_or_after_it_pos, get_next_display_element) (note_mouse_highlight): Update face_at_buffer_position call. * term.c (term_mouse_highlight): * msdos.c (IT_note_mouse_highlight): * fontset.c (Finternal_char_font): * font.c (font_at, font_range): Update face_at_buffer_position call. * dispextern.h (face_at_buffer_position): Update prototype.
This commit is contained in:
parent
0c616f6342
commit
6970f632f1
8 changed files with 47 additions and 21 deletions
|
@ -1,3 +1,20 @@
|
|||
2009-04-30 Chong Yidong <cyd@stupidchicken.com>
|
||||
|
||||
* xfaces.c (face_at_buffer_position): New arg base_face_id.
|
||||
|
||||
* xdisp.c (handle_face_prop): Pass base_face_id of iterator to
|
||||
face_at_buffer_position.
|
||||
(face_before_or_after_it_pos, get_next_display_element)
|
||||
(note_mouse_highlight): Update face_at_buffer_position call.
|
||||
|
||||
* term.c (term_mouse_highlight):
|
||||
* msdos.c (IT_note_mouse_highlight):
|
||||
* fontset.c (Finternal_char_font):
|
||||
* font.c (font_at, font_range): Update face_at_buffer_position
|
||||
call.
|
||||
|
||||
* dispextern.h (face_at_buffer_position): Update prototype.
|
||||
|
||||
2009-04-30 Kenichi Handa <handa@m17n.org>
|
||||
|
||||
* fontset.c (fontset_find_font): Check if rfont_def is Qnil or
|
||||
|
|
|
@ -2923,7 +2923,7 @@ void recompute_basic_faces P_ ((struct frame *));
|
|||
int face_at_buffer_position P_ ((struct window *w, EMACS_INT pos,
|
||||
EMACS_INT region_beg, EMACS_INT region_end,
|
||||
EMACS_INT *endptr, EMACS_INT limit,
|
||||
int mouse));
|
||||
int mouse, int base_face_id));
|
||||
int face_for_overlay_string P_ ((struct window *w, EMACS_INT pos,
|
||||
EMACS_INT region_beg, EMACS_INT region_end,
|
||||
EMACS_INT *endptr, EMACS_INT limit,
|
||||
|
|
|
@ -3780,7 +3780,7 @@ font_at (c, pos, face, w, string)
|
|||
DEFAULT_FACE_ID, 0);
|
||||
else
|
||||
face_id = face_at_buffer_position (w, pos, -1, -1, &endptr,
|
||||
pos + 100, 0);
|
||||
pos + 100, 0, -1);
|
||||
face = FACE_FROM_ID (f, face_id);
|
||||
}
|
||||
if (multibyte)
|
||||
|
@ -3827,7 +3827,8 @@ font_range (pos, limit, w, face, string)
|
|||
{
|
||||
int face_id;
|
||||
|
||||
face_id = face_at_buffer_position (w, pos, 0, 0, &ignore, *limit, 0);
|
||||
face_id = face_at_buffer_position (w, pos, 0, 0, &ignore,
|
||||
*limit, 0, -1);
|
||||
face = FACE_FROM_ID (XFRAME (w->frame), face_id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1876,7 +1876,8 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
|
|||
return Qnil;
|
||||
w = XWINDOW (window);
|
||||
f = XFRAME (w->frame);
|
||||
face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0);
|
||||
face_id = face_at_buffer_position (w, pos, -1, -1, &dummy,
|
||||
pos + 100, 0, -1);
|
||||
charset = Fget_char_property (position, Qcharset, Qnil);
|
||||
if (CHARSETP (charset))
|
||||
cs_id = XINT (CHARSET_SYMBOL_ID (charset));
|
||||
|
|
|
@ -1524,7 +1524,8 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
|
|||
dpyinfo->mouse_face_face_id
|
||||
= face_at_buffer_position (w, pos, 0, 0,
|
||||
&ignore, pos + 1,
|
||||
!dpyinfo->mouse_face_hidden);
|
||||
!dpyinfo->mouse_face_hidden,
|
||||
-1);
|
||||
|
||||
/* Display it as active. */
|
||||
show_mouse_face (dpyinfo, 1);
|
||||
|
@ -1559,7 +1560,8 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
|
|||
dpyinfo->mouse_face_face_id
|
||||
= face_at_buffer_position (w, pos, 0, 0,
|
||||
&ignore, pos + 1,
|
||||
!dpyinfo->mouse_face_hidden);
|
||||
!dpyinfo->mouse_face_hidden,
|
||||
-1);
|
||||
|
||||
/* Display it as active. */
|
||||
show_mouse_face (dpyinfo, 1);
|
||||
|
|
|
@ -2851,7 +2851,7 @@ term_mouse_highlight (struct frame *f, int x, int y)
|
|||
|
||||
mouse_face_face_id
|
||||
= face_at_buffer_position (w, pos, 0, 0,
|
||||
&ignore, pos + 1, 1);
|
||||
&ignore, pos + 1, 1, -1);
|
||||
|
||||
/* Display it as active. */
|
||||
term_show_mouse_face (DRAW_MOUSE_FACE);
|
||||
|
@ -2886,7 +2886,7 @@ term_mouse_highlight (struct frame *f, int x, int y)
|
|||
|
||||
mouse_face_face_id
|
||||
= face_at_buffer_position (w, pos, 0, 0,
|
||||
&ignore, pos + 1, 1);
|
||||
&ignore, pos + 1, 1, -1);
|
||||
|
||||
/* Display it as active. */
|
||||
term_show_mouse_face (DRAW_MOUSE_FACE);
|
||||
|
|
16
src/xdisp.c
16
src/xdisp.c
|
@ -3452,7 +3452,7 @@ handle_face_prop (it)
|
|||
&next_stop,
|
||||
(IT_CHARPOS (*it)
|
||||
+ TEXT_PROP_DISTANCE_LIMIT),
|
||||
0);
|
||||
0, it->base_face_id);
|
||||
|
||||
/* Is this a start of a run of characters with box face?
|
||||
Caveat: this can be called for a freshly initialized
|
||||
|
@ -3693,7 +3693,7 @@ face_before_or_after_it_pos (it, before_p)
|
|||
it->region_beg_charpos,
|
||||
it->region_end_charpos,
|
||||
&next_check_charpos,
|
||||
limit, 0);
|
||||
limit, 0, -1);
|
||||
|
||||
/* Correct the face for charsets different from ASCII. Do it
|
||||
for the multibyte case only. The face returned above is
|
||||
|
@ -5992,7 +5992,8 @@ get_next_display_element (it)
|
|||
next_face_id = face_at_buffer_position
|
||||
(it->w, CHARPOS (pos), it->region_beg_charpos,
|
||||
it->region_end_charpos, &ignore,
|
||||
(IT_CHARPOS (*it) + TEXT_PROP_DISTANCE_LIMIT), 0);
|
||||
(IT_CHARPOS (*it) + TEXT_PROP_DISTANCE_LIMIT), 0,
|
||||
-1);
|
||||
it->end_of_box_run_p
|
||||
= (FACE_FROM_ID (it->f, next_face_id)->box
|
||||
== FACE_NO_BOX);
|
||||
|
@ -23898,7 +23899,8 @@ note_mouse_highlight (f, x, y)
|
|||
dpyinfo->mouse_face_face_id
|
||||
= face_at_buffer_position (w, pos, 0, 0,
|
||||
&ignore, pos + 1,
|
||||
!dpyinfo->mouse_face_hidden);
|
||||
!dpyinfo->mouse_face_hidden,
|
||||
-1);
|
||||
|
||||
/* Display it as active. */
|
||||
show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
|
||||
|
@ -23941,7 +23943,8 @@ note_mouse_highlight (f, x, y)
|
|||
dpyinfo->mouse_face_face_id
|
||||
= face_at_buffer_position (w, pos, 0, 0,
|
||||
&ignore, pos + 1,
|
||||
!dpyinfo->mouse_face_hidden);
|
||||
!dpyinfo->mouse_face_hidden,
|
||||
-1);
|
||||
|
||||
/* Display it as active. */
|
||||
show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
|
||||
|
@ -24022,7 +24025,8 @@ note_mouse_highlight (f, x, y)
|
|||
dpyinfo->mouse_face_face_id
|
||||
= face_at_buffer_position (w, pos, 0, 0,
|
||||
&ignore, pos + 1,
|
||||
!dpyinfo->mouse_face_hidden);
|
||||
!dpyinfo->mouse_face_hidden,
|
||||
-1);
|
||||
|
||||
/* Display it as active. */
|
||||
show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
|
||||
|
|
15
src/xfaces.c
15
src/xfaces.c
|
@ -6251,17 +6251,21 @@ compute_char_face (f, ch, prop)
|
|||
|
||||
If MOUSE is non-zero, use the character's mouse-face, not its face.
|
||||
|
||||
BASE_FACE_ID, if non-negative, specifies a base face id to use
|
||||
instead of DEFAULT_FACE_ID.
|
||||
|
||||
The face returned is suitable for displaying ASCII characters. */
|
||||
|
||||
int
|
||||
face_at_buffer_position (w, pos, region_beg, region_end,
|
||||
endptr, limit, mouse)
|
||||
endptr, limit, mouse, base_face_id)
|
||||
struct window *w;
|
||||
EMACS_INT pos;
|
||||
EMACS_INT region_beg, region_end;
|
||||
EMACS_INT *endptr;
|
||||
EMACS_INT limit;
|
||||
int mouse;
|
||||
int base_face_id;
|
||||
{
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
Lisp_Object attrs[LFACE_VECTOR_SIZE];
|
||||
|
@ -6304,12 +6308,9 @@ face_at_buffer_position (w, pos, region_beg, region_end,
|
|||
|
||||
*endptr = endpos;
|
||||
|
||||
|
||||
/* Perhaps remap BASE_FACE_ID to a user-specified alternative. */
|
||||
if (NILP (Vface_remapping_alist))
|
||||
default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID);
|
||||
else
|
||||
default_face = FACE_FROM_ID (f, lookup_basic_face (f, DEFAULT_FACE_ID));
|
||||
default_face = FACE_FROM_ID (f, base_face_id >= 0 ? base_face_id
|
||||
: NILP (Vface_remapping_alist) ? DEFAULT_FACE_ID
|
||||
: lookup_basic_face (f, DEFAULT_FACE_ID));
|
||||
|
||||
/* Optimize common cases where we can use the default face. */
|
||||
if (noverlays == 0
|
||||
|
|
Loading…
Add table
Reference in a new issue