Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

TorgoX (1933)

TorgoX
  sburkeNO@SPAMcpan.org
http://search.cpan.org/~sburke/

"Il est beau comme la retractilité des serres des oiseaux rapaces [...] et surtout, comme la rencontre fortuite sur une table de dissection d'une machine à coudre et d'un parapluie !" -- Lautréamont

Journal of TorgoX (1933)

Saturday January 07, 2006
03:07 AM

buffername_in_commandline.el

[ #28272 ]
Dear Log,

The learning curve for writing Lisp goes around, and up, and into hyperbolic space, and thru a Bathsheba Grossman industrial art piece and then after a decade or two of time spent in rooms with soft walls, you can start to manage basic things.

And so, twelve years after I started using emacs, I can now automate some of my more common tasks.

Back in the days when I had to use PFE under MSWin, the one thing I liked being able to do was that, when I would be running a command line, I could use "%f" in the command line and that would be replaced with the current file's filename.

I found nothing quite so convenient for Emacs. So I wrote it.

With this you can run command lines like "xslbong !! thingywhoozits" and it'll replace "!!" with the current buffer's filename. And incidentally, it'll save the output to a new scratch buffer, instead of the usual functions that just overwrite "*Shell Command Output*".

I'm a sophistatronic programmder!

(I chose "!!" as a string that I just happen never to use in command lines. Change it as you like.)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • This would probably be simpler to arrange using defadvice to define some before advice on shell-command. It's similiar to this Perl:

    sub foo {
      print "foo";
    }
    # Later on...
    {
      my $orig = \&foo;
      *foo = sub {
        print "before foo";
        $orig->(@_);
      };
    }

    More information on elisp advice [delorie.com].

    -Dom