unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Fren Zeee <frenzeee@gmail.com>
To: Jeff Clough <jeff@chaosphere.com>
Cc: emacs-devel@gnu.org
Subject: Re: What is emacs architecture ?
Date: Sun, 18 Jul 2010 21:49:50 -0700	[thread overview]
Message-ID: <AANLkTincJEDLsJgVq3DA9d2GUOY9GL2pLIUF30cJDa0L@mail.gmail.com> (raw)
In-Reply-To: <1278562570.16810.20.camel@logrus.localdomain>

On Wed, Jul 7, 2010 at 9:16 PM, Jeff Clough <jeff@chaosphere.com> wrote:
> I mostly just lurk on the list and putter around in Emacs as a sort of
> hobby project at this point, but I've made a number of personal
> modifications to the code and have figured out a thing or two.  Here's
> what I suggest as to learning how Emacs is built at the C level.
>
> 1.  Most of Emacs isn't even *at* the C level.  It's in the Lisp
> sources.  Make darn sure you know Emacs Lisp and have followed a bunch
> of calls and threaded your way through the Emacs sources to know how
> that all works.  Here, the Emacs Lisp debugger is your friend.  Learn
> how to unconditionally invoke it.  Create a function in Lisp which does
> this, then runs some interesting functions.  Step through and watch what
> happens.
>
> 2.  Once you get to a function called by Emacs Lisp that is implemented
> in C, dive into the source for that function and work through it.  Emacs
> is a large, complex project and you will find a lot of pre-processor
> macros have been defined to make C suitable for it's development.  Find
> the definitions for those macros and "hand expand" them to find out what
> is truly happening behind the scenes.
>
> 3.  Even seemingly trivial functions defined in the C sub-strata have a
> lot of cool stuff.  Look at "(point)" as an example.
>
> 4.  Stay away from running gdb.  You don't need to be stepping through
> code at that level.  You need to be understanding things like what cons
> cells are made of, what a buffer is, how buffer local variables work,
> etc.  That means reading their code, not threading your way through the
> execution stack to learning how one specific use of these things is
> handled.
>
> 5.  Question everything.  If you look at the math functions, for
> instance, you might see that *two* checks are done to find floating
> point numbers when division occurs.  Try to figure out why this happens.
>
> 6.  Create your own "toy" functions at the C level and expose them to
> Lisp.  These might even be non-toy functions.  If you run even the most
> "minimal" of functions to read a file into a buffer in Emacs, you'll be
> implicitly invoking more than a dozen calls to other functions.  Find a
> way to not do that and implement it.
>
> 7.  Ultimately, the best way to learn how something like Emacs works is
> to hack at it.  Make it do something else.  Break it.  Explore.  Find a
> function like forward-char and go through it and all of the functions it
> calls until you know what every line of C does to make that command
> work.
>
> That's what I did, anyway, and it seems to work for me.
>
> Jeff
>

This newbie really liked the suggestions by Jeff , Stephen and many of
you. However, it would help me most by imitating at this stage and
requesting a typescript of a session, and some comments. Since this is
Jeff's reply, here it would be best to concentrate on the plan by
Jeff. I communicated with him and he has some time and health issues
so anyone of this group, all of you experienced gurus, can anyone run
a typescript of commands and send me the output. I can then convert to
pdf and put comment boxes if I have questions.

Thanks
Franz

The typescript would show the exact steps and our experience would be
exactly the same. script is a unix command.

DESCRIPTION
     Script makes a typescript of everything printed on your terminal.  It is
     useful for students who need a hardcopy record of an interactive session
     as proof of an assignment, as the typescript file can be printed out
     later with lpr(1).



  reply	other threads:[~2010-07-19  4:49 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07  5:50 What is emacs architecture ? Fren Zeee
2010-07-07  6:07 ` Masatake YAMATO
2010-07-07 15:26   ` Karl Fogel
2010-07-07 15:36     ` Drew Adams
2010-07-07 17:30       ` Stephen Berman
2010-07-07 20:02         ` Karl Fogel
2010-07-07 22:28           ` Fren Zeee
2010-07-07 22:32             ` Karl Fogel
2010-07-08  3:27             ` Stephen J. Turnbull
2010-07-08  4:16               ` Jeff Clough
2010-07-19  4:49                 ` Fren Zeee [this message]
2010-07-08  7:06             ` Eli Zaretskii
2010-07-08  7:40             ` Thien-Thi Nguyen
2010-07-08 17:37               ` Karl Fogel
2010-07-19  4:35                 ` Fren Zeee
2010-07-19 14:43                   ` Óscar Fuentes
2010-07-19 17:12                     ` Chad Brown
2010-07-19 22:04                       ` Fren Zeee
2010-07-19 22:39                         ` Chad Brown
2010-07-20  2:10                           ` Stephen J. Turnbull
2010-07-20  2:58                             ` Óscar Fuentes
2010-07-20  5:19                               ` Stephen J. Turnbull
2010-07-20 12:53                                 ` Óscar Fuentes
2010-07-20  3:00                             ` Miles Bader
2010-07-20  3:24                               ` Óscar Fuentes
2010-07-20  5:13                                 ` Miles Bader
2010-07-20 12:42                                   ` Óscar Fuentes
2010-07-20  5:21                               ` Stephen J. Turnbull
2010-07-20  6:21                             ` Fren Zeee
2010-07-20  8:23                               ` Stephen J. Turnbull
2010-07-20  8:59                                 ` Andreas Schwab
2010-07-21  3:25                                   ` Fren Zeee
2010-07-21  7:51                                     ` Andreas Schwab
2010-07-21  3:28                                 ` Fren Zeee
2010-07-21 14:49                                   ` David Robinow
2010-07-20  8:48                               ` Andreas Schwab
2010-07-07 18:15   ` Fren Zeee
2010-07-08  0:09     ` Stephen J. Turnbull
2010-07-08  6:42       ` Eli Zaretskii
2010-07-08  8:22         ` Stephen J. Turnbull
2010-07-08  9:44           ` Eli Zaretskii
2010-07-07 18:51   ` Fren Zeee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTincJEDLsJgVq3DA9d2GUOY9GL2pLIUF30cJDa0L@mail.gmail.com \
    --to=frenzeee@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=jeff@chaosphere.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).