[Top][All Lists]

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

Re: [RP] Re: poundbang

From: Ryan Yeske
Subject: Re: [RP] Re: poundbang
Date: Thu Mar 4 23:23:01 2004
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Shawn Betts <address@hidden> writes:

> John Meacham <address@hidden> writes:
> >
> > the correct solution is to add a single option
> > 
> > -f <file> -  read commands from file. 
> > 
> > then put 
> > #!/usr/bin/ratpoison -f
> > 
> > at the beginning of your files.
> I'm not sure I understand the point of being able to use ratpoison
> this way. Ratpoison will never have conditionals, looping, or
> variables as part of it's command set. So the only thing you'll ever
> be able to do is list a bunch of hard-coded commands. 
> Let's also not forget that if you want to run the sh script
> 'doit.sh' you can run:
> $ doit.sh
> if the permissions are setup or
> $ sh doit.sh
> If you want to run a batch of commands you can always run:
> $ ratpoison -c "source <file>"
> And if you do it often then you can bind a key or an alias to it and
> execute it quickly.

While this is all true, I do think its still *slightly* more
convenient to be able to write the file 'doit.rp' as:

        #!/usr/bin/ratpoison -f

I'll try to state the case for #!/usr/bin/ratpoison:

1) First of all, never say never.  Who can really say what ratpoison
   will look like in 5/10 years?  It may have conditionals, looping,
   whatever.  Hopefully we are all running stumpwm then, but...

2) It's intuitive.  That is, I think many users will *expect* that
   something like this is possible directly.

3) I can chmod +x doit.rp and run it.  If I want to chmod +x doit.sh
   and run that, my script must be 

        ratpoison -c "command one"
        ratpoison -c "command two"
        ratpoison -c "command three"

   instead of just

        #!ratpoison -f
        command one
        command two
        command three

   and its even more of a win if ratpoison is not in the executable
   path on a particular system (you only specify
   /awkward/path/to/ratpoison once for doit.rp).

2) Months from now it's clear to me what program I intended to have
   interpret those weird commands in that random file I found in my
   homedir.  Or to someone else looking at my hacks.

4) Emacs can be taught to put the buffer visiting that file in
   ratpoison-mode by the #!/usr/bin/ratpoison line.

5) From the shell, its slightly easier to fit ratpoison into a
   pipeline.  Where you want it to read commands from stdin if you
   just need to write foobar|ratpoison -f /dev/stdin rather than
   foobar|ratpoison -c "source /dev/stdin".  Not only is it NINE
   characters shorter, but there is a layer of quotes removed, which
   is always good.

I know that none of the above are knock-out arguments alone, but
together, and along with the points made by others, I think we have a
decent case for adding the -f commandline argument to ratpoison.


reply via email to

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