diff options
| author | Paul Eggert | 2012-12-13 08:55:28 -0800 |
|---|---|---|
| committer | Paul Eggert | 2012-12-13 08:55:28 -0800 |
| commit | 893f52d89586fe46009ee077858f6ecd847e3e09 (patch) | |
| tree | 216e927f5649ce361a5fcb09bcda9bfad0027c6c | |
| parent | f10331bfe95b36b0880e806b9c18c42550d8159f (diff) | |
| download | emacs-893f52d89586fe46009ee077858f6ecd847e3e09.tar.gz emacs-893f52d89586fe46009ee077858f6ecd847e3e09.zip | |
* xdisp.c: Minor style fixes.
(init_iterator): Hoist assignment out of if-expression.
(markpos_of_region): Callers now test for sign, not for -1.
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 17 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f513e80408d..939fd61c87f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-12-13 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * xdisp.c: Minor style fixes. | ||
| 4 | (init_iterator): Hoist assignment out of if-expression. | ||
| 5 | (markpos_of_region): Callers now test for sign, not for -1. | ||
| 6 | |||
| 1 | 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru> | 7 | 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 8 | ||
| 3 | Minor redisplay optimization when the region length is zero. | 9 | Minor redisplay optimization when the region length is zero. |
diff --git a/src/xdisp.c b/src/xdisp.c index 2801f3def10..3d7eda35092 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -2711,7 +2711,8 @@ init_iterator (struct it *it, struct window *w, | |||
| 2711 | /* If visible region is of non-zero length, set IT->region_beg_charpos | 2711 | /* If visible region is of non-zero length, set IT->region_beg_charpos |
| 2712 | and IT->region_end_charpos to the start and end of a visible region | 2712 | and IT->region_end_charpos to the start and end of a visible region |
| 2713 | in window IT->w. Set both to -1 to indicate no region. */ | 2713 | in window IT->w. Set both to -1 to indicate no region. */ |
| 2714 | if ((markpos = markpos_of_region ()) != -1 | 2714 | markpos = markpos_of_region (); |
| 2715 | if (0 <= markpos | ||
| 2715 | /* Maybe highlight only in selected window. */ | 2716 | /* Maybe highlight only in selected window. */ |
| 2716 | && (/* Either show region everywhere. */ | 2717 | && (/* Either show region everywhere. */ |
| 2717 | highlight_nonselected_windows | 2718 | highlight_nonselected_windows |
| @@ -10916,7 +10917,7 @@ buffer_shared_and_changed (void) | |||
| 10916 | static int | 10917 | static int |
| 10917 | window_outdated (struct window *w) | 10918 | window_outdated (struct window *w) |
| 10918 | { | 10919 | { |
| 10919 | return (w->last_modified < MODIFF | 10920 | return (w->last_modified < MODIFF |
| 10920 | || w->last_overlay_modified < OVERLAY_MODIFF); | 10921 | || w->last_overlay_modified < OVERLAY_MODIFF); |
| 10921 | } | 10922 | } |
| 10922 | 10923 | ||
| @@ -15082,7 +15083,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 15082 | /* Can't use this case if highlighting a region. When a | 15083 | /* Can't use this case if highlighting a region. When a |
| 15083 | region exists, cursor movement has to do more than just | 15084 | region exists, cursor movement has to do more than just |
| 15084 | set the cursor. */ | 15085 | set the cursor. */ |
| 15085 | && (markpos_of_region () == -1) | 15086 | && markpos_of_region () < 0 |
| 15086 | && NILP (w->region_showing) | 15087 | && NILP (w->region_showing) |
| 15087 | && NILP (Vshow_trailing_whitespace) | 15088 | && NILP (Vshow_trailing_whitespace) |
| 15088 | /* This code is not used for mini-buffer for the sake of the case | 15089 | /* This code is not used for mini-buffer for the sake of the case |
| @@ -15751,7 +15752,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15751 | 15752 | ||
| 15752 | /* If we are highlighting the region, then we just changed | 15753 | /* If we are highlighting the region, then we just changed |
| 15753 | the region, so redisplay to show it. */ | 15754 | the region, so redisplay to show it. */ |
| 15754 | if (markpos_of_region () != -1) | 15755 | if (0 <= markpos_of_region ()) |
| 15755 | { | 15756 | { |
| 15756 | clear_glyph_matrix (w->desired_matrix); | 15757 | clear_glyph_matrix (w->desired_matrix); |
| 15757 | if (!try_window (window, startp, 0)) | 15758 | if (!try_window (window, startp, 0)) |
| @@ -16456,7 +16457,7 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 16456 | return 0; | 16457 | return 0; |
| 16457 | 16458 | ||
| 16458 | /* Can't do this if region may have changed. */ | 16459 | /* Can't do this if region may have changed. */ |
| 16459 | if ((markpos_of_region () != -1) | 16460 | if (0 <= markpos_of_region () |
| 16460 | || !NILP (w->region_showing) | 16461 | || !NILP (w->region_showing) |
| 16461 | || !NILP (Vshow_trailing_whitespace)) | 16462 | || !NILP (Vshow_trailing_whitespace)) |
| 16462 | return 0; | 16463 | return 0; |
| @@ -17288,7 +17289,7 @@ try_window_id (struct window *w) | |||
| 17288 | 17289 | ||
| 17289 | /* Can't use this if highlighting a region because a cursor movement | 17290 | /* Can't use this if highlighting a region because a cursor movement |
| 17290 | will do more than just set the cursor. */ | 17291 | will do more than just set the cursor. */ |
| 17291 | if (markpos_of_region () != -1) | 17292 | if (0 <= markpos_of_region ()) |
| 17292 | GIVE_UP (9); | 17293 | GIVE_UP (9); |
| 17293 | 17294 | ||
| 17294 | /* Likewise if highlighting trailing whitespace. */ | 17295 | /* Likewise if highlighting trailing whitespace. */ |
| @@ -21466,8 +21467,8 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 21466 | register int i; | 21467 | register int i; |
| 21467 | 21468 | ||
| 21468 | /* Let lots_of_dashes be a string of infinite length. */ | 21469 | /* Let lots_of_dashes be a string of infinite length. */ |
| 21469 | if (mode_line_target == MODE_LINE_NOPROP || | 21470 | if (mode_line_target == MODE_LINE_NOPROP |
| 21470 | mode_line_target == MODE_LINE_STRING) | 21471 | || mode_line_target == MODE_LINE_STRING) |
| 21471 | return "--"; | 21472 | return "--"; |
| 21472 | if (field_width <= 0 | 21473 | if (field_width <= 0 |
| 21473 | || field_width > sizeof (lots_of_dashes)) | 21474 | || field_width > sizeof (lots_of_dashes)) |