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

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

Re: Emacs-Lisp question about "shell-command"


From: Joakim Hove
Subject: Re: Emacs-Lisp question about "shell-command"
Date: Thu, 19 Feb 2004 15:39:19 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Kay Ulbrich <address@hidden> 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  / address@hidden  /  (55 5) 84076       |                 \
 | Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 |
 | CMU                                                | 5231 Paradis    |
 \ Thormøhlensgt.55, 5020 Bergen.                     | 55 91 28 18     /
  \--------------------------------------------------------------------/


reply via email to

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