From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: making software with Emacs and Elisp Date: Fri, 25 Oct 2013 00:00:49 +0200 Organization: Informatimago Message-ID: <878uxifhwu.fsf@informatimago.com> References: <87ob6k23t3.fsf@nl106-137-194.student.uu.se> <87d2mw52sh.fsf@nl106-137-194.student.uu.se> <87mwlyh264.fsf@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1382652311 12974 80.91.229.3 (24 Oct 2013 22:05:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Oct 2013 22:05:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 25 00:05:17 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VZT1o-00052t-Uy for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Oct 2013 00:05:17 +0200 Original-Received: from localhost ([::1]:56418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZT1o-0008UX-E1 for geh-help-gnu-emacs@m.gmane.org; Thu, 24 Oct 2013 18:05:16 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 61 Original-X-Trace: individual.net ErqsTYkb2qEIyTmK6F4EdwO1Howqth2pLYTLglKgedFHSq+lH+ Cancel-Lock: sha1:ZWFjOTliNmM3ZjY2YWVlYTdhMDY4MDM4MjJjMTcwOTQ5OWYxZjNiZQ== sha1:61FlT36CpahhyBrsER5b7He/3sQ= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:201932 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94200 Archived-At: Emanuel Berg writes: > "Pascal J. Bourguignon" writes: > >> emacs does manage memory, or schedule processor time >> for the various functions running in emacs. > > So it does? Then it *is* an OS within the OS, at the > very least, like a Chinese box or those Russian > dolls. Indeed. > But - when does this happen? > And how is it done? > For example, if I write an interactive defun, I always > thought that was executed sequentially upon > invocation. Is that so? And, how do I code a defun that > is interactive in the sense it can be invoked by the > user, but "batch" in the sense that it is run in the > background, perhaps as an infinite loop? And if I make > two such defuns, can I give them different priorities, > and otherwise like the PCBs of a "real" OS, to setup how > they should relate to everything else? If you want to run processes in the outer system you can call start-process amongst a few other functions. But you can have code scheduled to run in emacs. It is not a preemptive system, but a collaborative one, where each task must release the CPU quickly enough for the rest of the system to stay responsive. But a lot of tasks are scheduled this way in emacs (eg. background font-locking, semantic incremental parses, etc). See: run-with-idle-timer Things like priorities or "how things relate to everything else" are notions specific to a given system. Eg. emacs run-with-idle-timer doesn't deal with priorities, only with timing. >> Also, "Operating System" doesn't mean unix-like >> architecture. You can have very different >> architectures. > > Yeah, I guess that's just a schoolbook issue anyway. > >> $ emacs -Q --batch -l myprogram.el >> ... >> $ cat myprogram >> #!/bin/sh >> exec emacs -Q --batch -l myprogram.el > > Great! -- __Pascal Bourguignon__ http://www.informatimago.com/