emacs-devel
[Top][All Lists]
Advanced

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

Re: What is emacs architecture ?


From: Stephen J. Turnbull
Subject: Re: What is emacs architecture ?
Date: Thu, 08 Jul 2010 12:27:41 +0900

Fren Zeee writes:

 > If it were truly a valuable document, someone _here_ would have
 > definitely pursued it, read it and likely enhanced the ideas.

That's really unfair.  There was a time when "here == where Emacs
development is done" had a centroid equal to "Jim Blandy's desk."

The problem is that sequels almost always suck, and from the sound of
the comments the book was poorly conceived (ie, "let's flog this dying
horse of 'Beautiful XXX' one more time and see if we can make another
buck") and edited.  Don't blame Jim.

 > Where do you get the very minimal of the emacs code ? For anyone to
 > contribute to emacs, there has to be some very minimal code to be
 > read and understood

This is false, at least if you want the same minimal code for
everybody.  Emacs has something at every level.  It provides functions
that are basically thin wrappers around libc calls that are thin
wrappers around kernel traps -- ie, it's almost an OS (unfortunately
not really multitasking yet).  It provides better abstractions for the
higher level libc APIs (like FILE*).  It provides a Lisp environment,
with full-fledged exception handling and a virtual machine.  It
provides interfaces to GUI toolkits and a GUI event loop.  Mostly it's
fairly modular; if you have a problem to solve, you learn about that
module.

 > and also documenting the journey for future reference when the
 > person starts forgetting.

I've already posted my advertisement, so won't repeat it.  But here's
some more advice for the explorer:

For internals:

1.  Start Emacs under gdb with emacs -q.  Interrupt it immediately,
    and investigate the functions you find on the stack.

2.  Call a *compiled* Lisp function that prompts.  Interrupt Emacs
    while it's waiting for the answer, and investigate the functions
    you find on the stack.

3.  Find the file defining Fgarbage_collect (for masochists only :-).

4.  src/data.c and src/fns.c.

For higher level stuff:

1.  Find a function that interests you and start drilling down until
    you find something you think you can do better. :-)




reply via email to

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