Subject: Re: FVWM: Next/Prev question

From: "Rouben Rostamian" <[email-masked]>
Date: Wed, 18 Jun 2003 07:07:40 -0400

Dominik Vogt <[email-masked]> wrote:
> On Tue, Jun 17, 2003 at 11:35:31PM -0400, Rouben Rostamian wrote:
> > 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?
> 
> 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.

Thanks, Dominik, for this very clear explanation.  Shouldn't this
be in the man page?

Now that you are at it, would you also elaborate on your parenthetical
remark "(depending on the focus policy)"?  Is there an easy way to
explain how the focus policy determines the order in the ring?

-- 
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: [email-masked]
Date: Thu, 19 Jun 2003 18:07:16 +0200

> Thanks, Dominik, for this very clear explanation.  Shouldn't this

Done.

> explain how the focus policy determines the order in the ring?

SloppyFocus and ClickToFocus order the ring in last-focus-order,
the other policies use creation-order.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [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].