aboutsummaryrefslogtreecommitdiffstats
path: root/src/xselect.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-11-12 08:00:55 +0400
committerDmitry Antipov2012-11-12 08:00:55 +0400
commit5b04e9f9ac3212f0eb88c853dd21dd63a8bdbee2 (patch)
treed9449b2bda744e962e336625f60c5c004e5c721e /src/xselect.c
parent31f47fbaead299941c22a133ed7e2928c7b1273e (diff)
downloademacs-5b04e9f9ac3212f0eb88c853dd21dd63a8bdbee2.tar.gz
emacs-5b04e9f9ac3212f0eb88c853dd21dd63a8bdbee2.zip
Simplify by using FOR_EACH_FRAME here and there.
* frame.c (next_frame, prev_frame, other_visible_frames) (delete_frame, visible-frame-list): Use FOR_EACH_FRAME. * w32term.c (x_window_to_scroll_bar): Likewise. * window.c (window_list): Likewise. * xdisp.c (x_consider_frame_title): Likewise. * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise. * xfns.c (x_window_to_frame, x_any_window_to_frame) (x_menubar_window_to_frame, x_top_window_to_frame): Likewise. * xmenu.c (menubar_id_to_frame): Likewise. * xselect.c (frame_for_x_selection): Likewise. * xterm.c (x_frame_of_widget, x_window_to_scroll_bar) (x_window_to_menu_bar): Likewise. * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
Diffstat (limited to 'src/xselect.c')
-rw-r--r--src/xselect.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/xselect.c b/src/xselect.c
index de9386bd7d9..64c64fa0c76 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1940,7 +1940,7 @@ x_handle_selection_notify (XSelectionEvent *event)
1940static struct frame * 1940static struct frame *
1941frame_for_x_selection (Lisp_Object object) 1941frame_for_x_selection (Lisp_Object object)
1942{ 1942{
1943 Lisp_Object tail; 1943 Lisp_Object tail, frame;
1944 struct frame *f; 1944 struct frame *f;
1945 1945
1946 if (NILP (object)) 1946 if (NILP (object))
@@ -1949,9 +1949,9 @@ frame_for_x_selection (Lisp_Object object)
1949 if (FRAME_X_P (f) && FRAME_LIVE_P (f)) 1949 if (FRAME_X_P (f) && FRAME_LIVE_P (f))
1950 return f; 1950 return f;
1951 1951
1952 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) 1952 FOR_EACH_FRAME (tail, frame)
1953 { 1953 {
1954 f = XFRAME (XCAR (tail)); 1954 f = XFRAME (frame);
1955 if (FRAME_X_P (f) && FRAME_LIVE_P (f)) 1955 if (FRAME_X_P (f) && FRAME_LIVE_P (f))
1956 return f; 1956 return f;
1957 } 1957 }
@@ -1959,15 +1959,14 @@ frame_for_x_selection (Lisp_Object object)
1959 else if (TERMINALP (object)) 1959 else if (TERMINALP (object))
1960 { 1960 {
1961 struct terminal *t = get_terminal (object, 1); 1961 struct terminal *t = get_terminal (object, 1);
1962
1962 if (t->type == output_x_window) 1963 if (t->type == output_x_window)
1963 { 1964 FOR_EACH_FRAME (tail, frame)
1964 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) 1965 {
1965 { 1966 f = XFRAME (frame);
1966 f = XFRAME (XCAR (tail)); 1967 if (FRAME_LIVE_P (f) && f->terminal == t)
1967 if (FRAME_LIVE_P (f) && f->terminal == t) 1968 return f;
1968 return f; 1969 }
1969 }
1970 }
1971 } 1970 }
1972 else if (FRAMEP (object)) 1971 else if (FRAMEP (object))
1973 { 1972 {