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

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

Re: dired: "!" How to see not just result, but !-cmd too?


From: Kevin Rodgers
Subject: Re: dired: "!" How to see not just result, but !-cmd too?
Date: Thu, 20 Jan 2005 09:28:43 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Matthias wrote:
> Here is a modified `shell-command': it shows the command in the header
> line of the output buffer.
>
> Note that the new code is only four or five lines long (you can use
> the `fixme' comments as flags to found it); I've removed the
> documentation spec to shorten the code.

Sigh.

(defadvice shell-command (after insert-command-comment activate)
  "Insert COMMAND as a comment at the top of the output buffer."
  (save-excursion
    (set-buffer (or (ad-get-arg 1)      ; OUTPUT-BUFFER
                    "*Shell Command Output*"))
    (goto-char (point-min))
    (insert "# " (ad-get-arg 0) "\n"))) ; COMMAND

--
Kevin Rodgers

reply via email to

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