aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1995-06-25 19:05:32 +0000
committerRichard M. Stallman1995-06-25 19:05:32 +0000
commit06537cc8b58aada3c9a5ddb353f3f884f7498057 (patch)
tree6a0bca2179434b9d255fb685deccdc824c43c30e /src
parent4590788aa92a70d958977e229fa608eaf52143e5 (diff)
downloademacs-06537cc8b58aada3c9a5ddb353f3f884f7498057.tar.gz
emacs-06537cc8b58aada3c9a5ddb353f3f884f7498057.zip
(next_frame, prev_frame): Consider only frames on same kbd.
(Fdelete_frame): If next_frame finds nothing, try an alternative.
Diffstat (limited to 'src')
-rw-r--r--src/frame.c94
1 files changed, 59 insertions, 35 deletions
diff --git a/src/frame.c b/src/frame.c
index 5d9c00c5bc8..7f523d073d5 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -684,7 +684,9 @@ next_frame (frame, minibuf)
684 Lisp_Object f; 684 Lisp_Object f;
685 685
686 f = XCONS (tail)->car; 686 f = XCONS (tail)->car;
687 if (passed) 687
688 if (passed
689 && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
688 { 690 {
689 /* Decide whether this frame is eligible to be returned. */ 691 /* Decide whether this frame is eligible to be returned. */
690 692
@@ -763,38 +765,41 @@ prev_frame (frame, minibuf)
763 if (EQ (frame, f) && !NILP (prev)) 765 if (EQ (frame, f) && !NILP (prev))
764 return prev; 766 return prev;
765 767
766 /* Decide whether this frame is eligible to be returned, 768 if (FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
767 according to minibuf. */
768 if (NILP (minibuf))
769 {
770 if (! FRAME_MINIBUF_ONLY_P (XFRAME (f)))
771 prev = f;
772 }
773 else if (WINDOWP (minibuf))
774 { 769 {
775 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf) 770 /* Decide whether this frame is eligible to be returned,
776 /* Check that F either is, or has forwarded its focus to, 771 according to minibuf. */
777 MINIBUF's frame. */ 772 if (NILP (minibuf))
778 && (EQ (WINDOW_FRAME (XWINDOW (minibuf)), f) 773 {
779 || EQ (WINDOW_FRAME (XWINDOW (minibuf)), 774 if (! FRAME_MINIBUF_ONLY_P (XFRAME (f)))
780 FRAME_FOCUS_FRAME (XFRAME (f))))) 775 prev = f;
781 prev = f; 776 }
782 } 777 else if (WINDOWP (minibuf))
783 else if (EQ (minibuf, Qvisible)) 778 {
784 { 779 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
785 FRAME_SAMPLE_VISIBILITY (XFRAME (f)); 780 /* Check that F either is, or has forwarded its focus to,
786 if (FRAME_VISIBLE_P (XFRAME (f))) 781 MINIBUF's frame. */
787 prev = f; 782 && (EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
788 } 783 || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
789 else if (XFASTINT (minibuf) == 0) 784 FRAME_FOCUS_FRAME (XFRAME (f)))))
790 { 785 prev = f;
791 FRAME_SAMPLE_VISIBILITY (XFRAME (f)); 786 }
792 if (FRAME_VISIBLE_P (XFRAME (f)) 787 else if (EQ (minibuf, Qvisible))
793 || FRAME_ICONIFIED_P (XFRAME (f))) 788 {
789 FRAME_SAMPLE_VISIBILITY (XFRAME (f));
790 if (FRAME_VISIBLE_P (XFRAME (f)))
791 prev = f;
792 }
793 else if (XFASTINT (minibuf) == 0)
794 {
795 FRAME_SAMPLE_VISIBILITY (XFRAME (f));
796 if (FRAME_VISIBLE_P (XFRAME (f))
797 || FRAME_ICONIFIED_P (XFRAME (f)))
798 prev = f;
799 }
800 else
794 prev = f; 801 prev = f;
795 } 802 }
796 else
797 prev = f;
798 } 803 }
799 804
800 /* We've scanned the entire list. */ 805 /* We've scanned the entire list. */
@@ -812,13 +817,14 @@ prev_frame (frame, minibuf)
812 817
813DEFUN ("next-frame", Fnext_frame, Snext_frame, 0, 2, 0, 818DEFUN ("next-frame", Fnext_frame, Snext_frame, 0, 2, 0,
814 "Return the next frame in the frame list after FRAME.\n\ 819 "Return the next frame in the frame list after FRAME.\n\
820It considers only frames on the same terminal as FRAME.\n\
815By default, skip minibuffer-only frames.\n\ 821By default, skip minibuffer-only frames.\n\
816If omitted, FRAME defaults to the selected frame.\n\ 822If omitted, FRAME defaults to the selected frame.\n\
817If optional argument MINIFRAME is nil, exclude minibuffer-only frames.\n\ 823If optional argument MINIFRAME is nil, exclude minibuffer-only frames.\n\
818If MINIBUF is a window, include only its own frame\n\ 824If MINIFRAME is a window, include only its own frame\n\
819and any frame now using that window as the minibuffer.\n\ 825and any frame now using that window as the minibuffer.\n\
820If MINIFRAME is `visible', include all visible frames.\n\ 826If MINIFRAME is `visible', include all visible frames.\n\
821If MINIBUF is 0, include all visible and iconified frames.\n\ 827If MINIFRAME is 0, include all visible and iconified frames.\n\
822Otherwise, include all frames.") 828Otherwise, include all frames.")
823 (frame, miniframe) 829 (frame, miniframe)
824 Lisp_Object frame, miniframe; 830 Lisp_Object frame, miniframe;
@@ -835,13 +841,14 @@ Otherwise, include all frames.")
835 841
836DEFUN ("previous-frame", Fprevious_frame, Sprevious_frame, 0, 2, 0, 842DEFUN ("previous-frame", Fprevious_frame, Sprevious_frame, 0, 2, 0,
837 "Return the previous frame in the frame list before FRAME.\n\ 843 "Return the previous frame in the frame list before FRAME.\n\
844It considers only frames on the same terminal as FRAME.\n\
838By default, skip minibuffer-only frames.\n\ 845By default, skip minibuffer-only frames.\n\
839If omitted, FRAME defaults to the selected frame.\n\ 846If omitted, FRAME defaults to the selected frame.\n\
840If optional argument MINIFRAME is nil, exclude minibuffer-only frames.\n\ 847If optional argument MINIFRAME is nil, exclude minibuffer-only frames.\n\
841If MINIBUF is a window, include only its own frame\n\ 848If MINIFRAME is a window, include only its own frame\n\
842and any frame now using that window as the minibuffer.\n\ 849and any frame now using that window as the minibuffer.\n\
843If MINIFRAME is `visible', include all visible frames.\n\ 850If MINIFRAME is `visible', include all visible frames.\n\
844If MINIBUF is 0, include all visible and iconified frames.\n\ 851If MINIFRAME is 0, include all visible and iconified frames.\n\
845Otherwise, include all frames.") 852Otherwise, include all frames.")
846 (frame, miniframe) 853 (frame, miniframe)
847 Lisp_Object frame, miniframe; 854 Lisp_Object frame, miniframe;
@@ -955,7 +962,24 @@ but if the second optional argument FORCE is non-nil, you may do so.")
955 962
956 /* Don't let the frame remain selected. */ 963 /* Don't let the frame remain selected. */
957 if (f == selected_frame) 964 if (f == selected_frame)
958 do_switch_frame (next_frame (frame, Qt), Qnil, 0); 965 {
966 Lisp_Object tail, frame1;
967
968 /* Look for another visible frame on the same terminal. */
969 frame1 = next_frame (frame, Qvisible);
970
971 /* If there is none, find *some* other frame. */
972 if (NILP (frame1) || EQ (frame1, frame))
973 {
974 FOR_EACH_FRAME (tail, frame1)
975 {
976 if (! EQ (frame, frame1))
977 break;
978 }
979 }
980
981 do_switch_frame (frame1, Qnil, 0);
982 }
959 983
960 /* Don't allow minibuf_window to remain on a deleted frame. */ 984 /* Don't allow minibuf_window to remain on a deleted frame. */
961 if (EQ (f->minibuffer_window, minibuf_window)) 985 if (EQ (f->minibuffer_window, minibuf_window))