diff options
| author | Joakim Verona | 2011-11-22 15:46:22 +0100 |
|---|---|---|
| committer | Joakim Verona | 2011-11-22 15:46:22 +0100 |
| commit | a9c1e05adddf6011c61c0df582c5f2ed423f35c8 (patch) | |
| tree | 489fac119296416ba2f3530fd3bcb70efbbbdaa6 /src/window.c | |
| parent | 40bb789236e486a3f36eefb2840c293369ce2af3 (diff) | |
| parent | b5afc20930c91159a1cbf629bcaa7e251653dc74 (diff) | |
| download | emacs-a9c1e05adddf6011c61c0df582c5f2ed423f35c8.tar.gz emacs-a9c1e05adddf6011c61c0df582c5f2ed423f35c8.zip | |
upstream
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 57 |
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 | ||
| 470 | DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 0, 1, 0, | 470 | DEFUN ("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. |
| 472 | If WINDOW is omitted or nil, it defaults to the selected window. | ||
| 473 | |||
| 474 | If the return value is nil, child windows of WINDOW can be recombined with | 472 | If the return value is nil, child windows of WINDOW can be recombined with |
| 475 | WINDOW's siblings. A return value of t means that child windows of | 473 | WINDOW's siblings. A return value of t means that child windows of |
| 476 | WINDOW are never \(re-)combined with WINDOW's siblings. */) | 474 | WINDOW 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 | ||
| 482 | DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0, | 480 | DEFUN ("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. |
| 484 | If WINDOW is omitted or nil, it defaults to the selected window. | 482 | If LIMIT is nil, child windows of WINDOW can be recombined with |
| 485 | 483 | WINDOW's siblings. LIMIT t means that child windows of WINDOW are | |
| 486 | If STATUS is nil, child windows of WINDOW can be recombined with | ||
| 487 | WINDOW's siblings. STATUS t means that child windows of WINDOW are | ||
| 488 | never \(re-)combined with WINDOW's siblings. Other values are reserved | 484 | never \(re-)combined with WINDOW's siblings. Other values are reserved |
| 489 | for future use. */) | 485 | for 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 | ||
| 2189 | DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0, | 2185 | DEFUN ("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. |
| 2191 | WINDOW must be a live window and defaults to the selected one. The | 2187 | WINDOW must be a live window and defaults to the selected one. The |
| 2192 | optional arguments MINIBUF and ALL-FRAMES specify the set of windows to | 2188 | optional arguments MINIBUF and ALL-FRAMES specify the set of windows to |
| 2193 | consider. | 2189 | consider. |
| @@ -2226,7 +2222,7 @@ windows, eventually ending up back at the window you started with. | |||
| 2226 | 2222 | ||
| 2227 | 2223 | ||
| 2228 | DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0, | 2224 | DEFUN ("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. |
| 2230 | WINDOW must be a live window and defaults to the selected one. The | 2226 | WINDOW must be a live window and defaults to the selected one. The |
| 2231 | optional arguments MINIBUF and ALL-FRAMES specify the set of windows to | 2227 | optional arguments MINIBUF and ALL-FRAMES specify the set of windows to |
| 2232 | consider. | 2228 | consider. |
| @@ -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 | ||
| 6525 | Other values are reserved for future use. | 6538 | Other values are reserved for future use. |
| 6526 | 6539 | ||
| 6527 | The value of this variable is also assigned to the combination-limit | 6540 | The value of this variable is also assigned to the combination limit of |
| 6528 | status of the new parent window. The combination-limit status of a | 6541 | the new parent window. The combination limit of a window can be |
| 6529 | window can be retrieved via the function `window-combination-limit' and | 6542 | retrieved via the function `window-combination-limit' and altered by the |
| 6530 | altered by the function `set-window-combination-limit'. */); | 6543 | function `set-window-combination-limit'. */); |
| 6531 | Vwindow_combination_limit = Qnil; | 6544 | Vwindow_combination_limit = Qnil; |
| 6532 | 6545 | ||
| 6533 | defsubr (&Sselected_window); | 6546 | defsubr (&Sselected_window); |