all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Asynchronous Process Handling
@ 2009-06-26 13:15 Nordlöw
  2009-06-26 13:48 ` Pascal J. Bourguignon
  0 siblings, 1 reply; 2+ messages in thread
From: Nordlöw @ 2009-06-26 13:15 UTC (permalink / raw)
  To: help-gnu-emacs

Is it possible to call a process asynchronously from with emacs and
later get back an async message or notification when the process has
finished possibly along with its return value and or output?

Thanks in advance,
Per Nordlöw


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Asynchronous Process Handling
  2009-06-26 13:15 Asynchronous Process Handling Nordlöw
@ 2009-06-26 13:48 ` Pascal J. Bourguignon
  0 siblings, 0 replies; 2+ messages in thread
From: Pascal J. Bourguignon @ 2009-06-26 13:48 UTC (permalink / raw)
  To: help-gnu-emacs

Nordlöw <per.nordlow@gmail.com> writes:

> Is it possible to call a process asynchronously from with emacs and
> later get back an async message or notification when the process has
> finished possibly along with its return value and or output?

Yes.    You can do it with processes and process filters.  I let you
read the documentation about them.



Here is another solution, which has the advantage for long processes,
to work even if you relaunch emacs.

Put:

    (defun process-my-result (result)
       (switch-to-buffer "*result*")
       (insert (format "%S" result)))

    (server-start)

in ~/.emacs

and launch the process as:
 
    (shell-command "( sleep 10 ; result=42 ; emacsclient --eval \"(process-my-result $result)\" ) & disown &"
                   nil nil)


-- 
__Pascal Bourguignon__


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-26 13:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-26 13:15 Asynchronous Process Handling Nordlöw
2009-06-26 13:48 ` Pascal J. Bourguignon

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.