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

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

Re: reading the C source of Emacs


From: David Kastrup
Subject: Re: reading the C source of Emacs
Date: 11 Jan 2003 18:43:53 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Oliver Scholz <address@hidden> writes:

> I have just taught myself the very first baby steps of C. I want to
> read and understand the C sources of Emacs.

I have just taught myself the first 2 verb forms of ancient Greek (of
which there are basically {singular,dual,plural} x {1st,2nd,3rd person} x
{indicative,optative,conjunctive,participle,infinitive,imperative} x
{present,past,perfect,past perfect,aorist,future,past future} x
{active,medium,passive} (probably forgot a few here, and of course
you still have to decline your participles).  I want to read and
understand Thukydides.

> Not surprisingly I am pretty lost.

Same here.  You have to be aware that Emacs is basically a _Lisp_
machine with Lisp data structures.  The C code is vary much different
from ordinary C code because it constantly has to access and modify
non-C structures.

> What is a good starting point to read those sources? Is there any
> recommended order of reading?

grep for the Elisp function that you suspect to be the source of your
favorite annoyance/bug.  Fiddle around.  Anyhow: if you are not yet
comfortable with Elisp, start there.  It is not really possible to
understand much of what is going on inside of Emacs without knowing
the Lisp.  There is a short Elisp introduction available in the CVS
version of Emacs.

> Does anyone have any other recommendations on how to proceed? Can
> anyone -- for example -- recommend a shorter and simpler program
> whose sources are well documented and that I could study as a
> training before I try to read the Emacs sources? I am not interested
> in C programming in general, I just want to understand Emacs, if
> this is possible for me at all.

It is pretty difficult.  Emacs is rather complex, and you are
basically are asking for how to learn to play Back partitas on the
violin, and you don't want to learn playing the violin in general.  It
is possible, but it would annoy any prospective teachers and require
access to a basement where you are out of ear reach from your loved
ones.

The Emacs Lisp manual has a section "Emacs Lisp internals".  Required
reading, of course.

I believe that XEmacs might have more extensive internals
documentation, but it could well be that most of it does not apply to
Emacs: XEmacs developers would probably be more thorough documenting
the differences than the similarities between the two.  This is just
un aneducated guess of mine, however, and understanding XEmacs is
certainly a better help to understanding Emacs than, say,
understanding gcc would be.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


reply via email to

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