(other-frame): Skip iconified and invisible frames.
authorRoland McGrath <roland@gnu.org>
Tue, 3 Aug 1993 03:33:14 +0000 (03:33 +0000)
committerRoland McGrath <roland@gnu.org>
Tue, 3 Aug 1993 03:33:14 +0000 (03:33 +0000)
lisp/frame.el

index 90469d2..b915f94 100644 (file)
@@ -351,19 +351,22 @@ the user during startup."
 
 
 (defun other-frame (arg)
-  "Select the ARG'th different frame, deiconify and raise it.
+  "Select the ARG'th different visible frame, and raise it.
 All frames are arranged in a cyclic order.
 This command selects the frame ARG steps away in that order.
 A negative ARG moves in the opposite order."
   (interactive "p")
   (let ((frame (selected-frame)))
     (while (> arg 0)
-      (setq frame (next-frame frame)
-           arg (1- arg)))
+      (setq frame (next-frame frame))
+      (while (not (eq (frame-visible-p frame) t))
+       (setq frame (next-frame frame)))
+      (setq arg (1- arg)))
     (while (< arg 0)
-      (setq frame (previous-frame frame)
-           arg (1- arg)))
-    (make-frame-visible frame)
+      (setq frame (previous-frame frame))
+      (while (not (eq (frame-visible-p frame) t))
+       (setq frame (previous-frame frame)))
+      (setq arg (1- arg)))
     (raise-frame frame)
     (select-frame frame)))
 \f