summaryrefslogtreecommitdiff
path: root/src/xfaces.c
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2009-04-30 05:01:57 +0000
committerChong Yidong <cyd@stupidchicken.com>2009-04-30 05:01:57 +0000
commit6970f632f1ffd15191f5b1f97d6a667a1f51c6cf (patch)
treecf504c7e0db07920214f1d4d56ce04d634118dd8 /src/xfaces.c
parent0c616f63423c764b93c348752521e3695319bca8 (diff)
downloademacs-6970f632f1ffd15191f5b1f97d6a667a1f51c6cf.tar.gz
* 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.
Diffstat (limited to 'src/xfaces.c')
-rw-r--r--src/xfaces.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index fa50d45c952..152a1d65edd 100644
--- a/src/xfaces.c
+++ b/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