comparison src/window.c @ 3785:3455cbb3339d

Don't let the 'B' interactive spec default to buffers viewed in any visible frame. * buffer.c (Fother_buffer): Pass Qvisible as the second argument to Fget_buffer_window. * window.c (Qvisible): New symbol. (window_loop): In GET_BUFFER_WINDOW case, if frames is Qvisible, ignore non-visible frames. (Fget_buffer_window): Expand doc string to mention that Qvisible is an interesting value for FRAME argument. (syms_of_window): Init and staticpro Qvisible. * lisp.h (Qvisible): New declaration.
author Jim Blandy <jimb@redhat.com>
date Thu, 17 Jun 1993 00:39:37 +0000
parents bde2da377085
children c267c2431d92
comparison
equal deleted inserted replaced
3784:d2df5ca46b39 3785:3455cbb3339d
28 #include "termchar.h" 28 #include "termchar.h"
29 #include "disptab.h" 29 #include "disptab.h"
30 #include "keyboard.h" 30 #include "keyboard.h"
31 31
32 Lisp_Object Qwindowp, Qwindow_live_p; 32 Lisp_Object Qwindowp, Qwindow_live_p;
33 Lisp_Object Qvisible;
33 34
34 Lisp_Object Fnext_window (), Fdelete_window (), Fselect_window (); 35 Lisp_Object Fnext_window (), Fdelete_window (), Fselect_window ();
35 Lisp_Object Fset_window_buffer (), Fsplit_window (), Frecenter (); 36 Lisp_Object Fset_window_buffer (), Fsplit_window (), Frecenter ();
36 37
37 void delete_all_subwindows (); 38 void delete_all_subwindows ();
1055 return Qnil; 1056 return Qnil;
1056 } 1057 }
1057 1058
1058 /* Look at all windows, performing an operation specified by TYPE 1059 /* Look at all windows, performing an operation specified by TYPE
1059 with argument OBJ. 1060 with argument OBJ.
1060 If FRAMES is Qt, look at all frames, if Qnil, look at just the selected 1061 If FRAMES is Qt, look at all frames;
1061 frame. If FRAMES is a frame, just look at windows on that frame. 1062 Qvisible, look at visible frames (GET_BUFFER_WINDOW only);
1063 Qnil, look at just the selected frame;
1064 a frame, just look at windows on that frame.
1062 If MINI is non-zero, perform the operation on minibuffer windows too. 1065 If MINI is non-zero, perform the operation on minibuffer windows too.
1063 */ 1066 */
1064 1067
1065 enum window_loop 1068 enum window_loop
1066 { 1069 {
1124 last_window = Fprevious_window (w, mini ? Qt : Qnil, Qt); 1127 last_window = Fprevious_window (w, mini ? Qt : Qnil, Qt);
1125 1128
1126 best_window = Qnil; 1129 best_window = Qnil;
1127 for (;;) 1130 for (;;)
1128 { 1131 {
1132 FRAME_PTR w_frame = XFRAME (WINDOW_FRAME (XWINDOW (w)));
1133
1129 /* Pick the next window now, since some operations will delete 1134 /* Pick the next window now, since some operations will delete
1130 the current window. */ 1135 the current window. */
1131 #ifdef MULTI_FRAME 1136 #ifdef MULTI_FRAME
1132 if (frame) 1137 if (frame)
1133 next_window = Fnext_window (w, (mini ? Qt : Qnil), Qlambda); 1138 next_window = Fnext_window (w, (mini ? Qt : Qnil), Qlambda);
1135 #endif /* MULTI_FRAME */ 1140 #endif /* MULTI_FRAME */
1136 /* We know frame is 0, so we're looping through all frames. 1141 /* We know frame is 0, so we're looping through all frames.
1137 Or we know this isn't a MULTI_FRAME Emacs, so who cares? */ 1142 Or we know this isn't a MULTI_FRAME Emacs, so who cares? */
1138 next_window = Fnext_window (w, mini ? Qt : Qnil, Qt); 1143 next_window = Fnext_window (w, mini ? Qt : Qnil, Qt);
1139 1144
1140 if (!MINI_WINDOW_P (XWINDOW (w)) 1145 if (! MINI_WINDOW_P (XWINDOW (w))
1141 || (mini && minibuf_level > 0)) 1146 || (mini && minibuf_level > 0))
1142 switch (type) 1147 switch (type)
1143 { 1148 {
1144 case GET_BUFFER_WINDOW: 1149 case GET_BUFFER_WINDOW:
1145 #if 0 1150 /* Perhaps ignore invisible and iconified frames. */
1146 /* Ignore invisible and iconified frames. */ 1151 if (EQ (frames, Qvisible)
1147 if (! FRAME_VISIBLE_P (XFRAME (WINDOW_FRAME (XWINDOW (w)))) 1152 && (! FRAME_VISIBLE_P (w_frame)
1148 || FRAME_ICONIFIED_P (XFRAME (WINDOW_FRAME (XWINDOW (w))))) 1153 || FRAME_ICONIFIED_P (w_frame)))
1149 break; 1154 break;
1150 #endif
1151 if (XBUFFER (XWINDOW (w)->buffer) == XBUFFER (obj)) 1155 if (XBUFFER (XWINDOW (w)->buffer) == XBUFFER (obj))
1152 return w; 1156 return w;
1153 break; 1157 break;
1154 1158
1155 case GET_LRU_WINDOW: 1159 case GET_LRU_WINDOW:
1270 frame); 1274 frame);
1271 } 1275 }
1272 1276
1273 DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 1, 2, 0, 1277 DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 1, 2, 0,
1274 "Return a window currently displaying BUFFER, or nil if none.\n\ 1278 "Return a window currently displaying BUFFER, or nil if none.\n\
1275 If optional argument FRAMES is t, search all frames. If FRAME is a\n\ 1279 If optional argument FRAME is t, search all frames.\n\
1276 frame, search only that frame.\n") 1280 If FRAME is `visible', search all visible frames.\n\
1281 If FRAME is a frame, search only that frame.\n")
1277 (buffer, frame) 1282 (buffer, frame)
1278 Lisp_Object buffer, frame; 1283 Lisp_Object buffer, frame;
1279 { 1284 {
1280 buffer = Fget_buffer (buffer); 1285 buffer = Fget_buffer (buffer);
1281 if (XTYPE (buffer) == Lisp_Buffer) 1286 if (XTYPE (buffer) == Lisp_Buffer)
2893 Qwindowp = intern ("windowp"); 2898 Qwindowp = intern ("windowp");
2894 staticpro (&Qwindowp); 2899 staticpro (&Qwindowp);
2895 2900
2896 Qwindow_live_p = intern ("window-live-p"); 2901 Qwindow_live_p = intern ("window-live-p");
2897 staticpro (&Qwindow_live_p); 2902 staticpro (&Qwindow_live_p);
2903
2904 Qvisible = intern ("Qvisible");
2905 staticpro (&Qvisible);
2898 2906
2899 #ifndef MULTI_FRAME 2907 #ifndef MULTI_FRAME
2900 /* Make sure all windows get marked */ 2908 /* Make sure all windows get marked */
2901 staticpro (&minibuf_window); 2909 staticpro (&minibuf_window);
2902 #endif 2910 #endif