Avoid a crash in mouse-highlight of Speedbar frames.
src/xfaces.c (face_at_buffer_position): Avoid repeated evaluation of face ID by FACE_FROM_ID, and avoid a crash when mouse is moved from an Org mode buffer to a Speedbar frame.
This commit is contained in:
parent
54a1215bcc
commit
823564e519
2 changed files with 16 additions and 3 deletions
|
@ -1,5 +1,9 @@
|
|||
2011-08-19 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
|
||||
face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
|
||||
from an Org mode buffer to a Speedbar frame.
|
||||
|
||||
* xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
|
||||
a composition, take its buffer position from IT->cmp_it.charpos.
|
||||
Fixes cursor positioning at the beginning of a line that begins
|
||||
|
|
15
src/xfaces.c
15
src/xfaces.c
|
@ -6008,9 +6008,18 @@ face_at_buffer_position (struct window *w, EMACS_INT pos,
|
|||
|
||||
*endptr = endpos;
|
||||
|
||||
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));
|
||||
{
|
||||
int face_id;
|
||||
|
||||
if (base_face_id >= 0)
|
||||
face_id = base_face_id;
|
||||
else if (NILP (Vface_remapping_alist))
|
||||
face_id = DEFAULT_FACE_ID;
|
||||
else
|
||||
face_id = lookup_basic_face (f, DEFAULT_FACE_ID);
|
||||
|
||||
default_face = FACE_FROM_ID (f, face_id);
|
||||
}
|
||||
|
||||
/* Optimize common cases where we can use the default face. */
|
||||
if (noverlays == 0
|
||||
|
|
Loading…
Add table
Reference in a new issue