ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RP] aliasing builtin commands


From: Robert de Forest
Subject: Re: [RP] aliasing builtin commands
Date: Sun Mar 24 12:45:15 2002
User-agent: Internet Messaging Program (IMP) 3.0

--- Quoting Jonathan Walther:

So you are saying there should be an "alias stack" where an alias can
point to an alias can point to an alias?  What if something you define
later, "foo", depends on the aliased meaning of "bar", then you unalias
bar?  What happens to the definition of foo?  It's just better not to
let keywords be overridden.

On Sat, Mar 23, 2002 at 11:48:50AM +0100, Martin Samuelsson wrote:
>On Sat, Mar 23, 2002 at 02:35:31AM -0800, Jonathan Walther wrote:
>> If you did something like that, how would you get access to the original
>> builtin commands again?
>
>By using unalias first?
>The reason for creating an alias for an existing command is problary to=20
>extend it's functionality.
>My opinion is that I think it should be possible.

--- End quote

Who cares if someone can break their own config?  The power to override a
builtin could be very useful.  It's kindof like inheritance.  Suppose I have a
bunch of bindings already, but then I decide I want to create a help screen out
of them.  I could generate the help screen by parsing my .ratpoisonrc, OR I
could wrap the "bind" primitive with an alias which writes help info out to
somewhere.  Then whenever I change my bindings (which might be in another file
anyway), my help screen will be correct automatically.

Now, right away you can see some problems with my argument.  There's no reason I
couldn't change all my "bind" invokations to "custombind" (assuming I can invoke
aliases this way, I haven't done much with RP in months).  I did something like
this with TinyFugue, a MUD client.  It has an "addworld" primitive.  I wrote an
"adworld" macro which added the world and re-wrote the "listworld" macro to
include the new world.

Another obvious problem with this is that since it's all one person's files
anyway, that person could generate all their macros from some other source.  For
the help example, have a "key bindings" directory with each key in its own sub
directory.  Within each key dir could be a "name" file, a "description" file,
and a "action" file.  The .ratpoisonrc generater could then loop through these
key directories creating bindings, and then later loop through again generating
help.

Anyway, I think it goes against the philosophy of RP to allow the user to
override builtins OR aliases.  Anything that could be done with this mechanism
could probably be done better without it, or should be done outside of RP
anyway.  RP is a way to use X without a window manager.  It's not a programming
language, a database, or EMACS. :)  Anyone who wants that kind of customation
should look into some of the scheme-based window managers out there.  I'm sure
those window managers could be told not to draw window dressing and to only use
key bindings.

Robert

-- 
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|"I can't believe your computer ripped my pants!" | Robert de Forest
|                                                 | Rogue Sysadmin
|"...they're silk."                               |




reply via email to

[Prev in Thread] Current Thread [Next in Thread]