[Top][All Lists]

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

Re: How do I get the definition of a function ?

From: Harald Hanche-Olsen
Subject: Re: How do I get the definition of a function ?
Date: Sat, 20 Oct 2007 23:42:06 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (berkeley-unix)

+ address@hidden:

> 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  Don't know why you involved
the other two lisp groups.

* Harald Hanche-Olsen     <URL:>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell

reply via email to

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