Slash Boxes
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)


"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)

Wednesday May 11, 2005
02:10 AM


[ #24627 ]
Dear Log,

I don't like how emacs's shell-command keeps overwriting whatever is in the "*Shell Command Output*" buffer. So I wrote this function that writes to an always-new scratch buffer:

(setq shell-buffer-counter 1000)

(defun shell-command-to-new-scratch (command)
  (interactive (list (read-from-minibuffer
              "Shell command: "
              nil nil nil 'shell-command-history)))
  (setq shell-buffer-counter (+ 1 shell-buffer-counter ))
  (shell-command command
         (concat "*scratch "
             (int-to-string shell-buffer-counter)
             "% "

And I bound it to a happy place;

(global-set-key "\M-!" 'shell-command-to-new-scratch)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.