aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlenn Morris2012-11-10 15:13:33 -0800
committerGlenn Morris2012-11-10 15:13:33 -0800
commit6baf66d53bbedd85a443e0d69d1f4311a93f0677 (patch)
tree38d7a00d5f7d5aecb86285d334fa15a31e5fbab1 /src
parent05a859c1bd9cd07b2c0fad06a0694e88ea929fcf (diff)
parente4e46889223296e8875548d278340b21db449a4a (diff)
downloademacs-6baf66d53bbedd85a443e0d69d1f4311a93f0677.tar.gz
emacs-6baf66d53bbedd85a443e0d69d1f4311a93f0677.zip
Merge from emacs-24; up to 2012-11-08T14:54:03Z!monnier@iro.umontreal.ca
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog21
-rw-r--r--src/ralloc.c34
-rw-r--r--src/window.c13
-rw-r--r--src/xdisp.c40
4 files changed, 70 insertions, 38 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index da3e96bbcc3..46f086389fe 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,24 @@
12012-11-10 Martin Rudalics <rudalics@gmx.at>
2
3 * window.c (Fsplit_window_internal): Set combination limit of
4 new parent window to t iff Vwindow_combination_limit is t;
5 fixing a regression introduced with the change from 2012-09-22.
6 (Fset_window_combination_limit): Fix doc-string.
7
82012-11-10 Eli Zaretskii <eliz@gnu.org>
9
10 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
11 amount when the scroll margins are too large. When scrolling
12 backwards in the buffer, give up if cannot reach point or the
13 scroll margin within a reasonable number of screen lines. Fixes
14 point position in window under scroll-up/down-aggressively when
15 point is positioned many lines beyond the window top/bottom.
16 (Bug#12811)
17
18 * ralloc.c (relinquish): If real_morecore fails to return memory
19 to the system, don't crash; instead, leave the last heap
20 unchanged and return. (Bug#12774)
21
12012-11-09 Stefan Monnier <monnier@iro.umontreal.ca> 222012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
2 23
3 * lisp.h (AUTOLOADP): New macro. 24 * lisp.h (AUTOLOADP): New macro.
diff --git a/src/ralloc.c b/src/ralloc.c
index 11897411930..e5bf76b0e6d 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -327,6 +327,8 @@ relinquish (void)
327 327
328 if ((char *)last_heap->end - (char *)last_heap->bloc_start <= excess) 328 if ((char *)last_heap->end - (char *)last_heap->bloc_start <= excess)
329 { 329 {
330 heap_ptr lh_prev;
331
330 /* This heap should have no blocs in it. If it does, we 332 /* This heap should have no blocs in it. If it does, we
331 cannot return it to the system. */ 333 cannot return it to the system. */
332 if (last_heap->first_bloc != NIL_BLOC 334 if (last_heap->first_bloc != NIL_BLOC
@@ -335,28 +337,26 @@ relinquish (void)
335 337
336 /* Return the last heap, with its header, to the system. */ 338 /* Return the last heap, with its header, to the system. */
337 excess = (char *)last_heap->end - (char *)last_heap->start; 339 excess = (char *)last_heap->end - (char *)last_heap->start;
338 last_heap = last_heap->prev; 340 lh_prev = last_heap->prev;
339 last_heap->next = NIL_HEAP; 341 /* If the system doesn't want that much memory back, leave
342 last_heap unaltered to reflect that. This can occur if
343 break_value is still within the original data segment. */
344 if ((*real_morecore) (- excess) != 0)
345 {
346 last_heap = lh_prev;
347 last_heap->next = NIL_HEAP;
348 }
340 } 349 }
341 else 350 else
342 { 351 {
343 excess = (char *) last_heap->end 352 excess = (char *) last_heap->end
344 - (char *) ROUNDUP ((char *)last_heap->end - excess); 353 - (char *) ROUNDUP ((char *)last_heap->end - excess);
345 last_heap->end = (char *) last_heap->end - excess; 354 /* If the system doesn't want that much memory back, leave
346 } 355 the end of the last heap unchanged to reflect that. This
347 356 can occur if break_value is still within the original
348 if ((*real_morecore) (- excess) == 0) 357 data segment. */
349 { 358 if ((*real_morecore) (- excess) != 0)
350 /* If the system didn't want that much memory back, adjust 359 last_heap->end = (char *) last_heap->end - excess;
351 the end of the last heap to reflect that. This can occur
352 if break_value is still within the original data segment. */
353 last_heap->end = (char *) last_heap->end + excess;
354 /* Make sure that the result of the adjustment is accurate.
355 It should be, for the else clause above; the other case,
356 which returns the entire last heap to the system, seems
357 unlikely to trigger this mode of failure. */
358 if (last_heap->end != (*real_morecore) (0))
359 emacs_abort ();
360 } 360 }
361 } 361 }
362} 362}
diff --git a/src/window.c b/src/window.c
index 197f4916bc2..99498642710 100644
--- a/src/window.c
+++ b/src/window.c
@@ -618,11 +618,13 @@ internal windows only. */)
618 618
619DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0, 619DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0,
620 doc: /* Set combination limit of window WINDOW to LIMIT; return LIMIT. 620 doc: /* Set combination limit of window WINDOW to LIMIT; return LIMIT.
621WINDOW must be a valid window and defaults to the selected one.
622If LIMIT is nil, child windows of WINDOW can be recombined with WINDOW's 621If LIMIT is nil, child windows of WINDOW can be recombined with WINDOW's
623siblings. LIMIT t means that child windows of WINDOW are never 622siblings. LIMIT t means that child windows of WINDOW are never
624\(re-)combined with WINDOW's siblings. Other values are reserved for 623\(re-)combined with WINDOW's siblings. Other values are reserved for
625future use. */) 624future use.
625
626WINDOW must be a valid window. Setting the combination limit is
627meaningful for internal windows only. */)
626 (Lisp_Object window, Lisp_Object limit) 628 (Lisp_Object window, Lisp_Object limit)
627{ 629{
628 wset_combination_limit (decode_valid_window (window), limit); 630 wset_combination_limit (decode_valid_window (window), limit);
@@ -3869,9 +3871,10 @@ set correctly. See the code of `split-window' for how this is done. */)
3869 3871
3870 make_parent_window (old, horflag); 3872 make_parent_window (old, horflag);
3871 p = XWINDOW (o->parent); 3873 p = XWINDOW (o->parent);
3872 /* Store t in the new parent's combination_limit slot to avoid 3874 if (EQ (Vwindow_combination_limit, Qt))
3873 that its children get merged into another window. */ 3875 /* Store t in the new parent's combination_limit slot to avoid
3874 wset_combination_limit (p, Qt); 3876 that its children get merged into another window. */
3877 wset_combination_limit (p, Qt);
3875 /* These get applied below. */ 3878 /* These get applied below. */
3876 wset_new_total (p, horflag ? o->total_cols : o->total_lines); 3879 wset_new_total (p, horflag ? o->total_cols : o->total_lines);
3877 wset_new_normal (p, new_normal); 3880 wset_new_normal (p, new_normal);
diff --git a/src/xdisp.c b/src/xdisp.c
index c01f5deab83..46d942ce441 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -14786,13 +14786,18 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
14786 if (NUMBERP (aggressive)) 14786 if (NUMBERP (aggressive))
14787 { 14787 {
14788 double float_amount = XFLOATINT (aggressive) * height; 14788 double float_amount = XFLOATINT (aggressive) * height;
14789 amount_to_scroll = float_amount; 14789 int aggressive_scroll = float_amount;
14790 if (amount_to_scroll == 0 && float_amount > 0) 14790 if (aggressive_scroll == 0 && float_amount > 0)
14791 amount_to_scroll = 1; 14791 aggressive_scroll = 1;
14792 /* Don't let point enter the scroll margin near top of 14792 /* Don't let point enter the scroll margin near top of
14793 the window. */ 14793 the window. This could happen if the value of
14794 if (amount_to_scroll > height - 2*this_scroll_margin + dy) 14794 scroll_up_aggressively is too large and there are
14795 amount_to_scroll = height - 2*this_scroll_margin + dy; 14795 non-zero margins, because scroll_up_aggressively
14796 means put point that fraction of window height
14797 _from_the_bottom_margin_. */
14798 if (aggressive_scroll + 2*this_scroll_margin > height)
14799 aggressive_scroll = height - 2*this_scroll_margin;
14800 amount_to_scroll = dy + aggressive_scroll;
14796 } 14801 }
14797 } 14802 }
14798 14803
@@ -14852,7 +14857,8 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
14852 /* Compute the vertical distance from PT to the scroll 14857 /* Compute the vertical distance from PT to the scroll
14853 margin position. Move as far as scroll_max allows, or 14858 margin position. Move as far as scroll_max allows, or
14854 one screenful, or 10 screen lines, whichever is largest. 14859 one screenful, or 10 screen lines, whichever is largest.
14855 Give up if distance is greater than scroll_max. */ 14860 Give up if distance is greater than scroll_max or if we
14861 didn't reach the scroll margin position. */
14856 SET_TEXT_POS (pos, PT, PT_BYTE); 14862 SET_TEXT_POS (pos, PT, PT_BYTE);
14857 start_display (&it, w, pos); 14863 start_display (&it, w, pos);
14858 y0 = it.current_y; 14864 y0 = it.current_y;
@@ -14862,7 +14868,8 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
14862 y_to_move, -1, 14868 y_to_move, -1,
14863 MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); 14869 MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
14864 dy = it.current_y - y0; 14870 dy = it.current_y - y0;
14865 if (dy > scroll_max) 14871 if (dy > scroll_max
14872 || IT_CHARPOS (it) < CHARPOS (scroll_margin_pos))
14866 return SCROLLING_FAILED; 14873 return SCROLLING_FAILED;
14867 14874
14868 /* Compute new window start. */ 14875 /* Compute new window start. */
@@ -14880,15 +14887,16 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
14880 if (NUMBERP (aggressive)) 14887 if (NUMBERP (aggressive))
14881 { 14888 {
14882 double float_amount = XFLOATINT (aggressive) * height; 14889 double float_amount = XFLOATINT (aggressive) * height;
14883 amount_to_scroll = float_amount; 14890 int aggressive_scroll = float_amount;
14884 if (amount_to_scroll == 0 && float_amount > 0) 14891 if (aggressive_scroll == 0 && float_amount > 0)
14885 amount_to_scroll = 1; 14892 aggressive_scroll = 1;
14886 amount_to_scroll -=
14887 this_scroll_margin - dy - FRAME_LINE_HEIGHT (f);
14888 /* Don't let point enter the scroll margin near 14893 /* Don't let point enter the scroll margin near
14889 bottom of the window. */ 14894 bottom of the window, if the value of
14890 if (amount_to_scroll > height - 2*this_scroll_margin + dy) 14895 scroll_down_aggressively happens to be too
14891 amount_to_scroll = height - 2*this_scroll_margin + dy; 14896 large. */
14897 if (aggressive_scroll + 2*this_scroll_margin > height)
14898 aggressive_scroll = height - 2*this_scroll_margin;
14899 amount_to_scroll = dy + aggressive_scroll;
14892 } 14900 }
14893 } 14901 }
14894 14902