From: ·········@gmail.com
Subject: How do I get the definition of a function ?
Date: 
Message-ID: <1192913731.881996.244460@v29g2000prd.googlegroups.com>
How do I get the definition, ie source code of a function in emacs
lisp ?

But if it shows some binary or opcode string.

How do I decompile the string ?

Please paste the session of an example
using eval last sexp or eval print last sexp.

Also what is the mathematics of the opcodes ?
Is it related to the combinators in any way ?
Is there any mathematics to speed up the interpretation
of these opcodes and keep their size minimal? Is there
any relation to the mathematics behind the lisp machines?

Just want to see the whole picture.

Thanks a lot for elucidation.

Gnuist

From: Harald Hanche-Olsen
Subject: Re: How do I get the definition of a function ?
Date: 
Message-ID: <pcoy7dxfopd.fsf@shuttle.math.ntnu.no>
+ ·········@gmail.com:

> How do I get the definition, ie source code of a function in emacs
> lisp ?

The easiest way is to type C-h f and give the name of the function, or
C-h k followed by the keystrokes that invoke the function, if it is an
interactive command.

You get a window saying something like this:

C-c C-c runs the command message-send-and-exit
   which is an interactive compiled Lisp function in `message'.

where the word "message" (the filename where the function was defined)
is a clickable link.  Click on it.

> But if it shows some binary or opcode string.

It won't.  Oh, you mean if you evaluate a form like this one:
(symbol-function 'message-send-and-exit)
Since the function was byte-compiled, you do get an array including
some bytecode, and also a dotted pair like
("/local/share/emacs/23.0.0/lisp/gnus/message.elc" . 106082)
which clearly points at the source code file and the appropriate
position in it.

You had more questions that I don't know how to answer.  Maybe someone
else did.

I have set followups to gnu.emacs.help.  Don't know why you involved
the other two lisp groups.

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell
From: Jason
Subject: Re: How do I get the definition of a function ?
Date: 
Message-ID: <1193149464.677425.312340@e34g2000pro.googlegroups.com>
On Oct 20, 1:55 pm, ·········@gmail.com wrote:
> How do I get the definition, ie source code of a function in emacs
> lisp ?
>
> But if it shows some binary or opcode string.
>
> How do I decompile the string ?
>
> Please paste the session of an example
> using eval last sexp or eval print last sexp.
>
> Also what is the mathematics of the opcodes ?
> Is it related to the combinators in any way ?
> Is there any mathematics to speed up the interpretation
> of these opcodes and keep their size minimal? Is there
> any relation to the mathematics behind the lisp machines?
>
> Just want to see the whole picture.
>
> Thanks a lot for elucidation.
>
> Gnuist

Try apropos [function-name]. If you get a buffer saying "[function-
name] is a function defined in `module` then click on the `module` and
you will get the definition.

-Jason