Subject: EnterFunction proposal

From: Mikhael Goikhman <[email-masked]>
Date: Thu, 2 Sep 1999 23:23:34 +0300 (IDT)

I want to implement a new special fvwm function EnterFunction and would
like to hear your comments first if any.

This function (if defined) will be executed on startup and restart just
before the appropriate *InitFunction or *RestartFunction and is supposed
to be used for module startup and some other static initializations.
This will allow to define modules once; now users add most of the used
modules to InitFunction, RestartFunction and (in case a user uses SM)
to SessionInitFunction and SessionRestartFunction.

So a typical user would define EnterFunction (to start modules) and
InitFunction (to start initial applications) and probably leave
RestartFunction, SessionInitFunction and SessionRestartFunction empty
or undefined. But the flexibility to define absolutely independent
starting functions still remains.

The name of the proposed function is chosen as an opposite to the existing
ExitFunction, which is unconditionally executed on exit. A better name?

Regards,
Mikhael.

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

---

From: Neil Bird <[email-masked]>
Date: Fri, 03 Sep 1999 09:43:55 +0100

> like to hear your comments first if any.

  Possibly StartFunction (matches Restart... - but doesn't match Exit...
:-/ )

  I agree that it's getting a little crowded now with all these auto-run
functions - do we really want to add *another* bnuilt-in one when, e.g.
(what I have, below), works? It's not like it's complicated.

AddToFunc _BootFunction  \
   "I" Module FvwmCommandS
+  "I" FvwmEvent
+  "I" PipeRead ModuleList
+  "I" FvwmPager 0 0
+  "I" FvwmAnimate

AddToFunc InitFunction   \
   "I" FvwmBanner
+  "I" Function _BootFunction

AddToFunc RestartFunction   \
   "I" Function _BootFunction
+  "I" Next [Xticker] Raise

  I think I'd suggest that a hint to do this within the manual page might
be easier!

-- 
=====================- http://www.racaldefence.com/ -===================
 Neil Bird                   |   This is who we are     The time is near
                             |
 mailto:[email-masked] |        There are 120 days remaining
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 3 Sep 1999 22:43:29 +0300 (IDT)

> Possibly StartFunction (matches Restart... - but doesn't match Exit...

Probably it is not very good that it matches RestartFunction (which
already does not matche its companion InitFunction). So on restarts fvwm
runs StartFunction and then RestartFunction? I don't know. Anybody else?

> AddToFunc _BootFunction\
> +"I" FvwmEvent
> +"I" PipeRead ModuleList
> +"I" FvwmPager 0 0
> +"I" FvwmAnimate
> +"I" Function _BootFunction
> 
> 
> +"I" Next [Xticker] Raise

The fact that any user can define his own function to emulate the proposed
EnterFunction does not help. Still in automatic setups (say FormFvwmSetup.
or fvwm-theme configurator, like the one suggested by Jason Kibblewhite)
modules must be added in one way or another to four functions instead of
one, because this user function is not standardized.

Historically we have two start functions in fvwm, however for a typical
user RestartFunction is just a shorter version of InitFunction.
IMO, defining the function unconditionally executed on start is a right
thing to do in order to eliminate duplications in configuration files.

> I think I'd suggest that a hint to do this within the manual page might

Maybe, instead, we can add a hint to advanced users that they still can
do this in the old way, but the prefered way is to start modules in
EnterFunction?

Regards,
Mikhael.

---

From: Dan Espen <[email-masked]>
Date: Fri, 03 Sep 1999 16:26:20 -0400

> > > like to hear your comments first if any.

I never liked having a RestartFunction or an InitFunction.

I start apps where they should be started, in my .xinitrc.
(Thats just an opinion expressed like a law.)

I only started using InitFunction, and RestartFunction after I started
getting hangs, from  just  having "Module FvwmAnimate" anywhere  in my
.fvwm2rc.

If you are not starting modules, you can still get something similar
to "EnterFunction" by just putting the commands in the .fvwm2rc.

That brings   me to  my point.    When is EnterFunction  going  to run
relative to the other 2 functions?

You can  create  "EnterFunction" by  modifying ConfigFvwmDefaults like
this:

AddToFunc EnterFunction I Nop
AddToFunc InitFunction I EnterFunction
AddToFunc RestartFunction I EnterFunction

(That puts EnterFunction before InitFunction and RestartFunction.)

Done like this, theres little argument against adding unnecessary code.

I  think  the  idea itself    is   reasonable.  Its   a little    more
user-friendly than  leading the average  user down  the path of coding
both functions.

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 4 Sep 1999 02:21:49 +0300 (IDT)

> (Thats just an opinion expressed like a law.)

I hope, this is not a law. :) I would probably put xhost, xmodmap
or other programs belonging to X in .xinitrc, but not my applications.
I want to be able to get a clean X. All my applications belong to one
specific .fvwm2rc and, say, .fvwm2rc-2 contains different applications.
Also I can't use a SM if I put applications in .xinitrc.

I think fvwm's starting functions are good enough for flexibility.

> to "EnterFunction" by just putting the commands in the .fvwm2rc.

Maybe it is a bit more convinient to have an official place for them?
Also you can add commands to this function from Read files as well.

> relative to the other 2 functions?

Before them. This is usually enough, if not - users can always use
the old way of doing things and not to use automatical tools or modular
configurations, which put modules to EnterFunction (StartFunction?).

> Done like this, theres little argument against adding unnecessary code.

It would be a solution, but...
Unfortunately, there are good arguments against this trick.
  1) The "uneccesary code" will take only about 30 bytes of binary
  2) Being defined this way, is EnterFunction now official enough that
we can change module man pages to refer to it?
  3) Users usually have (I have) this code in their .fvwm2rc:

DestroyFunc InitFunction
AddToFunc InitFunction

which makes your suggestion not to work for them.

Maybe we just implement this function and see, if there is something wrong
with it if at all.

Regards,
Mikhael.

---

From: Dan Espen <[email-masked]>
Date: Fri, 03 Sep 1999 21:12:55 -0400

Mikhael Goikhman <[email-masked]> writes:
> > > > > I want to implement a new special fvwm function EnterFunction and
> > > > > would like to hear your comments first if any.

Sounds like you've already coded it, in that case, ignore the above
suggestion.

> we can change module man pages to refer to it?

I would have thought so.

> which makes your suggestion not to work for them.

Argh!  In that case, avoid the above suggestion!

> Maybe we just implement this function and see, if there is something wrong

So far, I think its a good idea.