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.
Bye
Dominik ^_^ ^_^
--
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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Wed Jun 18 2003 - 02:32:30 BST