aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c57
1 files changed, 35 insertions, 22 deletions
diff --git a/src/window.c b/src/window.c
index a7daa1353bd..728e811f304 100644
--- a/src/window.c
+++ b/src/window.c
@@ -467,10 +467,8 @@ Return nil if WINDOW has no previous sibling. */)
467 return decode_any_window (window)->prev; 467 return decode_any_window (window)->prev;
468} 468}
469 469
470DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 0, 1, 0, 470DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0,
471 doc: /* Return combination limit of window WINDOW. 471 doc: /* Return combination limit of window WINDOW.
472If WINDOW is omitted or nil, it defaults to the selected window.
473
474If the return value is nil, child windows of WINDOW can be recombined with 472If the return value is nil, child windows of WINDOW can be recombined with
475WINDOW's siblings. A return value of t means that child windows of 473WINDOW's siblings. A return value of t means that child windows of
476WINDOW are never \(re-)combined with WINDOW's siblings. */) 474WINDOW are never \(re-)combined with WINDOW's siblings. */)
@@ -480,18 +478,16 @@ WINDOW are never \(re-)combined with WINDOW's siblings. */)
480} 478}
481 479
482DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0, 480DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0,
483 doc: /* Set combination limit of window WINDOW to STATUS; return STATUS. 481 doc: /* Set combination limit of window WINDOW to LIMIT; return LIMIT.
484If WINDOW is omitted or nil, it defaults to the selected window. 482If LIMIT is nil, child windows of WINDOW can be recombined with
485 483WINDOW's siblings. LIMIT t means that child windows of WINDOW are
486If STATUS is nil, child windows of WINDOW can be recombined with
487WINDOW's siblings. STATUS t means that child windows of WINDOW are
488never \(re-)combined with WINDOW's siblings. Other values are reserved 484never \(re-)combined with WINDOW's siblings. Other values are reserved
489for future use. */) 485for future use. */)
490 (Lisp_Object window, Lisp_Object status) 486 (Lisp_Object window, Lisp_Object limit)
491{ 487{
492 register struct window *w = decode_any_window (window); 488 register struct window *w = decode_any_window (window);
493 489
494 w->combination_limit = status; 490 w->combination_limit = limit;
495 491
496 return w->combination_limit; 492 return w->combination_limit;
497} 493}
@@ -2187,7 +2183,7 @@ next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames, in
2187 2183
2188 2184
2189DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0, 2185DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0,
2190 doc: /* Return window following WINDOW in cyclic ordering of windows. 2186 doc: /* Return live window after WINDOW in the cyclic ordering of windows.
2191WINDOW 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
2192optional arguments MINIBUF and ALL-FRAMES specify the set of windows to 2188optional arguments MINIBUF and ALL-FRAMES specify the set of windows to
2193consider. 2189consider.
@@ -2226,7 +2222,7 @@ windows, eventually ending up back at the window you started with.
2226 2222
2227 2223
2228DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0, 2224DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0,
2229 doc: /* Return window preceding WINDOW in cyclic ordering of windows. 2225 doc: /* Return live window before WINDOW in the cyclic ordering of windows.
2230WINDOW 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
2231optional arguments MINIBUF and ALL-FRAMES specify the set of windows to 2227optional arguments MINIBUF and ALL-FRAMES specify the set of windows to
2232consider. 2228consider.
@@ -5782,13 +5778,30 @@ get_phys_cursor_glyph (struct window *w)
5782{ 5778{
5783 struct glyph_row *row; 5779 struct glyph_row *row;
5784 struct glyph *glyph; 5780 struct glyph *glyph;
5781 int hpos = w->phys_cursor.hpos;
5782
5783 if (!(w->phys_cursor.vpos >= 0
5784 && w->phys_cursor.vpos < w->current_matrix->nrows))
5785 return NULL;
5786
5787 row = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos);
5788 if (!row->enabled_p)
5789 return NULL;
5790
5791 if (XINT (w->hscroll))
5792 {
5793 /* When the window is hscrolled, cursor hpos can legitimately be
5794 out of bounds, but we draw the cursor at the corresponding
5795 window margin in that case. */
5796 if (!row->reversed_p && hpos < 0)
5797 hpos = 0;
5798 if (row->reversed_p && hpos >= row->used[TEXT_AREA])
5799 hpos = row->used[TEXT_AREA] - 1;
5800 }
5785 5801
5786 if (w->phys_cursor.vpos >= 0 5802 if (row->used[TEXT_AREA] > hpos
5787 && w->phys_cursor.vpos < w->current_matrix->nrows 5803 && 0 <= hpos)
5788 && (row = MATRIX_ROW (w->current_matrix, w->phys_cursor.vpos), 5804 glyph = row->glyphs[TEXT_AREA] + hpos;
5789 row->enabled_p)
5790 && row->used[TEXT_AREA] > w->phys_cursor.hpos)
5791 glyph = row->glyphs[TEXT_AREA] + w->phys_cursor.hpos;
5792 else 5805 else
5793 glyph = NULL; 5806 glyph = NULL;
5794 5807
@@ -6524,10 +6537,10 @@ sibling.
6524 6537
6525Other values are reserved for future use. 6538Other values are reserved for future use.
6526 6539
6527The value of this variable is also assigned to the combination-limit 6540The value of this variable is also assigned to the combination limit of
6528status of the new parent window. The combination-limit status of a 6541the new parent window. The combination limit of a window can be
6529window can be retrieved via the function `window-combination-limit' and 6542retrieved via the function `window-combination-limit' and altered by the
6530altered by the function `set-window-combination-limit'. */); 6543function `set-window-combination-limit'. */);
6531 Vwindow_combination_limit = Qnil; 6544 Vwindow_combination_limit = Qnil;
6532 6545
6533 defsubr (&Sselected_window); 6546 defsubr (&Sselected_window);