On 19 Jun 2002 13:32:33 +0200, Dominik Vogt wrote: > > I'd like to add command name aliases to fvwm, e.g. > > Alias GotoDesk MyGotoDesk > > and to get the builtin command: > > Builtin GotoDesk > > and of course > > Unalias GotoDesk > > This way it would be possible to replace a builtin command with a > specifically tuned complex function. Is that a good idea? I > think alias expansion should be done for the first word on the > command line only and before anything else. That feature would > certainly add a lot of flexibility as well as unlimited ways to > break your config.
It seems this will be abused a lot. Example, there are more than one way to change pages, not only using GotoPage, but also GotoDesk, GotoDeskAndPage, interactove Move. The correct way to handle a page change is to listen to new_page event. Not by using aliases. But of course there are usages where the _current_ events are not good, for example you want to be able to control whether a window goes away or not. You get destroy_window when it is too late, a window does not exist any more. So here is an alternative. To alias Delete, Close and Destroy, or to introduce a new event. Aliases are powerful. but I think they will be used for tasks that should be solved differently. Something like synchronous events (when a module returns an event result) comes to a mind. Aliases may be implemented by simply storing a pointer to a function (initially NULL) for every command. On any problem (function destroyed) an alias is removed. If we don't remove alias on DestroyFunc there may be bad cases when an other module executes an aliased command before the entire function is defined. Please don't start this before 2.5.2. 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 PROTECTED] To report problems, send mail to [EMAIL PROTECTED]