diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/xdisp.c | 19 | ||||
| -rw-r--r-- | src/xfaces.c | 15 |
3 files changed, 36 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2b5b6fd0602..85a55b2b7c9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2011-08-19 Eli Zaretskii <eliz@gnu.org> | ||
| 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 | |||
| 7 | * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from | ||
| 8 | a composition, take its buffer position from IT->cmp_it.charpos. | ||
| 9 | Fixes cursor positioning at the beginning of a line that begins | ||
| 10 | with a composed character. | ||
| 11 | |||
| 1 | 2011-08-18 Eli Zaretskii <eliz@gnu.org> | 12 | 2011-08-18 Eli Zaretskii <eliz@gnu.org> |
| 2 | 13 | ||
| 3 | * bidi.c (bidi_get_type): If bidi_type_table reports zero as the | 14 | * bidi.c (bidi_get_type): If bidi_type_table reports zero as the |
diff --git a/src/xdisp.c b/src/xdisp.c index b26d844cdf2..2cd1bb9bfdb 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -18491,15 +18491,22 @@ display_line (struct it *it) | |||
| 18491 | #define RECORD_MAX_MIN_POS(IT) \ | 18491 | #define RECORD_MAX_MIN_POS(IT) \ |
| 18492 | do \ | 18492 | do \ |
| 18493 | { \ | 18493 | { \ |
| 18494 | if (IT_CHARPOS (*(IT)) < min_pos) \ | 18494 | int composition_p = (IT)->what == IT_COMPOSITION; \ |
| 18495 | EMACS_INT current_pos = \ | ||
| 18496 | composition_p ? (IT)->cmp_it.charpos \ | ||
| 18497 | : IT_CHARPOS (*(IT)); \ | ||
| 18498 | EMACS_INT current_bpos = \ | ||
| 18499 | composition_p ? CHAR_TO_BYTE (current_pos) \ | ||
| 18500 | : IT_BYTEPOS (*(IT)); \ | ||
| 18501 | if (current_pos < min_pos) \ | ||
| 18495 | { \ | 18502 | { \ |
| 18496 | min_pos = IT_CHARPOS (*(IT)); \ | 18503 | min_pos = current_pos; \ |
| 18497 | min_bpos = IT_BYTEPOS (*(IT)); \ | 18504 | min_bpos = current_bpos; \ |
| 18498 | } \ | 18505 | } \ |
| 18499 | if (IT_CHARPOS (*(IT)) > max_pos) \ | 18506 | if (current_pos > max_pos) \ |
| 18500 | { \ | 18507 | { \ |
| 18501 | max_pos = IT_CHARPOS (*(IT)); \ | 18508 | max_pos = current_pos; \ |
| 18502 | max_bpos = IT_BYTEPOS (*(IT)); \ | 18509 | max_bpos = current_bpos; \ |
| 18503 | } \ | 18510 | } \ |
| 18504 | } \ | 18511 | } \ |
| 18505 | while (0) | 18512 | while (0) |
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 |