Subject: Re: Fw: Re: command parsing problems

From: Dominik Vogt <[email-masked]>
Date: Wed, 23 May 2001 12:03:30 +0200

On Tue, May 22, 2001 at 11:14:25PM +0000, Mikhael Goikhman wrote:
> Hi, you will receive this message twice, it seems that it takes some time
> for Jason to approve this message with attachment.
> 
> Regards,
> Mikhael.

> Date: Tue, 22 May 2001 20:21:27 +0000
> From: Mikhael Goikhman <[email-masked]>
> To: FVWM Workers <[email-masked]>
> Subject: Re: command parsing problems
> Mail-Followup-To: Mikhael Goikhman <[email-masked]>,
> 	FVWM Workers <[email-masked]>
> User-Agent: Mutt/1.2.4i
> In-Reply-To: <[email-masked]>; from [email-masked] on Tue, May 22, 2001 at 01:04:09PM -0400
> 
> On 22 May 2001 13:04:09 -0400, Dan Espen wrote:
> > 
> > Dominik Vogt <[email-masked]> writes:
> > > On Tue, May 22, 2001 at 10:45:55AM -0400, Dan Espen wrote:
> > > > Mikhael Goikhman <[email-masked]> writes:
> > > > > 
> > > > > The problems are real, for example a sample in FAQ 7.13 does not work now
> > > > > I am not sure why it worked at all (2 bugs eliminate each other?).
> > > > 
> > > > Which 2 bugs?
> > > > 
> > > > I'm pretty sure 7.13 worked at one time.  As I remember, more than
> > > > one of us looked at it.
> > > 
> > > That does not necessarily mean that the example worked at a time
> > > when parsing was compatible with the 2.2.x versions.  The example
> > > may have been written at a time when parsing was broken.
> > 
> > Yes, but:
> > 
> >  $0 to $9
> >     The positional parameters given to a  complex  func-
> >     tion  (a  function  that  has  been defined with the
> >     AddToFunc command).  "$0" is replaced with the first
> >     parameter, "$1" with the second parameter and so on.
> 
> True, but there is also this line (I hope it will not be valid tomorrow):
> 
>     Note that module configuration lines (i.e. lines beginning with '*')
>     are not subject to parameter expansion.
> 
> Here is a small patch adding partial expansion to module config lines;
> function parameters and new inventions like $[page.nx] are expended.
> 
> I tested it during the day and verified that it does not conflict with
> any of our 27 modules accourding to their man pages.
> 
> With this patch FAQ 7.13 works. I plan to apply it tomorrow.
> I don't want to do any other changes to command parsing before 2.4.0.

Currently my FvwmButtons setup relies on the fact that these
variables are not expanded for module config lines, e.g.

  *FvwmButtons(Swallow xload `Exec xload -fg $[fg.cs6] -bg $[bg.cs6]`)

What will happen with such lines?

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, email: [email-masked]
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20
--
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: Wed, 23 May 2001 23:34:32 +0000

On 23 May 2001 12:03:30 +0200, Dominik Vogt wrote:
> > function parameters and new inventions like $[page.nx] are expanded.
> > 

I see... You (and me in fvwm-themes) should have to escape $ here as $$
or not to escape it, depending on which value we want (at definition time
or at run time). Like in every other command. I hope you can accept this?
Your example is not different from what we have now with these commands:

  Exec echo 'Exec xload -fg $[fg.cs6] -bg $[bg.cs6]' >auto.fvwmrc
  PipeRead `echo 'Echo $[bg.cs0]' | sed s/0/1/`

Both can have $ escaped as $$ or not, depending on what is actually meant.
It is not complex, it is just our needs are complex, once we want $[fg.cs6]
to be expanded immediately (FvwmButtons: Back) and once not (your example).

I really want to solve this so that everyone is happy. It seems we agree
that $0 should be expanded, "$." is good to be expanded too, for example
for specifying full path for local images/sounds in FvwmButtons/FvwmEvent.
I am applying this patch, so we may see this in action. Disabling expansion
of $[fg.cs6] variables in module commands, if you still want it, is easy.

Regards,
Mikhael.

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 26 May 2001 00:34:40 +0200

> of $[fg.cs6] variables in module commands, if you still want it, is easy.

Hm.  The problem is not that *my* config might break but that
other users will complain.  I have no idea how far sppread this
kind of config is.

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-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]