Subject: Enh request: Silent something for non-existant something

From: tim phipps <[email-masked]>
Date: Thu, 21 Mar 2002 16:20:15 +0000

Configuration Information [Automatically generated, do not change]:
uname: SunOS silver 5.5.1 Generic_103640-39 sun4u sparc SUNW,Ultra-5_10
compiler flags: gcc -g -O2 -Wall -Wno-implicit-int

FVWM Version:	2.5.1
FVWM_MODULEDIR:	/u/phippst/sunos/libexec/fvwm/2.5.1
FVWM_DATADIR:	/u/phippst/sunos/share/fvwm
FVWM_USERDIR:	/u/phippst/.fvwm

Description:
	FvwmCommand pants:
[FVWM][execute_function]: <<ERROR>> No such command 'pants'
	FvwmCommand "Silent pants":
[FVWM][execute_function]: <<ERROR>> No such command 'pants'

	It would be nice if the second one was quiet.

Patch:

Index: fvwm/functions.c
===================================================================
RCS file: /u/phippst/share/cvsroot/fvwm/fvwm/functions.c,v
retrieving revision 1.26
diff -u -r1.26 functions.c
--- fvwm/functions.c    2002/03/18 12:47:11     1.26
+++ fvwm/functions.c    2002/03/21 16:07:50
@@ -1414,7 +1414,7 @@
     {
       if (executeModuleDesperate(
        efa->cond_rc, efa->eventp, w, efa->fw, efa->context, runaction,
-       &efa->module) == -1 && *function != 0)
+       &efa->module) == -1 && *function != 0 && !set_silent)
       {
        fvwm_msg(
          ERR, "execute_function", "No such command '%s'", function);
Index: fvwm/fvwm2.1
===================================================================
RCS file: /u/phippst/share/cvsroot/fvwm/fvwm/fvwm2.1,v
retrieving revision 1.62
diff -u -r1.62 fvwm2.1
--- fvwm/fvwm2.1        2002/03/21 12:35:02     1.62
+++ fvwm/fvwm2.1        2002/03/21 16:13:47
@@ -7900,6 +7900,9 @@
 .BR Key ", " PointerKey " and " Mouse ,
 this disables error messages.
 
+.B Silent
+also disables the error message for non-existant commands.
+
 Examples:
 .EX
 Silent Move 0 0
--
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: Dominik Vogt <[email-masked]>
Date: Thu, 21 Mar 2002 21:49:43 +0100

> 	It would be nice if the second one was quiet.

Ah, do you have a use for this in mind?  Why would a user want to
not be informed about syntax errors in his commands?

> Index: fvwm/functions.c

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]

---

From: Tim Phipps <[email-masked]>
Date: Fri, 22 Mar 2002 08:38:15 +0000

> not be informed about syntax errors in his commands?

Yes, I have a couple of instances where and event calls a function that 
may or may not exist. I have to do an "AddToFunc my_destroy_$w I NOP" 
before I call my_destroy_$w just in case my_destroy_$w hasn't been created.

Cheers,
Tim.