help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: putting a command and its output in a buffer


From: Kevin Rodgers
Subject: Re: putting a command and its output in a buffer
Date: Tue, 28 Mar 2006 11:33:35 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Peter Dyballa wrote:
Am 28.03.2006 um 19:45 schrieb Gary Weselle:
I would like to put a shell command and its output in a buffer,

What about M-x shell-command? Later you'll have to edit *Shell Command Output* to contain the command ...

Alternatively you can set verbose mode in your shell so that it repeats the command.

Brilliant!

(defadvice shell-command (before xtrace activate)
  "When called with a prefix argument, prepend \"set -x\" to COMMAND."
  (when (and (interactive-p) current-prefix-arg)
    (setq command (concat "set -x\n" command))))

Too bad "set -x" is included in shell-command-history.

--
Kevin Rodgers





reply via email to

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