From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Joakim Hove Newsgroups: gmane.emacs.help Subject: Re: Emacs-Lisp question about "shell-command" Date: Thu, 19 Feb 2004 15:39:19 +0100 Organization: University of Bergen Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <4yvfm36smg.fsf@skjellgran.ii.uib.no> References: <6wsmh7l2z3.fsf@pino.iskp.uni-bonn.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1077202084 22376 80.91.224.253 (19 Feb 2004 14:48:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 19 Feb 2004 14:48:04 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 19 15:47:55 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AtpT1-0000X0-00 for ; Thu, 19 Feb 2004 15:47:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AtpS5-00061Y-HQ for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Feb 2004 09:46:57 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!bloom-beacon.mit.edu!news2.telebyte.nl!news.tdcnorge.no!news.equant.no!uninett.no!nntp.uib.no!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-NNTP-Posting-Host: skjellgran.ii.uib.no Original-X-Trace: toralf.uib.no 1077201248 52640 129.177.20.52 (19 Feb 2004 14:34:08 GMT) Original-X-Complaints-To: abuse@uib.no Original-NNTP-Posting-Date: 19 Feb 2004 14:34:08 GMT User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:e5uakVM1DUa9dTfAcMcI5E3pEo0= Original-Xref: shelby.stanford.edu gnu.emacs.help:121045 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:16995 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16995 Kay Ulbrich writes: > Hello! > > Under Linux (version information see end of message) I am using a > simple emacs-lisp function (the actual function is more complex, but > this question is just about "shell-command"): > > ;; __________________________________________________ > (defun my-command () > (interactive) > (let (command) > (setq command ("some-shell-command-generating-output &")) > (shell-command command "buffername") > )) > ;; __________________________________________________ This seems to work: (defun my-command () (interactive) (let ((window-c (current-window-configuration)) (command "some-shell-command ...")) (shell-command command) (set-window-configuration window-c))) i.e. the current window configuration is stored, and then subsequently recovered after the shell command is completed. HTH - Joakim -- /--------------------------------------------------------------------\ / Joakim Hove / hove@bccs.no / (55 5) 84076 | \ | Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 | | CMU | 5231 Paradis | \ Thormøhlensgt.55, 5020 Bergen. | 55 91 28 18 / \--------------------------------------------------------------------/