aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2003-11-23 21:47:24 +0000
committerKim F. Storm2003-11-23 21:47:24 +0000
commite661376d0b1e44164abc1ed0e46a909ffdd39b3e (patch)
tree100a5a3e3f936f6b00738e969ee3d268770b6e9e
parent6a1ff3ba09aca7f30b132ad65973506cf0416b53 (diff)
downloademacs-e661376d0b1e44164abc1ed0e46a909ffdd39b3e.tar.gz
emacs-e661376d0b1e44164abc1ed0e46a909ffdd39b3e.zip
(enum window_loop): Add REDISPLAY_BUFFER_WINDOWS.
(window_loop): Handle REDISPLAY_BUFFER_WINDOWS. (Fforce_window_update): New defun. (syms_of_window): Defsubr it. (Fset_window_margins, Fset_window_fringes): Doc fix.
-rw-r--r--src/window.c75
1 files changed, 61 insertions, 14 deletions
diff --git a/src/window.c b/src/window.c
index e20dc2ae037..3c0f3a17439 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1829,6 +1829,7 @@ enum window_loop
1829 DELETE_BUFFER_WINDOWS, /* Arg is buffer */ 1829 DELETE_BUFFER_WINDOWS, /* Arg is buffer */
1830 GET_LARGEST_WINDOW, 1830 GET_LARGEST_WINDOW,
1831 UNSHOW_BUFFER, /* Arg is buffer */ 1831 UNSHOW_BUFFER, /* Arg is buffer */
1832 REDISPLAY_BUFFER_WINDOWS, /* Arg is buffer */
1832 CHECK_ALL_WINDOWS 1833 CHECK_ALL_WINDOWS
1833}; 1834};
1834 1835
@@ -2027,6 +2028,14 @@ window_loop (type, obj, mini, frames)
2027 } 2028 }
2028 break; 2029 break;
2029 2030
2031 case REDISPLAY_BUFFER_WINDOWS:
2032 if (EQ (w->buffer, obj))
2033 {
2034 mark_window_display_accurate (window, 0);
2035 best_window = window;
2036 }
2037 break;
2038
2030 /* Check for a window that has a killed buffer. */ 2039 /* Check for a window that has a killed buffer. */
2031 case CHECK_ALL_WINDOWS: 2040 case CHECK_ALL_WINDOWS:
2032 if (! NILP (w->buffer) 2041 if (! NILP (w->buffer)
@@ -3428,6 +3437,46 @@ displayed. */)
3428 return display_buffer_1 (window); 3437 return display_buffer_1 (window);
3429} 3438}
3430 3439
3440
3441DEFUN ("force-window-update", Fforce_window_update, Sforce_window_update,
3442 0, 1, 0,
3443 doc: /* Force redisplay of all windows.
3444If optional arg OBJECT is a window, force redisplay of that window only.
3445If OBJECT is a buffer or buffer name, force redisplay of all windows
3446displaying that buffer. */)
3447 (object)
3448 Lisp_Object object;
3449{
3450 if (NILP (object))
3451 {
3452 windows_or_buffers_changed++;
3453 return Qt;
3454 }
3455
3456 if (WINDOWP (object))
3457 {
3458 mark_window_display_accurate (object, 0);
3459 return Qt;
3460 }
3461
3462 if (STRINGP (object))
3463 object = Fget_buffer (object);
3464 if (BUFFERP (object) && !NILP (XBUFFER (object)->name))
3465 {
3466 /* Walk all windows looking for buffer, and force update
3467 of each of those windows. */
3468
3469 object = window_loop (REDISPLAY_BUFFER_WINDOWS, object, 0, Qvisible);
3470 return NILP (object) ? Qnil : Qt;
3471 }
3472
3473 /* If nothing suitable was found, just return.
3474 We could signal an error, but this feature will typically be used
3475 asynchronously in timers or process sentinels, so we don't. */
3476 return Qnil;
3477}
3478
3479
3431void 3480void
3432temp_output_buffer_show (buf) 3481temp_output_buffer_show (buf)
3433 register Lisp_Object buf; 3482 register Lisp_Object buf;
@@ -5844,11 +5893,11 @@ usage: (save-window-excursion BODY ...) */)
5844DEFUN ("set-window-margins", Fset_window_margins, Sset_window_margins, 5893DEFUN ("set-window-margins", Fset_window_margins, Sset_window_margins,
5845 2, 3, 0, 5894 2, 3, 0,
5846 doc: /* Set width of marginal areas of window WINDOW. 5895 doc: /* Set width of marginal areas of window WINDOW.
5847If window is nil, set margins of the currently selected window. 5896If WINDOW is nil, set margins of the currently selected window.
5848First parameter LEFT-WIDTH specifies the number of character 5897Second arg LEFT-WIDTH specifies the number of character cells to
5849cells to reserve for the left marginal area. Second parameter 5898reserve for the left marginal area. Optional third arg RIGHT-WIDTH
5850RIGHT-WIDTH does the same for the right marginal area. 5899does the same for the right marginal area. A nil width parameter
5851A nil width parameter means no margin. */) 5900means no margin. */)
5852 (window, left, right) 5901 (window, left, right)
5853 Lisp_Object window, left, right; 5902 Lisp_Object window, left, right;
5854{ 5903{
@@ -5910,17 +5959,14 @@ as nil. */)
5910DEFUN ("set-window-fringes", Fset_window_fringes, Sset_window_fringes, 5959DEFUN ("set-window-fringes", Fset_window_fringes, Sset_window_fringes,
5911 2, 4, 0, 5960 2, 4, 0,
5912 doc: /* Set the fringe widths of window WINDOW. 5961 doc: /* Set the fringe widths of window WINDOW.
5913
5914If WINDOW is nil, set the fringe widths of the currently selected 5962If WINDOW is nil, set the fringe widths of the currently selected
5915window. 5963window.
5916 5964Second arg LEFT-WIDTH specifies the number of pixels to reserve for
5917The second parameter LEFT-WIDTH specifies the number of pixels to 5965the left fringe. Optional third arg RIGHT-WIDTH specifies the right
5918reserve for the left fringe. The third parameter RIGHT-WIDTH 5966fringe width. If a fringe width arg is nil, that means to use the
5919specifies the right fringe width. If a fringe width parameter is nil, 5967frame's default fringe width. Default fringe widths can be set with
5920that means to use the frame's default fringe width. Default fringe 5968the command `set-fringe-style'.
5921widths can be set with the command `set-fringe-style'. 5969If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes
5922
5923If the fourth parameter OUTSIDE-MARGINS is non-nil, draw the fringes
5924outside of the display margins. By default, fringes are drawn between 5970outside of the display margins. By default, fringes are drawn between
5925display marginal areas and the text area. */) 5971display marginal areas and the text area. */)
5926 (window, left, right, outside_margins) 5972 (window, left, right, outside_margins)
@@ -6605,6 +6651,7 @@ This variable automatically becomes buffer-local when set. */);
6605 defsubr (&Sspecial_display_p); 6651 defsubr (&Sspecial_display_p);
6606 defsubr (&Ssame_window_p); 6652 defsubr (&Ssame_window_p);
6607 defsubr (&Sdisplay_buffer); 6653 defsubr (&Sdisplay_buffer);
6654 defsubr (&Sforce_window_update);
6608 defsubr (&Ssplit_window); 6655 defsubr (&Ssplit_window);
6609 defsubr (&Senlarge_window); 6656 defsubr (&Senlarge_window);
6610 defsubr (&Sshrink_window); 6657 defsubr (&Sshrink_window);