Subject: FVWM: Next/Prev question

From: "Rouben Rostamian" <[email-masked]>
Date: Tue, 17 Jun 2003 23:35:31 -0400

I am hitting a mental block in reading the section of the fvwm man
page on Conditional Commands.

We read:

    Next [(conditions)] command
        Performs command (typically Focus) on the
        next window which satisfies all conditions.

    Prev [(conditions)] command
        Performs command (typically Focus) on the
        previous window which satisfies all conditions.

My question is: when should I use Next and when should I use Prev
in a script?

For instance, let's consider the following example from the man page:

   AddToFunc MailFunction
    + I Next ($0) Iconify off
    + I Next (AcceptsFocus, $0) focus
    + I None ($0) Exec exec $0 $1

Why is Next used here?  Why not Prev?  What's the difference?

-- 
Rouben Rostamian <[email-masked]>
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 18 Jun 2003 09:32:49 +0200

> Why is Next used here?  Why not Prev?  What's the difference?

Windows are stored in a ring internally.  Think of the focused
window as a cursor on the current position in the ring.  Next
searches forwards through the ring for a matching window, and Prev
searches backwards.  The windows in the ring are either ordered by
creation time or by the last time they had the focus (depending on
the focus policy).

In this specific case there is no noteworthy difference between
Next and Prev because there are either zero or one windows of the
given type.  We use Next in such examples out of habit and because
Prev might be a bit confusing.

Bye

Dominik ^_^  ^_^