aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2011-08-19 14:30:29 +0300
committerEli Zaretskii2011-08-19 14:30:29 +0300
commit823564e519dd1f3e81a79949e1abc033c9e7c0a5 (patch)
tree78a8db3f551b4d3f9c7219f00350c0c5e834d642 /src
parent54a1215bccc20584285799c015a81f668b266bbc (diff)
downloademacs-823564e519dd1f3e81a79949e1abc033c9e7c0a5.tar.gz
emacs-823564e519dd1f3e81a79949e1abc033c9e7c0a5.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/xfaces.c15
2 files changed, 16 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b5474fcc55b..85a55b2b7c9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
12011-08-19 Eli Zaretskii <eliz@gnu.org> 12011-08-19 Eli Zaretskii <eliz@gnu.org>
2 2
3 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
4 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
5 from an Org mode buffer to a Speedbar frame.
6
3 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from 7 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
4 a composition, take its buffer position from IT->cmp_it.charpos. 8 a composition, take its buffer position from IT->cmp_it.charpos.
5 Fixes cursor positioning at the beginning of a line that begins 9 Fixes cursor positioning at the beginning of a line that begins
diff --git a/src/xfaces.c b/src/xfaces.c
index 83c92cdbc52..52b86638a50 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6008,9 +6008,18 @@ face_at_buffer_position (struct window *w, EMACS_INT pos,
6008 6008
6009 *endptr = endpos; 6009 *endptr = endpos;
6010 6010
6011 default_face = FACE_FROM_ID (f, base_face_id >= 0 ? base_face_id 6011 {
6012 : NILP (Vface_remapping_alist) ? DEFAULT_FACE_ID 6012 int face_id;
6013 : lookup_basic_face (f, DEFAULT_FACE_ID)); 6013
6014 if (base_face_id >= 0)
6015 face_id = base_face_id;
6016 else if (NILP (Vface_remapping_alist))
6017 face_id = DEFAULT_FACE_ID;
6018 else
6019 face_id = lookup_basic_face (f, DEFAULT_FACE_ID);
6020
6021 default_face = FACE_FROM_ID (f, face_id);
6022 }
6014 6023
6015 /* Optimize common cases where we can use the default face. */ 6024 /* Optimize common cases where we can use the default face. */
6016 if (noverlays == 0 6025 if (noverlays == 0