[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: making software with Emacs and Elisp
From: |
Pascal J. Bourguignon |
Subject: |
Re: making software with Emacs and Elisp |
Date: |
Fri, 25 Oct 2013 00:00:49 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Emanuel Berg <embe8573@student.uu.se> writes:
> "Pascal J. Bourguignon" <pjb@informatimago.com> 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/
- making software with Emacs and Elisp, Emanuel Berg, 2013/10/19
- Re: making software with Emacs and Elisp, Pascal J. Bourguignon, 2013/10/19
- Re: making software with Emacs and Elisp, Marcin Borkowski, 2013/10/20
- Message not available
- Re: making software with Emacs and Elisp, Emanuel Berg, 2013/10/22
- Re: making software with Emacs and Elisp, Marcin Borkowski, 2013/10/22
- Re: making software with Emacs and Elisp, Pascal J. Bourguignon, 2013/10/22
- Message not available
- Re: making software with Emacs and Elisp, Emanuel Berg, 2013/10/24
- Re: making software with Emacs and Elisp,
Pascal J. Bourguignon <=
- Re: making software with Emacs and Elisp, Emanuel Berg, 2013/10/24
- Re: making software with Emacs and Elisp, Pascal J. Bourguignon, 2013/10/24
- Message not available
- Re: making software with Emacs and Elisp, Emanuel Berg, 2013/10/24
- Re: making software with Emacs and Elisp, Pascal J. Bourguignon, 2013/10/25