diff options
| author | Kim F. Storm | 2003-11-23 21:47:24 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2003-11-23 21:47:24 +0000 |
| commit | e661376d0b1e44164abc1ed0e46a909ffdd39b3e (patch) | |
| tree | 100a5a3e3f936f6b00738e969ee3d268770b6e9e | |
| parent | 6a1ff3ba09aca7f30b132ad65973506cf0416b53 (diff) | |
| download | emacs-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.c | 75 |
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 | |||
| 3441 | DEFUN ("force-window-update", Fforce_window_update, Sforce_window_update, | ||
| 3442 | 0, 1, 0, | ||
| 3443 | doc: /* Force redisplay of all windows. | ||
| 3444 | If optional arg OBJECT is a window, force redisplay of that window only. | ||
| 3445 | If OBJECT is a buffer or buffer name, force redisplay of all windows | ||
| 3446 | displaying 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 | |||
| 3431 | void | 3480 | void |
| 3432 | temp_output_buffer_show (buf) | 3481 | temp_output_buffer_show (buf) |
| 3433 | register Lisp_Object buf; | 3482 | register Lisp_Object buf; |
| @@ -5844,11 +5893,11 @@ usage: (save-window-excursion BODY ...) */) | |||
| 5844 | DEFUN ("set-window-margins", Fset_window_margins, Sset_window_margins, | 5893 | DEFUN ("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. |
| 5847 | If window is nil, set margins of the currently selected window. | 5896 | If WINDOW is nil, set margins of the currently selected window. |
| 5848 | First parameter LEFT-WIDTH specifies the number of character | 5897 | Second arg LEFT-WIDTH specifies the number of character cells to |
| 5849 | cells to reserve for the left marginal area. Second parameter | 5898 | reserve for the left marginal area. Optional third arg RIGHT-WIDTH |
| 5850 | RIGHT-WIDTH does the same for the right marginal area. | 5899 | does the same for the right marginal area. A nil width parameter |
| 5851 | A nil width parameter means no margin. */) | 5900 | means 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. */) | |||
| 5910 | DEFUN ("set-window-fringes", Fset_window_fringes, Sset_window_fringes, | 5959 | DEFUN ("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 | |||
| 5914 | If WINDOW is nil, set the fringe widths of the currently selected | 5962 | If WINDOW is nil, set the fringe widths of the currently selected |
| 5915 | window. | 5963 | window. |
| 5916 | 5964 | Second arg LEFT-WIDTH specifies the number of pixels to reserve for | |
| 5917 | The second parameter LEFT-WIDTH specifies the number of pixels to | 5965 | the left fringe. Optional third arg RIGHT-WIDTH specifies the right |
| 5918 | reserve for the left fringe. The third parameter RIGHT-WIDTH | 5966 | fringe width. If a fringe width arg is nil, that means to use the |
| 5919 | specifies the right fringe width. If a fringe width parameter is nil, | 5967 | frame's default fringe width. Default fringe widths can be set with |
| 5920 | that means to use the frame's default fringe width. Default fringe | 5968 | the command `set-fringe-style'. |
| 5921 | widths can be set with the command `set-fringe-style'. | 5969 | If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes |
| 5922 | |||
| 5923 | If the fourth parameter OUTSIDE-MARGINS is non-nil, draw the fringes | ||
| 5924 | outside of the display margins. By default, fringes are drawn between | 5970 | outside of the display margins. By default, fringes are drawn between |
| 5925 | display marginal areas and the text area. */) | 5971 | display 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); |