aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorPaul Eggert2011-12-10 16:56:50 -0800
committerPaul Eggert2011-12-10 16:56:50 -0800
commit8f50130c565eaf0ad7c49e4ad044c3291ecdfa71 (patch)
treec8129448cbbf387fe82667ccac02983592c688f1 /src/window.c
parent85a83e2e2585a1906dec5168ed96ad521b5849ed (diff)
parent7b9d523a07395ecea505be88f45c33d73aea7038 (diff)
downloademacs-8f50130c565eaf0ad7c49e4ad044c3291ecdfa71.tar.gz
emacs-8f50130c565eaf0ad7c49e4ad044c3291ecdfa71.zip
Merge from trunk.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c66
1 files changed, 40 insertions, 26 deletions
diff --git a/src/window.c b/src/window.c
index 60d17c74de3..3b9705444f9 100644
--- a/src/window.c
+++ b/src/window.c
@@ -465,10 +465,8 @@ Return nil if WINDOW has no previous sibling. */)
465 return decode_any_window (window)->prev; 465 return decode_any_window (window)->prev;
466} 466}
467 467
468DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 0, 1, 0, 468DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0,
469 doc: /* Return combination limit of window WINDOW. 469 doc: /* Return combination limit of window WINDOW.
470If WINDOW is omitted or nil, it defaults to the selected window.
471
472If the return value is nil, child windows of WINDOW can be recombined with 470If the return value is nil, child windows of WINDOW can be recombined with
473WINDOW's siblings. A return value of t means that child windows of 471WINDOW's siblings. A return value of t means that child windows of
474WINDOW are never \(re-)combined with WINDOW's siblings. */) 472WINDOW are never \(re-)combined with WINDOW's siblings. */)
@@ -478,18 +476,16 @@ WINDOW are never \(re-)combined with WINDOW's siblings. */)
478} 476}
479 477
480DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0, 478DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0,
481 doc: /* Set combination limit of window WINDOW to STATUS; return STATUS. 479 doc: /* Set combination limit of window WINDOW to LIMIT; return LIMIT.
482If WINDOW is omitted or nil, it defaults to the selected window. 480If LIMIT is nil, child windows of WINDOW can be recombined with
483 481WINDOW's siblings. LIMIT t means that child windows of WINDOW are
484If STATUS is nil, child windows of WINDOW can be recombined with
485WINDOW's siblings. STATUS t means that child windows of WINDOW are
486never \(re-)combined with WINDOW's siblings. Other values are reserved 482never \(re-)combined with WINDOW's siblings. Other values are reserved
487for future use. */) 483for future use. */)
488 (Lisp_Object window, Lisp_Object status) 484 (Lisp_Object window, Lisp_Object limit)
489{ 485{
490 register struct window *w = decode_any_window (window); 486 register struct window *w = decode_any_window (window);
491 487
492 w->combination_limit = status; 488 w->combination_limit = limit;
493 489
494 return w->combination_limit; 490 return w->combination_limit;
495} 491}
@@ -1056,6 +1052,7 @@ window_relative_x_coord (struct window *w, enum window_part part, int x)
1056DEFUN ("coordinates-in-window-p", Fcoordinates_in_window_p, 1052DEFUN ("coordinates-in-window-p", Fcoordinates_in_window_p,
1057 Scoordinates_in_window_p, 2, 2, 0, 1053 Scoordinates_in_window_p, 2, 2, 0,
1058 doc: /* Return non-nil if COORDINATES are in WINDOW. 1054 doc: /* Return non-nil if COORDINATES are in WINDOW.
1055WINDOW must be a live window.
1059COORDINATES is a cons of the form (X . Y), X and Y being distances 1056COORDINATES is a cons of the form (X . Y), X and Y being distances
1060measured in characters from the upper-left corner of the frame. 1057measured in characters from the upper-left corner of the frame.
1061\(0 . 0) denotes the character in the upper left corner of the 1058\(0 . 0) denotes the character in the upper left corner of the
@@ -1077,7 +1074,7 @@ If they are in the windows's left or right marginal areas, `left-margin'\n\
1077 int x, y; 1074 int x, y;
1078 Lisp_Object lx, ly; 1075 Lisp_Object lx, ly;
1079 1076
1080 CHECK_WINDOW (window); 1077 CHECK_LIVE_WINDOW (window);
1081 w = XWINDOW (window); 1078 w = XWINDOW (window);
1082 f = XFRAME (w->frame); 1079 f = XFRAME (w->frame);
1083 CHECK_CONS (coordinates); 1080 CHECK_CONS (coordinates);
@@ -2186,7 +2183,7 @@ next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames, in
2186 2183
2187 2184
2188DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0, 2185DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0,
2189 doc: /* Return window following WINDOW in cyclic ordering of windows. 2186 doc: /* Return live window after WINDOW in the cyclic ordering of windows.
2190WINDOW must be a live window and defaults to the selected one. The 2187WINDOW must be a live window and defaults to the selected one. The
2191optional arguments MINIBUF and ALL-FRAMES specify the set of windows to 2188optional arguments MINIBUF and ALL-FRAMES specify the set of windows to
2192consider. 2189consider.
@@ -2225,7 +2222,7 @@ windows, eventually ending up back at the window you started with.
2225 2222
2226 2223
2227DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0, 2224DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0,
2228 doc: /* Return window preceding WINDOW in cyclic ordering of windows. 2225 doc: /* Return live window before WINDOW in the cyclic ordering of windows.
2229WINDOW must be a live window and defaults to the selected one. The 2226WINDOW must be a live window and defaults to the selected one. The
2230optional arguments MINIBUF and ALL-FRAMES specify the set of windows to 2227optional arguments MINIBUF and ALL-FRAMES specify the set of windows to
2231consider. 2228consider.
@@ -3092,7 +3089,7 @@ This function runs `window-scroll-functions' before running
3092 error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name))); 3089 error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name)));
3093 else 3090 else
3094 /* WINDOW is weakly dedicated to its buffer, reset 3091 /* WINDOW is weakly dedicated to its buffer, reset
3095 dedicatedness. */ 3092 dedication. */
3096 w->dedicated = Qnil; 3093 w->dedicated = Qnil;
3097 3094
3098 call1 (Qrecord_window_buffer, window); 3095 call1 (Qrecord_window_buffer, window);
@@ -5772,20 +5769,37 @@ get_leaf_windows (struct window *w, struct window **flat, int i)
5772 5769
5773 5770
5774/* Return a pointer to the glyph W's physical cursor is on. Value is 5771/* Return a pointer to the glyph W's physical cursor is on. Value is
5775 null if W's current matrix is invalid, so that no meaningfull glyph 5772 null if W's current matrix is invalid, so that no meaningful glyph
5776 can be returned. */ 5773 can be returned. */
5777struct glyph * 5774struct glyph *
5778get_phys_cursor_glyph (struct window *w) 5775get_phys_cursor_glyph (struct window *w)
5779{ 5776{
5780 struct glyph_row *row; 5777 struct glyph_row *row;
5781 struct glyph *glyph; 5778 struct glyph *glyph;
5779 int hpos = w->phys_cursor.hpos;
5780
5781 if (!(w->phys_cursor.vpos >= 0
5782 && w->phys_cursor.vpos < w->current_matrix->nrows))
5783 return NULL;
5784
5785 row = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos);
5786 if (!row->enabled_p)
5787 return NULL;
5788
5789 if (XINT (w->hscroll))
5790 {
5791 /* When the window is hscrolled, cursor hpos can legitimately be
5792 out of bounds, but we draw the cursor at the corresponding
5793 window margin in that case. */
5794 if (!row->reversed_p && hpos < 0)
5795 hpos = 0;
5796 if (row->reversed_p && hpos >= row->used[TEXT_AREA])
5797 hpos = row->used[TEXT_AREA] - 1;
5798 }
5782 5799
5783 if (w->phys_cursor.vpos >= 0 5800 if (row->used[TEXT_AREA] > hpos
5784 && w->phys_cursor.vpos < w->current_matrix->nrows 5801 && 0 <= hpos)
5785 && (row = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos), 5802 glyph = row->glyphs[TEXT_AREA] + hpos;
5786 row->enabled_p)
5787 && row->used[TEXT_AREA] > w->phys_cursor.hpos)
5788 glyph = row->glyphs[TEXT_AREA] + w->phys_cursor.hpos;
5789 else 5803 else
5790 glyph = NULL; 5804 glyph = NULL;
5791 5805
@@ -6287,7 +6301,7 @@ freeze_window_starts (struct frame *f, int freeze_p)
6287 ignore_positions non-zero means ignore non-matching scroll positions 6301 ignore_positions non-zero means ignore non-matching scroll positions
6288 and the like. 6302 and the like.
6289 6303
6290 This ignores a couple of things like the dedicatedness status of 6304 This ignores a couple of things like the dedication status of
6291 window, combination_limit and the like. This might have to be 6305 window, combination_limit and the like. This might have to be
6292 fixed. */ 6306 fixed. */
6293 6307
@@ -6521,10 +6535,10 @@ sibling.
6521 6535
6522Other values are reserved for future use. 6536Other values are reserved for future use.
6523 6537
6524The value of this variable is also assigned to the combination-limit 6538The value of this variable is also assigned to the combination limit of
6525status of the new parent window. The combination-limit status of a 6539the new parent window. The combination limit of a window can be
6526window can be retrieved via the function `window-combination-limit' and 6540retrieved via the function `window-combination-limit' and altered by the
6527altered by the function `set-window-combination-limit'. */); 6541function `set-window-combination-limit'. */);
6528 Vwindow_combination_limit = Qnil; 6542 Vwindow_combination_limit = Qnil;
6529 6543
6530 defsubr (&Sselected_window); 6544 defsubr (&Sselected_window);