Hi Mikhael Mikhael Goikhman wrote:
> Dave, in all your examples with no exception you either want functions or > preprocessing, both are already available. You don't need a new alias > functionality for this. Aliases only needed to be able to configure > hardcoded builtins that fvwm and modules have in the code, for other cases > there are other solutions. I buy that. I missed that the Alias would only apply to builtins. I think that is a good thing. > [Examples Snipped] I think I just had a quick lesson! Thanks for these solutions I will think about using them on my config. > > This kind of ability would be much more useful than straight aliases. > > > > However, Alias' are typically a poor mans solution to other problems. > > For example, a better functionality would be to implement a "With XXX > > ...." functionality which would also constrain the impact to the area of > > the file instead of being applied globally: > > > > With *FvwmButtons > > Geometry 520x100-1-1 > > Back bisque3 > > (Padding 2 2 Container(Rows 1 Columns 4 Frame 1 Padding 10 0)) > > (Frame -2 Container(Rows 5,Frame 1)) > > EndWith > > FvwmButtons has such ability, create a file containing the lines above > and use *FvwmButtons: File myfb.fvwmrc A general solution is better than module specific ones - I was aiming for general solutions. > Or use functions, or preprocessors. For example, create this file: > > sub With ($$) { foreach (split(/\n/, $_[1]) { command("*$_[0]: $_"); } } > > With "FvwmButtons", ' > Geometry 520x100-1-1 > (Padding 2 2, Container(Rows 1, Columns 4, Frame 1, Padding 10 0)) > '; > > With "FvwmPager", q{ > Geometry ... > }; > > Then put one line in your fvwm2rc: FvwmPerl --load mymodules.fpl > If you really want I may add something like this to FvwmPerl --preprocess > so you should not write a definition of With yourself. I haven't used Perl in my configuration because I like to keep config processing to a simple level. I like to minimise modules etc loaded at startup. It seems that With would a nice thing to have built in without FvwmPerl, but perhaps its a good reason to use FvwmPerl for this. I like your idea of adding to --preprocess that has With builtin. It would be much simpler than trying to do it any other way. I guess its time for me to start using FvwmPerl.... > > Perhaps there is a place for alias' but there are also other solutions > > to problems that Alias are often used to solve. In general constructs > > that have global scope are misused. Perhaps constraining it to one word > > will prevent abuse and then implementing better solutions that people > > can use to solve different problems would be a good approach? > > Here I can only agree. > > > Another constraint could be to limit an alias to the file that it is > > defined in like static in C. > > I don't think that a concept of aliases as Dominik defined it (replacing > builtins) has something to do with a file scope, it is a dynamic thing, > while files are static. I agree it is a dynamic thing, but there is no way to "close" the dynamism so the Alias' get left hanging. Sometimes you only want a quick and dirty alias in a file and forget to UnAlias. I like to minimise the number of actions that default to a global scope forcing users to explicitely make things global. Would Alias within a function be constrained to that function? Either way I think its good - just wanted to promote some discussion on it. Cheers Dave > > 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] -- 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]