diff options
| author | Jim Blandy | 1993-06-17 00:39:37 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-06-17 00:39:37 +0000 |
| commit | 75d8f6686c49706c474ac485c1786cea73a1b7c7 (patch) | |
| tree | 483efbe7450ff22723590ed848fdda1d69a41416 /src | |
| parent | 2b0f4ba538126e4ebcda851d5acac2b6fbf47c96 (diff) | |
| download | emacs-75d8f6686c49706c474ac485c1786cea73a1b7c7.tar.gz emacs-75d8f6686c49706c474ac485c1786cea73a1b7c7.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.c | 2 | ||||
| -rw-r--r-- | src/lisp.h | 2 | ||||
| -rw-r--r-- | src/window.c | 28 |
3 files changed, 20 insertions, 12 deletions
diff --git a/src/buffer.c b/src/buffer.c index b19cfcaa737..f2d6ca37e74 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -585,7 +585,7 @@ If BUFFER is omitted or nil, some interesting buffer is returned.") | |||
| 585 | if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ') | 585 | if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ') |
| 586 | continue; | 586 | continue; |
| 587 | if (NILP (visible_ok)) | 587 | if (NILP (visible_ok)) |
| 588 | tem = Fget_buffer_window (buf, Qnil); | 588 | tem = Fget_buffer_window (buf, Qvisible); |
| 589 | else | 589 | else |
| 590 | tem = Qnil; | 590 | tem = Qnil; |
| 591 | if (NILP (tem)) | 591 | if (NILP (tem)) |
diff --git a/src/lisp.h b/src/lisp.h index 7acf63d6be9..0969bfb8f41 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1213,7 +1213,7 @@ extern Lisp_Object get_keyelt (), get_keymap(); | |||
| 1213 | extern Lisp_Object Fvertical_motion (), Findent_to (), Fcurrent_column (); | 1213 | extern Lisp_Object Fvertical_motion (), Findent_to (), Fcurrent_column (); |
| 1214 | 1214 | ||
| 1215 | /* defined in window.c */ | 1215 | /* defined in window.c */ |
| 1216 | extern Lisp_Object Qwindowp, Qwindow_live_p; | 1216 | extern Lisp_Object Qwindowp, Qwindow_live_p, Qvisible; |
| 1217 | extern Lisp_Object Fget_buffer_window (); | 1217 | extern Lisp_Object Fget_buffer_window (); |
| 1218 | extern Lisp_Object Fsave_window_excursion (); | 1218 | extern Lisp_Object Fsave_window_excursion (); |
| 1219 | extern Lisp_Object Fset_window_configuration (), Fcurrent_window_configuration (); | 1219 | extern Lisp_Object Fset_window_configuration (), Fcurrent_window_configuration (); |
diff --git a/src/window.c b/src/window.c index d7e91560d7c..4c182a6924d 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -30,6 +30,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 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 (); |
| @@ -1057,8 +1058,10 @@ argument ALL_FRAMES is non-nil, cycle through all frames.") | |||
| 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 | ||
| @@ -1126,6 +1129,8 @@ window_loop (type, obj, mini, frames) | |||
| 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 |
| @@ -1137,17 +1142,16 @@ window_loop (type, obj, mini, 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; |
| @@ -1272,8 +1276,9 @@ frame, search only that frame.\n") | |||
| 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 | { |
| @@ -2896,6 +2901,9 @@ syms_of_window () | |||
| 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); |
| 2898 | 2903 | ||
| 2904 | Qvisible = intern ("Qvisible"); | ||
| 2905 | staticpro (&Qvisible); | ||
| 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); |