From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: TheFlyingDutchman Newsgroups: gmane.emacs.help Subject: Re: how to set shell output always to *Shell Command Output* Date: Sun, 19 Sep 2010 01:56:43 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5e2bcbd6-660d-4582-b682-fd88d29a4103@s24g2000pri.googlegroups.com> References: <782e1056-089a-4284-ad9e-03396e25034a@m17g2000prl.googlegroups.com> <574baa7f-7b70-4ebf-aaaa-42b6400b29a4@p37g2000pra.googlegroups.com> <609e0423-e23b-4e05-9f48-0b0610d9b74f@k17g2000prf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1291867765 4485 80.91.229.12 (9 Dec 2010 04:09:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 04:09:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 05:09:21 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQXon-0003c4-5s for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 05:09:21 +0100 Original-Received: from localhost ([127.0.0.1]:50058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQXom-0008VG-9T for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 23:09:20 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!s24g2000pri.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-NNTP-Posting-Host: 75.36.154.13 Original-X-Trace: posting.google.com 1284886604 779 127.0.0.1 (19 Sep 2010 08:56:44 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 19 Sep 2010 08:56:44 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s24g2000pri.googlegroups.com; posting-host=75.36.154.13; posting-account=9bWHAAoAAAAxSFC_2O_ssTETNW9NhMbW User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.5; (R1 1.6); SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; AskTbBT5/5.8.0.12304),gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:181370 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: news.gmane.org gmane.emacs.help:76612 Archived-At: > > but what if i do want the mini-buffer window to resize? i vaguely > recall i set it before but then when calling shell-command with long > shell lines it becomes one loong line that goes out of the window. > > it seems to me the current behavior is trying to use one stone for 2 > birds... not orthogonal. > > would be nice if emacs has anoher var some like smart-redirect-output-p. > There may be issues with this function, but it seems to do what you want with regards to command output - of any size - always going to a right-side window (I am using Windows 7, Emacs 23.2.1) - except when *Shell Command Output* is already displayed in a window, in which case output goes to the existing window. It also doesn't affect any existing mini-buffer behavior. (defun sh-cmd (command) (interactive "sCommand: ") (let ((buffer (get-buffer-create "*Shell Command Output*"))) (with-current-buffer buffer (erase-buffer) (call-process-region (point) (point) shell-file-name t t nil shell-command-switch command) (display-buffer (current-buffer)) ) ) )