all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How do I get the definition of a function ?
@ 2007-10-20 20:55 gnuist006
  2007-10-20 21:42 ` Harald Hanche-Olsen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gnuist006 @ 2007-10-20 20:55 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do I get the definition of a function ?
  2007-10-20 20:55 How do I get the definition of a function ? gnuist006
@ 2007-10-20 21:42 ` Harald Hanche-Olsen
  2007-10-20 23:24 ` Bastien
  2007-10-23 14:24 ` Jason
  2 siblings, 0 replies; 4+ messages in thread
From: Harald Hanche-Olsen @ 2007-10-20 21:42 UTC (permalink / raw)
  To: help-gnu-emacs

+ gnuist006@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do I get the definition of a function ?
  2007-10-20 20:55 How do I get the definition of a function ? gnuist006
  2007-10-20 21:42 ` Harald Hanche-Olsen
@ 2007-10-20 23:24 ` Bastien
  2007-10-23 14:24 ` Jason
  2 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2007-10-20 23:24 UTC (permalink / raw)
  To: help-gnu-emacs

gnuist006@gmail.com writes:

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

C-h k C-h f 

C-h f runs the command describe-function
  which is an interactive compiled Lisp function in `help-fns.el'.
It is bound to C-h f, <help> f, <menu-bar> <help-menu> <describe> <describe-function>.
(describe-function function)

Display the full documentation of function (a symbol).

-- 
Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do I get the definition of a function ?
  2007-10-20 20:55 How do I get the definition of a function ? gnuist006
  2007-10-20 21:42 ` Harald Hanche-Olsen
  2007-10-20 23:24 ` Bastien
@ 2007-10-23 14:24 ` Jason
  2 siblings, 0 replies; 4+ messages in thread
From: Jason @ 2007-10-23 14:24 UTC (permalink / raw)
  To: help-gnu-emacs

On Oct 20, 1:55 pm, gnuist...@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-10-23 14:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-20 20:55 How do I get the definition of a function ? gnuist006
2007-10-20 21:42 ` Harald Hanche-Olsen
2007-10-20 23:24 ` Bastien
2007-10-23 14:24 ` Jason

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.