From a569dbc32fb4a7aeaa8b37a22122f63bea4d2be4 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 3 Aug 1993 03:33:14 +0000 Subject: [PATCH] (other-frame): Skip iconified and invisible frames. --- lisp/frame.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lisp/frame.el b/lisp/frame.el index 90469d26b17..b915f945b97 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -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))) -- 2.39.5