Re: FVWM: quoting in fvwm

From: Dominik Vogt <dominik.vogt_at_gmx.de>
Date: Fri, 5 May 2000 02:21:50 +0200

On Thu, May 04, 2000 at 01:49:06AM -0230, Neil Zanella wrote:
>
> 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.

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

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

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.

> ------------------------------------------------------------------------------
> (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

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, dominik.vogt_at_gmx.de
Reply-To: dominik.vogt_at_gmx.de
--
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 Thu May 04 2000 - 22:45:02 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:50 BST