diff options
| author | Kenichi Handa | 2012-03-19 13:17:50 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-03-19 13:17:50 +0900 |
| commit | 4ebb358f29e64094871ad6d35fb365d77c17047d (patch) | |
| tree | cfc5c5055207bd4e5995a12ca292d16939a9efdb /src | |
| parent | 4827f94e1725c34d4b19d79f4c74f16a0dc3b0cb (diff) | |
| parent | e50a24a249e1bfd69af7e48ea5076cac78bf7224 (diff) | |
| download | emacs-4ebb358f29e64094871ad6d35fb365d77c17047d.tar.gz emacs-4ebb358f29e64094871ad6d35fb365d77c17047d.zip | |
merge trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 12 | ||||
| -rw-r--r-- | src/buffer.c | 4 | ||||
| -rw-r--r-- | src/xdisp.c | 25 |
3 files changed, 38 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 80bc42fa8c6..8b1221ab6d8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -3,6 +3,18 @@ | |||
| 3 | * ftfont.c (ftfont_drive_otf): Mask bits of character code to make | 3 | * ftfont.c (ftfont_drive_otf): Mask bits of character code to make |
| 4 | it fit in a valid range (Bug#11003). | 4 | it fit in a valid range (Bug#11003). |
| 5 | 5 | ||
| 6 | 2012-03-18 Eli Zaretskii <eliz@gnu.org> | ||
| 7 | |||
| 8 | * xdisp.c (cursor_row_p): Even if the glyph row ends in a string | ||
| 9 | that is not from display property, accept the row as a "cursor | ||
| 10 | row" if one of the string's character has a non-nil `cursor' | ||
| 11 | property. Fixes cursor positioning when there are newlines in | ||
| 12 | overlay strings, e.g. in icomplete.el. (Bug#11035) | ||
| 13 | |||
| 14 | 2012-03-12 Paul Eggert <eggert@cs.ucla.edu> | ||
| 15 | |||
| 16 | * buffer.c (compare_overlays): Don't assume args differ (Bug#6830). | ||
| 17 | |||
| 6 | 2012-03-12 Chong Yidong <cyd@gnu.org> | 18 | 2012-03-12 Chong Yidong <cyd@gnu.org> |
| 7 | 19 | ||
| 8 | * eval.c (inhibit_lisp_code): Rename from | 20 | * eval.c (inhibit_lisp_code): Rename from |
diff --git a/src/buffer.c b/src/buffer.c index efb9a80f35d..1fea19b0d65 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -2868,7 +2868,9 @@ compare_overlays (const void *v1, const void *v2) | |||
| 2868 | between "equal" overlays. The result can still change between | 2868 | between "equal" overlays. The result can still change between |
| 2869 | invocations of Emacs, but it won't change in the middle of | 2869 | invocations of Emacs, but it won't change in the middle of |
| 2870 | `find_field' (bug#6830). */ | 2870 | `find_field' (bug#6830). */ |
| 2871 | return XHASH (s1->overlay) < XHASH (s2->overlay) ? -1 : 1; | 2871 | if (XHASH (s1->overlay) != XHASH (s2->overlay)) |
| 2872 | return XHASH (s1->overlay) < XHASH (s2->overlay) ? -1 : 1; | ||
| 2873 | return 0; | ||
| 2872 | } | 2874 | } |
| 2873 | 2875 | ||
| 2874 | /* Sort an array of overlays by priority. The array is modified in place. | 2876 | /* Sort an array of overlays by priority. The array is modified in place. |
diff --git a/src/xdisp.c b/src/xdisp.c index 62d0d187a19..71162960faa 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -18456,9 +18456,11 @@ cursor_row_p (struct glyph_row *row) | |||
| 18456 | /* Suppose the row ends on a string. | 18456 | /* Suppose the row ends on a string. |
| 18457 | Unless the row is continued, that means it ends on a newline | 18457 | Unless the row is continued, that means it ends on a newline |
| 18458 | in the string. If it's anything other than a display string | 18458 | in the string. If it's anything other than a display string |
| 18459 | (e.g. a before-string from an overlay), we don't want the | 18459 | (e.g., a before-string from an overlay), we don't want the |
| 18460 | cursor there. (This heuristic seems to give the optimal | 18460 | cursor there. (This heuristic seems to give the optimal |
| 18461 | behavior for the various types of multi-line strings.) */ | 18461 | behavior for the various types of multi-line strings.) |
| 18462 | One exception: if the string has `cursor' property on one of | ||
| 18463 | its characters, we _do_ want the cursor there. */ | ||
| 18462 | if (CHARPOS (row->end.string_pos) >= 0) | 18464 | if (CHARPOS (row->end.string_pos) >= 0) |
| 18463 | { | 18465 | { |
| 18464 | if (row->continued_p) | 18466 | if (row->continued_p) |
| @@ -18480,6 +18482,25 @@ cursor_row_p (struct glyph_row *row) | |||
| 18480 | result = | 18482 | result = |
| 18481 | (!NILP (prop) | 18483 | (!NILP (prop) |
| 18482 | && display_prop_string_p (prop, glyph->object)); | 18484 | && display_prop_string_p (prop, glyph->object)); |
| 18485 | /* If there's a `cursor' property on one of the | ||
| 18486 | string's characters, this row is a cursor row, | ||
| 18487 | even though this is not a display string. */ | ||
| 18488 | if (!result) | ||
| 18489 | { | ||
| 18490 | Lisp_Object s = glyph->object; | ||
| 18491 | |||
| 18492 | for ( ; glyph >= beg && EQ (glyph->object, s); --glyph) | ||
| 18493 | { | ||
| 18494 | EMACS_INT gpos = glyph->charpos; | ||
| 18495 | |||
| 18496 | if (!NILP (Fget_char_property (make_number (gpos), | ||
| 18497 | Qcursor, s))) | ||
| 18498 | { | ||
| 18499 | result = 1; | ||
| 18500 | break; | ||
| 18501 | } | ||
| 18502 | } | ||
| 18503 | } | ||
| 18483 | break; | 18504 | break; |
| 18484 | } | 18505 | } |
| 18485 | } | 18506 | } |