From: TheFlyingDutchman <zzbbaadd@aol.com>
To: help-gnu-emacs@gnu.org
Subject: Re: how to set shell output always to *Shell Command Output*
Date: Sun, 19 Sep 2010 01:56:43 -0700 (PDT) [thread overview]
Message-ID: <5e2bcbd6-660d-4582-b682-fd88d29a4103@s24g2000pri.googlegroups.com> (raw)
In-Reply-To: 609e0423-e23b-4e05-9f48-0b0610d9b74f@k17g2000prf.googlegroups.com
>
> 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)) ) )
)
next prev parent reply other threads:[~2010-09-19 8:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-13 6:17 how to set shell output always to *Shell Command Output* Xah Lee
2010-09-16 12:57 ` TheFlyingDutchman
2010-09-16 14:13 ` Xah Lee
2010-09-17 18:56 ` TheFlyingDutchman
2010-09-17 19:25 ` Xah Lee
2010-09-19 8:56 ` TheFlyingDutchman [this message]
2010-09-16 13:00 ` TheFlyingDutchman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5e2bcbd6-660d-4582-b682-fd88d29a4103@s24g2000pri.googlegroups.com \
--to=zzbbaadd@aol.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.