diff options
| author | Gerd Moellmann | 1999-09-20 11:25:06 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-09-20 11:25:06 +0000 |
| commit | f3751a65aaa41856dbb8708502231a2001eb9169 (patch) | |
| tree | 2770e25d14fa6301a184c00511918e7ce0eef8ff /src | |
| parent | a1edb521ecd2a93af177bd55ae3ed950d33761a2 (diff) | |
| download | emacs-f3751a65aaa41856dbb8708502231a2001eb9169.tar.gz emacs-f3751a65aaa41856dbb8708502231a2001eb9169.zip | |
(compute_window_start_on_continuation_line): Handle case
that window start is out of range.
(handle_display_prop, handle_single_display_prop): Replace
marginal area specifications like `left-margin' with `(margin
left-margin)'.
(Qmargin): New.
(syms_of_xdisp): Initialize Qmargin.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 03b5eebf790..f603f4fccda 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -258,6 +258,7 @@ extern Lisp_Object Qface, Qinvisible, Qimage; | |||
| 258 | 258 | ||
| 259 | Lisp_Object Qspace, QCalign_to, QCrelative_width, QCrelative_height; | 259 | Lisp_Object Qspace, QCalign_to, QCrelative_width, QCrelative_height; |
| 260 | Lisp_Object Qleft_margin, Qright_margin, Qspace_width, Qheight, Qraise; | 260 | Lisp_Object Qleft_margin, Qright_margin, Qspace_width, Qheight, Qraise; |
| 261 | Lisp_Object Qmargin; | ||
| 261 | 262 | ||
| 262 | /* Non-nil means highlight trailing whitespace. */ | 263 | /* Non-nil means highlight trailing whitespace. */ |
| 263 | 264 | ||
| @@ -2212,8 +2213,11 @@ handle_display_prop (it) | |||
| 2212 | return HANDLED_NORMALLY; | 2213 | return HANDLED_NORMALLY; |
| 2213 | 2214 | ||
| 2214 | space_or_image_found_p = 0; | 2215 | space_or_image_found_p = 0; |
| 2215 | if (CONSP (prop) && CONSP (XCAR (prop))) | 2216 | if (CONSP (prop) |
| 2217 | && CONSP (XCAR (prop)) | ||
| 2218 | && !EQ (Qmargin, XCAR (XCAR (prop)))) | ||
| 2216 | { | 2219 | { |
| 2220 | /* A list of sub-properties. */ | ||
| 2217 | while (CONSP (prop)) | 2221 | while (CONSP (prop)) |
| 2218 | { | 2222 | { |
| 2219 | if (handle_single_display_prop (it, XCAR (prop), object, position)) | 2223 | if (handle_single_display_prop (it, XCAR (prop), object, position)) |
| @@ -2431,8 +2435,8 @@ handle_single_display_prop (it, prop, object, position) | |||
| 2431 | } | 2435 | } |
| 2432 | else if (!it->string_from_display_prop_p) | 2436 | else if (!it->string_from_display_prop_p) |
| 2433 | { | 2437 | { |
| 2434 | /* `(left-margin VALUE)' or `(right-margin VALUE) | 2438 | /* `((margin left-margin) VALUE)' or `((margin right-margin) |
| 2435 | or `(nil VALUE)' or VALUE. */ | 2439 | VALUE) or `((margin nil) VALUE)' or VALUE. */ |
| 2436 | Lisp_Object location, value; | 2440 | Lisp_Object location, value; |
| 2437 | struct text_pos start_pos; | 2441 | struct text_pos start_pos; |
| 2438 | int valid_p; | 2442 | int valid_p; |
| @@ -2447,14 +2451,26 @@ handle_single_display_prop (it, prop, object, position) | |||
| 2447 | text properties change there. */ | 2451 | text properties change there. */ |
| 2448 | it->stop_charpos = position->charpos; | 2452 | it->stop_charpos = position->charpos; |
| 2449 | 2453 | ||
| 2450 | if (CONSP (prop) | 2454 | location = Qunbound; |
| 2451 | && !EQ (XCAR (prop), Qspace) | 2455 | if (CONSP (prop) && CONSP (XCAR (prop))) |
| 2452 | && !EQ (XCAR (prop), Qimage)) | ||
| 2453 | { | 2456 | { |
| 2454 | location = XCAR (prop); | 2457 | Lisp_Object tem; |
| 2458 | |||
| 2455 | value = XCDR (prop); | 2459 | value = XCDR (prop); |
| 2460 | if (CONSP (value)) | ||
| 2461 | value = XCAR (value); | ||
| 2462 | |||
| 2463 | tem = XCAR (prop); | ||
| 2464 | if (EQ (XCAR (tem), Qmargin) | ||
| 2465 | && (tem = XCDR (tem), | ||
| 2466 | tem = CONSP (tem) ? XCAR (tem) : Qnil, | ||
| 2467 | (NILP (tem) | ||
| 2468 | || EQ (tem, Qleft_margin) | ||
| 2469 | || EQ (tem, Qright_margin)))) | ||
| 2470 | location = tem; | ||
| 2456 | } | 2471 | } |
| 2457 | else | 2472 | |
| 2473 | if (EQ (location, Qunbound)) | ||
| 2458 | { | 2474 | { |
| 2459 | location = Qnil; | 2475 | location = Qnil; |
| 2460 | value = prop; | 2476 | value = prop; |
| @@ -8203,6 +8219,12 @@ compute_window_start_on_continuation_line (w) | |||
| 8203 | { | 8219 | { |
| 8204 | struct it it; | 8220 | struct it it; |
| 8205 | struct glyph_row *row; | 8221 | struct glyph_row *row; |
| 8222 | |||
| 8223 | /* Handle the case that the window start is out of range. */ | ||
| 8224 | if (CHARPOS (start_pos) < BEGV) | ||
| 8225 | SET_TEXT_POS (start_pos, BEGV, BEGV_BYTE); | ||
| 8226 | else if (CHARPOS (start_pos) > ZV) | ||
| 8227 | SET_TEXT_POS (start_pos, ZV, ZV_BYTE); | ||
| 8206 | 8228 | ||
| 8207 | /* Find the start of the continued line. This should be fast | 8229 | /* Find the start of the continued line. This should be fast |
| 8208 | because scan_buffer is fast (newline cache). */ | 8230 | because scan_buffer is fast (newline cache). */ |
| @@ -12611,9 +12633,8 @@ syms_of_xdisp () | |||
| 12611 | staticpro (&Qinhibit_point_motion_hooks); | 12633 | staticpro (&Qinhibit_point_motion_hooks); |
| 12612 | Qinhibit_point_motion_hooks = intern ("inhibit-point-motion-hooks"); | 12634 | Qinhibit_point_motion_hooks = intern ("inhibit-point-motion-hooks"); |
| 12613 | 12635 | ||
| 12614 | staticpro (&Qdisplay); | ||
| 12615 | Qdisplay = intern ("display"); | 12636 | Qdisplay = intern ("display"); |
| 12616 | staticpro (&Qleft_margin); | 12637 | staticpro (&Qdisplay); |
| 12617 | Qspace_width = intern ("space-width"); | 12638 | Qspace_width = intern ("space-width"); |
| 12618 | staticpro (&Qspace_width); | 12639 | staticpro (&Qspace_width); |
| 12619 | Qheight = intern ("height"); | 12640 | Qheight = intern ("height"); |
| @@ -12622,9 +12643,12 @@ syms_of_xdisp () | |||
| 12622 | staticpro (&Qraise); | 12643 | staticpro (&Qraise); |
| 12623 | Qspace = intern ("space"); | 12644 | Qspace = intern ("space"); |
| 12624 | staticpro (&Qspace); | 12645 | staticpro (&Qspace); |
| 12646 | Qmargin = intern ("margin"); | ||
| 12647 | staticpro (&Qmargin); | ||
| 12625 | Qleft_margin = intern ("left-margin"); | 12648 | Qleft_margin = intern ("left-margin"); |
| 12626 | staticpro (&Qright_margin); | 12649 | staticpro (&Qleft_margin); |
| 12627 | Qright_margin = intern ("right-margin"); | 12650 | Qright_margin = intern ("right-margin"); |
| 12651 | staticpro (&Qright_margin); | ||
| 12628 | Qalign_to = intern ("align-to"); | 12652 | Qalign_to = intern ("align-to"); |
| 12629 | staticpro (&Qalign_to); | 12653 | staticpro (&Qalign_to); |
| 12630 | QCalign_to = intern (":align-to"); | 12654 | QCalign_to = intern (":align-to"); |
| @@ -12640,9 +12664,9 @@ syms_of_xdisp () | |||
| 12640 | QCeval = intern (":eval"); | 12664 | QCeval = intern (":eval"); |
| 12641 | staticpro (&QCeval); | 12665 | staticpro (&QCeval); |
| 12642 | Qwhen = intern ("when"); | 12666 | Qwhen = intern ("when"); |
| 12667 | staticpro (&Qwhen); | ||
| 12643 | QCfile = intern (":file"); | 12668 | QCfile = intern (":file"); |
| 12644 | staticpro (&QCfile); | 12669 | staticpro (&QCfile); |
| 12645 | staticpro (&Qwhen); | ||
| 12646 | Qfontified = intern ("fontified"); | 12670 | Qfontified = intern ("fontified"); |
| 12647 | staticpro (&Qfontified); | 12671 | staticpro (&Qfontified); |
| 12648 | Qfontification_functions = intern ("fontification-functions"); | 12672 | Qfontification_functions = intern ("fontification-functions"); |
| @@ -12652,10 +12676,10 @@ syms_of_xdisp () | |||
| 12652 | Qimage = intern ("image"); | 12676 | Qimage = intern ("image"); |
| 12653 | staticpro (&Qimage); | 12677 | staticpro (&Qimage); |
| 12654 | 12678 | ||
| 12655 | staticpro (&last_arrow_position); | ||
| 12656 | staticpro (&last_arrow_string); | ||
| 12657 | last_arrow_position = Qnil; | 12679 | last_arrow_position = Qnil; |
| 12658 | last_arrow_string = Qnil; | 12680 | last_arrow_string = Qnil; |
| 12681 | staticpro (&last_arrow_position); | ||
| 12682 | staticpro (&last_arrow_string); | ||
| 12659 | 12683 | ||
| 12660 | echo_buffer[0] = echo_buffer[1] = Qnil; | 12684 | echo_buffer[0] = echo_buffer[1] = Qnil; |
| 12661 | staticpro (&echo_buffer[0]); | 12685 | staticpro (&echo_buffer[0]); |