Subject: FVWM: quoting in fvwm

From: Neil Zanella <[email-masked]>
Date: Thu, 4 May 2000 01:49:06 -0230 (NDT)

Hello,

I'm running fvwm version 2.3.16...

I would like ask two things about fvwm quoting rules. I would also like
to point out what I think might be a bug in Fvwm's quoting rules:
------------------------------------------------------------------------
(1)

I would like to see an example of a function that uses an Fvwm parameter
consisting of a '$' followed  by a word enclosed in braces (${...}) as
mentioned in the fvwm2 the man page. I ask because the man page gives no
example of this kind of parameter.
------------------------------------------------------------------------
(2)

Also, there is a bug in the fvwm man page in the parameter section:
the following sentence is unclear to me:

To quote a beginning
       with '*') are not subject  to  parameter  expansion.
------------------------------------------------------------------------------
(3)

The string '$$2' should be expanded to '$2' but Fvwm seems to first expand
it to '$2' and then to the actual value of the function parameter $2
making it impossible to produce a literal '$2'.

For example:

AddToFunc MyFunc "I" Exec echo 111 222 333 | /bin/awk { print $$2 }' >
myfile

should execute:

echo 111 222 333 | /bin/awk { print $2 }' > myfile

Thus I should get

$ cat myfile
222

but I get

$ cat myfile
111 222 333

--------------------------------------------------------------------
Best Regards,

Thanks,

Neil

--
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: Fri, 5 May 2000 02:21:50 +0200

> to point out what I think might be a bug in Fvwm's quoting rules:

That's a typo.  It should read

  ... by a word enclosed in braces ($[...]) ...
                                     ^   ^

The examples are further down in the same section:

  $[fg.cs<n>]
  $[bg.cs<n>]
  $[hilight.cs<n>]
  $[shadow.cs<n>]

The section read like this:

  To quote a '$' use "$$".  Note that module configuration lines
  (i.e. lines beginning with '*') are not subject to parameter
  expansion.

This is probably a problem with your viewer.  I often have the
problem that 'less' doesn't display certain lines in a man page.
Scrolling up a few lines and then down again solves the problem
for me.

That is because the "$$2" is axpanded *twice*.  First it's
expanded when you enter AddToFunc command (reducing it to
"$2", then it's expanded *again* when the function is executed.

To get a literal '$2' in your function you actually have to
quote the '$' twice:

  $$$$2 -> $$2 -> $2

*But* that doesn't work either at the moment.  For some
reason the stirng is expanded *three* times, which is
definitely a bug.  So at the moment you have to say

 $$$$$$$$2

:-)  Expect a fix soon.

BTW, The reason why "$$c" works, but not "$$2" is that when
fvwm encounters a parameter it can't resolve at the moment
(i.e. because the command is not executed in a window
context), it doesn't touch the parameter.

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].

---

From: Tim Phipps <[email-masked]>
Date: Fri, 05 May 2000 10:55:14 +0100

> Scrolling up a few lines and then down again solves the problem

It's a problem with my nroff, it doesn't like something in that area.

I'll commit a fix when I figured one out. And the { -> [

Cheers,
Tim.

---

From: Neil Zanella <[email-masked]>
Date: Sat, 13 May 2000 03:41:14 -0230 (NDT)

Hello,

I am still wondering why can't treat $$0 - $$9 as a special cases and
expand them only within functions. I don't think this would lead to
a loss of functionality since the positional parameters are used only
within functions. Perhaps there is something else I'm not aware of.
BTW, having to quote four times is better than having to quote eight
times: thanks for the bugfix!

Best Regards,

Neil