aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2012-12-13 18:01:48 +0100
committerJoakim Verona2012-12-13 18:01:48 +0100
commit825095bc26642bbe3d8dfc7c1da94682acddd92e (patch)
tree654e917c4667aa387224364013f77f13b4fd9cc4
parentd5190c9c532f9abd7dbdab094e69c16a3c66bd1a (diff)
parent893f52d89586fe46009ee077858f6ecd847e3e09 (diff)
downloademacs-825095bc26642bbe3d8dfc7c1da94682acddd92e.tar.gz
emacs-825095bc26642bbe3d8dfc7c1da94682acddd92e.zip
auto upstream
-rw-r--r--src/ChangeLog6
-rw-r--r--src/xdisp.c17
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 @@
12012-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
12012-12-13 Dmitry Antipov <dmantipov@yandex.ru> 72012-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 aa1657bd72c..552455059de 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2716,7 +2716,8 @@ init_iterator (struct it *it, struct window *w,
2716 /* If visible region is of non-zero length, set IT->region_beg_charpos 2716 /* If visible region is of non-zero length, set IT->region_beg_charpos
2717 and IT->region_end_charpos to the start and end of a visible region 2717 and IT->region_end_charpos to the start and end of a visible region
2718 in window IT->w. Set both to -1 to indicate no region. */ 2718 in window IT->w. Set both to -1 to indicate no region. */
2719 if ((markpos = markpos_of_region ()) != -1 2719 markpos = markpos_of_region ();
2720 if (0 <= markpos
2720 /* Maybe highlight only in selected window. */ 2721 /* Maybe highlight only in selected window. */
2721 && (/* Either show region everywhere. */ 2722 && (/* Either show region everywhere. */
2722 highlight_nonselected_windows 2723 highlight_nonselected_windows
@@ -10970,7 +10971,7 @@ buffer_shared_and_changed (void)
10970static int 10971static int
10971window_outdated (struct window *w) 10972window_outdated (struct window *w)
10972{ 10973{
10973 return (w->last_modified < MODIFF 10974 return (w->last_modified < MODIFF
10974 || w->last_overlay_modified < OVERLAY_MODIFF); 10975 || w->last_overlay_modified < OVERLAY_MODIFF);
10975} 10976}
10976 10977
@@ -15143,7 +15144,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
15143 /* Can't use this case if highlighting a region. When a 15144 /* Can't use this case if highlighting a region. When a
15144 region exists, cursor movement has to do more than just 15145 region exists, cursor movement has to do more than just
15145 set the cursor. */ 15146 set the cursor. */
15146 && (markpos_of_region () == -1) 15147 && markpos_of_region () < 0
15147 && NILP (w->region_showing) 15148 && NILP (w->region_showing)
15148 && NILP (Vshow_trailing_whitespace) 15149 && NILP (Vshow_trailing_whitespace)
15149 /* This code is not used for mini-buffer for the sake of the case 15150 /* This code is not used for mini-buffer for the sake of the case
@@ -15812,7 +15813,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15812 15813
15813 /* If we are highlighting the region, then we just changed 15814 /* If we are highlighting the region, then we just changed
15814 the region, so redisplay to show it. */ 15815 the region, so redisplay to show it. */
15815 if (markpos_of_region () != -1) 15816 if (0 <= markpos_of_region ())
15816 { 15817 {
15817 clear_glyph_matrix (w->desired_matrix); 15818 clear_glyph_matrix (w->desired_matrix);
15818 if (!try_window (window, startp, 0)) 15819 if (!try_window (window, startp, 0))
@@ -16531,7 +16532,7 @@ try_window_reusing_current_matrix (struct window *w)
16531 return 0; 16532 return 0;
16532 16533
16533 /* Can't do this if region may have changed. */ 16534 /* Can't do this if region may have changed. */
16534 if ((markpos_of_region () != -1) 16535 if (0 <= markpos_of_region ()
16535 || !NILP (w->region_showing) 16536 || !NILP (w->region_showing)
16536 || !NILP (Vshow_trailing_whitespace)) 16537 || !NILP (Vshow_trailing_whitespace))
16537 return 0; 16538 return 0;
@@ -17370,7 +17371,7 @@ try_window_id (struct window *w)
17370 17371
17371 /* Can't use this if highlighting a region because a cursor movement 17372 /* Can't use this if highlighting a region because a cursor movement
17372 will do more than just set the cursor. */ 17373 will do more than just set the cursor. */
17373 if (markpos_of_region () != -1) 17374 if (0 <= markpos_of_region ())
17374 GIVE_UP (9); 17375 GIVE_UP (9);
17375 17376
17376 /* Likewise if highlighting trailing whitespace. */ 17377 /* Likewise if highlighting trailing whitespace. */
@@ -21571,8 +21572,8 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21571 register int i; 21572 register int i;
21572 21573
21573 /* Let lots_of_dashes be a string of infinite length. */ 21574 /* Let lots_of_dashes be a string of infinite length. */
21574 if (mode_line_target == MODE_LINE_NOPROP || 21575 if (mode_line_target == MODE_LINE_NOPROP
21575 mode_line_target == MODE_LINE_STRING) 21576 || mode_line_target == MODE_LINE_STRING)
21576 return "--"; 21577 return "--";
21577 if (field_width <= 0 21578 if (field_width <= 0
21578 || field_width > sizeof (lots_of_dashes)) 21579 || field_width > sizeof (lots_of_dashes))