Subject: Re: Ale rev-9 (PS2)

From: Loredana Lo Conte <[email-masked]>
Date: Wed, 21 Aug 2002 23:51:17 +0100 (BST)

And here are Jim's instructions for neophytes:

>
> > On 19 Aug 2002, Jim Blandy wrote:
> > > Well, which Emacs Lisp function are you calling, exactly?  What
> > > command are you using?
>
> There are two principles here:
>
> a) Using I-search and M-x grep is *not* cheating.  Use them at every step.
>
> b) While it is generally not possible to think of a purpose ("Construct
>    menu entries for color sets") and guess the name from that
>    ("gene-generate-color-set-menu"), it is almost always possible to do
>    the reverse, unless the programmer is a jerk.
>
> So:
>
> - The menus are in lisp/gene-menus.el.  (Use dired, and apply Principle B.)
> - If you search for the word "settings", there's a comment there that
>   says "settings menu".  (Principle a)
> - That's above the function gene-menu-popup-settings-menu.  (principle b)
> - In Emacs, you can get documentation on any Emacs Lisp function by
>   typing C-h f, and the function name.
> - So you can look at x-popup-menu, and learn how menus are
>   represented.
> - Then you can make sense of the value returned by
>   gene-menu-build-settings-menu, which is the next function.
>   (principles a and b)
> - Looking there, probably the color set menu is built by
>   gene-generate-color-set-menu. (b)
> - That doesn't seem to be defined in this file, according to isearch,
>   but a quick M-x grep suggests looking in gene-display.el.  (a)
> - That seems to generate a list of menu entries based on the color
>   sets available in gene-seq-buffer.  (Have you read about buffer-local
>   variables in Emacs Lisp?  You should.)  It seems to bind them to
>   a lambda form that calls gene-use-color-set.
> - gene-use-color-set is, in fact, a macro defined just above
>   gene-generate-color-set-menu.  (a)
> - It expands to a call to gene-use-color-set-internal.
>
> So that's probably the function you need to look at.  You'll need to
> use the Emacs Lisp manual; don't be ashamed to use the index.
>
> Have you ever used etags before?  etags can be very helpful when
> you're learning new code.
>
> (I have the impression that academic computer scientists often feel
> that they must know the entire body of code inside and out before they
> can work on it.  But this is foolish --- there is so much code in the
> world that nobody could ever read it all.  And it's also unnecessary:
> every courteous programmer follows a pretty standard set of idioms,
> structures, conventions, etc. that allow people to find their way
> through his or her code.  You should always assume at first that those
> idioms hold.)
>
> > - Is there a way of debugging Ale?
>
> > (Remember, I am not an elisp programmer and have never been such, it may
> > speed me up immensely if you guide me, few hints may be good enough).
>
> The *scratch* buffer, etags, C-h f, and M-: are your friends.
>

---

From: Karl Fogel <[email-masked]>
Date: 21 Aug 2002 15:09:33 -0500

> And here are Jim's instructions for neophytes:

Those are excellent!  We should put them up on the public web site.

And note that the method Jim describes is the method I actually used
to debug just now.

-K