From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: dired: "!" How to see not just result, but !-cmd too? Date: Fri, 21 Jan 2005 10:38:34 -0700 Message-ID: <35ct0uF4mm23sU1@individual.net> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1106329377 19920 80.91.229.6 (21 Jan 2005 17:42:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Jan 2005 17:42:57 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 21 18:42:51 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Cs2o7-0000f0-00 for ; Fri, 21 Jan 2005 18:42:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cs30B-0006EE-8U for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Jan 2005 12:55:19 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-X-Trace: individual.net niWXvQrLILgFcsjwESCgdg57nbuhd5q+9ucA763hD3Whepj10= User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: Original-Xref: shelby.stanford.edu gnu.emacs.help:128035 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:23527 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23527 Matthias wrote: > Here is a modified `shell-command': it shows the command in the header > line of the output buffer. Ah, now I see what you've done. Using header-line-format format is much better than inserting a comment. But using defadvice is much better than redefining an 86-line function: (defadvice shell-command (after insert-command-comment activate) "Insert COMMAND as a comment at the top of the output buffer." ;; Alternatives to truncating multi-line commands: ;; 1. Replace each newline with a semicolon. ;; 2. Truncate, but append an ellipsis. (save-excursion ;; (ad-get-arg 0) == COMMAND ;; (ad-get-arg 1) == OUTPUT-BUFFER (set-buffer (or (ad-get-arg 1) "*Shell Command Output*")) (setq header-line-format (replace-regexp-in-string "%" "%%" (substring (ad-get-arg 0) 0 (string-match "\n" (ad-get-arg 0))) nil t)))) -- Kevin Rodgers